0

I am writing a simple audio player with ASIO and MIDI control support that is going to be used by a local radio station. I am using the NAudio library. The station uses some weird ancient software that uses mp2 encoded wav files. The file itself plays fine on all windows versions in WMP or VLC Players it also plays fine with my player on Windows 10, but many computers there are still running Windows 7 and when I try to play the file on windows 7, the program throws an exception:

System.Runtime.InteropServices.COMException (0xC00D5212): Výjimka na základě hodnoty HRESULT: 0xC00D5212
   v NAudio.MediaFoundation.IMFSourceReader.SetCurrentMediaType(Int32 dwStreamIndex, IntPtr pdwReserved, IMFMediaType pMediaType)
   v NAudio.Wave.MediaFoundationReader.CreateReader(MediaFoundationReaderSettings settings)
   v NAudio.Wave.MediaFoundationReader.Init(MediaFoundationReaderSettings initialSettings)
   v NAudio.Wave.MediaFoundationReader..ctor(String file)

which I believe is "Missing codec", do any of you have any idea how to get around this? I am using the MediaFoundationReader() in the NAudio library.

anonyfous
  • 1
  • 1
  • https://stackoverflow.com/questions/5495490/decode-mpeg1-2-video-with-media-foundation – Hans Passant Apr 07 '20 at 15:03
  • thanks, but that probably won't help. I think I need a media foundation enabled mp2 decoder, or maybe I could use the NLayer library, which is able to play the file, but i still need the program to support standart WAV's. I have no idea how to use multiple readers with NAudio, any advice? – anonyfous Apr 08 '20 at 03:58
  • I don't think any codec is missing, I think any library is incompatible with windows 7. Check all DLL files, and also try it on another windows 7 to make sure whether it occurs on all windows 7.I have been this type of issue because of bad windows version. – Sorry IwontTell Apr 08 '20 at 14:09
  • I have tried on several Win 7 machines, also tried clean installation, but no luck. Any other format plays just fine trough the MediaFoundationReader on Win 7. – anonyfous Apr 08 '20 at 14:58

1 Answers1

0

It seems that it is hard to get a MF enabled MP2 codec for Widows 7. I ended up using the NLayer library and edited the AudioFileReader type in NAudio library si that it can understand the MP2 WAV file.

anonyfous
  • 1
  • 1