471,612 Members | 2,518 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,612 software developers and data experts.

Second audio file gets truncated

I am using Windows Media Player to play my half second audio files one after
the other using the code below...

My problem comes when I play a second audio file immediately after the first
one stops sometimes on slower computers the audio on the second file gets
truncated on the beginning of playing the second file. What can I do to
minimize this truncation of audio? Right now I am having to add 1 second of
blank audio to the beginning of the second audio file but I would rather not
have the delay.

Here the code I am using ...

+++++++++++++++++++++++

' Play first voice file

AxWindowsMediaPlayer1.URL = voice1.mp3
' Play echo voice file once first one completes

If e.newState = Me.AxWindowsMediaPlayer1.playState.wmppsStopped then

BeginInvoke(New MethodInvoker(AddressOf playItAgain))

end if
Private Sub playItAgain()
AxWindowsMediaPlayer1.URL = voiceEcho.mp3
End Sub

+++++++++++++++++++++++

Thanks!

Bob
Jul 21 '08 #1
1 1586
Are you able to use

My.Computer.Audio.Play(filename1, AudioPlayMode.WaitToComplete)
My.Computer.Audio.Play(filename2, AudioPlayMode.WaitToComplete)

instead?

--
David Streeter
Synchrotech Software
Sydney Australia
"BobAchgill" wrote:
I am using Windows Media Player to play my half second audio files one after
the other using the code below...

My problem comes when I play a second audio file immediately after the first
one stops sometimes on slower computers the audio on the second file gets
truncated on the beginning of playing the second file. What can I do to
minimize this truncation of audio? Right now I am having to add 1 second of
blank audio to the beginning of the second audio file but I would rather not
have the delay.

Here the code I am using ...

+++++++++++++++++++++++

' Play first voice file

AxWindowsMediaPlayer1.URL = voice1.mp3
' Play echo voice file once first one completes

If e.newState = Me.AxWindowsMediaPlayer1.playState.wmppsStopped then

BeginInvoke(New MethodInvoker(AddressOf playItAgain))

end if
Private Sub playItAgain()
AxWindowsMediaPlayer1.URL = voiceEcho.mp3
End Sub

+++++++++++++++++++++++

Thanks!

Bob
Jul 22 '08 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by Jay | last post: by
45 posts views Thread by Anthony Irwin | last post: by
1 post views Thread by XIAOLAOHU | last post: by
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.