Play a Sound File and know when it's finished...

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi all,

As the title suggests, I'm trying to play back an audio file and know
when it's finished.

I've tried several methods:

1. My.Computer.Audio.Play - No way of knowing when a file is finished
playing

2. SoundPlayer - Same as #1

3. Media Player SDK 9.0 - Duration flag not set correctly - always 0.
Even tried a workaround of creating the newMedia manually, still 0.

4. DirectSounds - works, but only when the app is in focus

Although it seems like a simple thing to do, I'm having a lot of
trouble.

I need to:

1. Play a sound asynchronously
2. Get notified when the sound is finished playing
3. The app can be in the foreground or background
4. Get some basic information about the file - such as duration,
frequency, etc. etc

So what is my best option?

Thanks!
 
Thanks for the update.

I also wonder how can my program know when using WMP control after a
song is finished, i mean which event area i must enter the mediaended
or mediaStopped code.
 
Back
Top