We help IT Professionals succeed at work.

Loop Audio

I'm trying to use the latest release of Microsoft Visual Basic to play a WAV file.  I want to loop the audio.  Is there a way to do this without a noticeable gap?  Is there a library available that can do this?
Comment
Watch Question

dovidfCEO

Commented:
How are you playing the wav file?
Ray TurnerSenior Consultant

Author

Commented:
I found a way to play it using

    My.Computer.Audio.Play(MediaFile, AudioPlayMode.BackgroundLoop)

This works great!

However,  I would like to have the following information.
a. How much of the file has played (in seconds).
b. How much is remaining the be played (in seconds).
c. Has the playing of the file reached the end.
Ray TurnerSenior Consultant

Author

Commented:
I found a way to play it using

    My.Computer.Audio.Play(MediaFile, AudioPlayMode.BackgroundLoop)

This works great!

However,  I would like to have the following information.
a. How much of the file has played (in seconds).
b. How much is remaining to be played (in seconds).
c. Has the playing of the file reached the end.
Ray TurnerSenior Consultant

Author

Commented:
I tried the this

https://stackoverflow.com/questions/20022864/c-sharp-axwindowsmediaplayer-loop

It does not work.  It causes the loop to 'stuttered'

This works.  No 'stutter' just a continuous loop.

My.Computer.Audio.Play(MediaFile, AudioPlayMode.BackgroundLoop)
Ray TurnerSenior Consultant

Author

Commented:
I have no problem purchasing a third-party solution if it works.
dovidfCEO

Commented:
This video may be of interest

https://www.youtube.com/watch?v=A0ZBAPPtbKQ
Ray TurnerSenior Consultant

Author

Commented:
Very Interesting!  I'll keep for future reference.  For now I'll go with

My.Computer.Audio.Play(MediaFile, AudioPlayMode.BackgroundLoop)

It works.
Senior Consultant
Commented:
My.Computer.Audio.Play(MediaFile, AudioPlayMode.BackgroundLoop)

It works.