views:

321

answers:

2

I'd like to play back ogg vorbis audio from http in Silverlight. What do I need to make this happen?

+1  A: 

Silverlight does not support playing ogg vorbis files.

If you'd like Silverlight to play files already encoded in ogg vorbis, I suggest converting them. Either do a one time sweeping convert of all your files, or convert them on the fly while your server is serving them.

Alternatively, In Silverlight 4, assuming you know enough about Media Formats and Ogg vorbis is particular, you can implement MediaStreamSource to support ogg vorbis. http://msdn.microsoft.com/en-us/library/system.windows.media.mediastreamsource%28VS.96%29.aspx

JustinAngel
There are open source C# implementations of encode portion of the Ogg Vorbis codec that will work with Silverlight. See my answer for more details.
Ken Smith
+3  A: 

A better answer than "Silverlight doesn't support Ogg Vorbis" is to say that Silverlight doesn't support playing them natively. As one of the other commenters pointed out, a way to play them is described at http://veritas-vos-liberabit.com/monogatari/2009/03/moonvorbis.html, with the current source for CSVorbis available at http://anonsvn.mono-project.com/viewvc/trunk/csvorbis/. You would indeed need to implement a MediaStreamSource to play the resulting PCM stream, but that's not rocket science.

Ken Smith