From my experience, audio support with compact framework 2 is far more tedious than in ce3, you have to make do with very little, so it may be a good idea to use 3, but of course there are situations when you have to use ce2. Using compact framework 3 you have access to far more including the [SoundPlayer] class which has support for many many audio files and does the work for you. >> whenever a message comes in it should play a sound file The most common way of playing a sound for ce2 would be to use [PlaySound]... this is probably your best solution. Once you add the class at this link you can create your own objects, either by passing a file path or a nice way is to refer to your Resources and get the files byte array...
Sound sound = new Sound(YourApplication.Properties.Resources.SoundFile);
sound.Play();
Now the class at that link doesnt seem to work when using the stream constructor, so add the following constructor to the class... You need to add this for the byte array constructor example above to work...
public Sound(byte[] sound_bytes)
{
// read the data from the stream
m_soundBytes = sound_bytes;
}
Now, unfortunately from what I have tested this only supports .WAV files. You can either do this... or try using WaveOut to play your sounds, which will still only support .WAV files but can be built upon to support more... Or you can play any file the phone supports by calling the local systems Media Player with a file as the argument file to execute... db There are 10 kinds of people, those that understand binary, and those that don't...