Detecting Runing WAV file

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

Guest

Hi All,
How could i detect if a Runing wav file have finished or not, so i could
begin playing another file after the first is finished.
Thanks in advance..
Regards

Tamer Hesham
 
Have you seen inside OpenNETCF.Multimedia.Audio.Player class?

Take a look at DonePlaying wavedonehandler. You assign it as the
typicak EventHandler. It is fired when the audio file is finished
playing.

Hope it helps.
 
I have some problems when i try to use OpenNETCF, when i use play function,
it runs good, when i use stop function it stops the runing wav file, but when
i try to play again, it fails.
Any way , is there a way to detect the file by using an API or it is
difficult to be done??

Thanks
Tamer Hesham
 
You can detect when the file has finished with the handler I've told
you. Works ok.
What errors are you having when playing second time? Just it does not
play, or any error is thrown?

Maybe you need something like www.fmod.org, a free and awesome music
library for the Compact Framework.

Regards.
 
When i play file for the second time, an exception thrown that file not open,
and also, the wav file when it is played is not good in quality.
The playsound API is good.
could i use the event direct not from the OpenNet dll?
regards..
 
Use PlaySound synchronously. When the next line of code executes, it's done
playing.

-Chris
 
Yes, but now i have to wait till the file ends, so i can't for example
increase decrease volume, stoping the file or do anything else till file
runing ends.

Tamer
 
Well put the call on another thread then - this really isn't as complicated
as you're making it out to be.

--
Chris Tacke
Co-founder
OpenNETCF.org
Are you using the SDF? Let's do a case study.
Email us at d c s @ o p e n n e t c f . c o m
http://www.opennetcf.org/donate
 
Okay, i made a thread and called the play function from it, and it worked
well, but how could i know that the thread is terminated so i could know that
the playing WAV file is ended,
Thanks
And sorry for disturbing but i am new to mobile applications.

Tamer Hesham
 
Or do a WaitForSingleObject() on the thread handle, if you have access to
that result of CreateThread(). The thread handle will be signaled when the
thread has exited...

Paul T.
 
Back
Top