This project has moved and is read-only. For the latest updates, please go here.

WMAFileReader only likes WaveOut

Feb 9, 2014 at 12:38 PM
Hi,

I'm creating my own little media player and got mp3 and ogg vorbis (through NVorbis.NAudioSupport) working fine. I'm playing the audio through a WaveOutEvent outputdevice.

Today I tried adding support for WMA using NAudio.WindowsMediaFormat and got no sound. The wma files are reported as playing but nothing seems to happen. When changing the outputdevice to WaveOut instead of WaveOutEvent, wma files play normally.

Is there any way to get wma to play through WaveOutEvent (I like the fact that it plays on a different thread)?
Feb 10, 2014 at 11:51 AM
it's the threading that's causing the problem, due to the fact that this is a COM-based API. It's a really annoying problem to fix in .NET. You could try using MediaFoundationReader instead which has a workaround for this issue
Feb 10, 2014 at 5:42 PM
Thank you! MediaFoundationReader is the solution. Many thanks for this fantastic library!