views:

703

answers:

2

I'm using this code from Microsoft to play audio notifications for my application. It's working fine when the user chooses a wav file, but it doesn't play when they choose a wma file.

Is there any way I can support wma files? A lot of the built-in alarm and ringtones seem to be wma.

A: 

Have a look at the Windows Media Player Control.

According to the documentation, you should be able to play WMA files.

Charlie Salts
A: 

And to answer my own question again, I found that using the following works in WM6: [DllImport("aygshell.dll")] internal static extern uint SndPlaySync(string file, uint flags);

This doesn't work in WM5 though, so I fall back to the old method to play wav files there.

Jake Stevenson