I am trying to convert a PCM Wav file recorded with the WasapiLoopbackCapture class to an AAC file. The Wav file is 44100, 32bit, 4 channels.
using (var reader = new MediaFoundationReader("recordedfile.wav"))
{
MediaFoundationEncoder.EncodeToAac(reader, "encodedfile.mp4");
}
However, i get a COMException from the MediaFoundationReader: Exception from HRESULT: 0xC00D5212
What am i doing wrong here and what would be the proper way to convert from PCM WAV to AAC?
Thanks
This probably means you haven't got an AAC encoder (or something is up with the WaveFormat of your recorded WAV file). What version of Windows are you using?
I battled this problem for a few days before ultimately discovering that you need to install The Microsoft Media Foundation AAC Decoder.
https://www.microsoft.com/en-us/download/confirmation.aspx?id=13283
User contributions licensed under CC BY-SA 3.0