Detecting Runing WAV file

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
 
L

Lonifasiko

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.
 
G

Guest

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
 
L

Lonifasiko

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.
 
G

Guest

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..
 
G

Guest

Use PlaySound synchronously. When the next line of code executes, it's done
playing.

-Chris
 
G

Guest

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
 
C

Chris Tacke, eMVP

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
 
G

Guest

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
 
P

Paul G. Tobey [eMVP]

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top