grahamkdt

Hello... I'm relatively new to this coding game, so this may sound like a dumb question, but I desperately need an answer!

I want to play a .wav audio file from within the click event of a button control. I'm coding in Visual Basic for WM6 Professional, if this makes any difference. There seems to be a lot of help for playing audio for VB.NET, but not .NET CF Could someone please give me the code required to do this, but remember I'm a beginner so please keep it as simple as possible. Thanks



Re: .NET Compact Framework Code to play .wav file?

ScubaSteve20001

Unfortunately, the .NET CF doesn't have a "built-in" mechanism to play wave files. However, the system does have an API to do so, which can be accessed by P/Invoking into the PlaySound API. Here is a link that should fill in all those details:

http://samples.gotdotnet.com/quickstart/CompactFramework/doc/playsounds.aspx




Re: .NET Compact Framework Code to play .wav file?

Ilya Tumanov

That was asked and answered countless times. Search for "sound" in these forums to find it.






Re: .NET Compact Framework Code to play .wav file?

grahamkdt

... if you can't be helpful, say nothing!





Re: .NET Compact Framework Code to play .wav file?

Ilya Tumanov

"Give a man a fish; you have fed him for today. Teach a man to fish; and you have fed him for a lifetime"

What Im saying is: learn to search for information you need on your own, its faster than asking in a forum and waiting for an answer.






Re: .NET Compact Framework Code to play .wav file?

Mdanh2002

Hi

this topic may seem a bit old to follow up... anyway I am trying to play a wav file on WM5. i could play it properly, but is it possible to play the sound to the internal headset (default for calls) instead of the loudspeaker

Thanks Smile