Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / Compact Framework / January 2006

Tip: Looking for answers? Try searching our database.

Detecting Runing WAV file

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Tamer Hesham - 13 Dec 2005 09:51 GMT
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
Lonifasiko - 13 Dec 2005 09:57 GMT
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.
Tamer Hesham - 13 Dec 2005 10:47 GMT
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
Lonifasiko - 13 Dec 2005 11:12 GMT
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.
Tamer Hesham - 13 Dec 2005 11:35 GMT
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..
<ctacke/> - 13 Dec 2005 13:21 GMT
Use PlaySound synchronously.  When the next line of code executes, it's done
playing.

-Chris

> 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..
Tamer Hesham - 13 Dec 2005 13:47 GMT
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
Chris Tacke, eMVP - 13 Dec 2005 15:56 GMT
Well put the call on another thread then - this really isn't as complicated
as you're making it out to be.

Signature

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

> 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
Tamer Hesham - 14 Dec 2005 09:26 GMT
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
<ctacke/> - 14 Dec 2005 13:46 GMT
Have the thread raise an event or set a flag variable.

-Chris

> 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
[quoted text clipped - 4 lines]
>
> Tamer Hesham
Paul G. Tobey [eMVP] - 14 Dec 2005 15:48 GMT
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.

> Have the thread raise an event or set a flag variable.
>
[quoted text clipped - 8 lines]
>>
>> Tamer Hesham
Sergey Bogdanov - 13 Jan 2006 08:29 GMT
I think he can just use the OpenNETCF.Threading.ThreadEx class instead.

--
Sergey Bogdanov [.NET CF MVP, MCSD]
http://www.sergeybogdanov.com

> 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
[quoted text clipped - 14 lines]
>>>
>>>Tamer Hesham

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.