NAudio - 1.7 - Converting WAV to MP4

1

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

audio
wav
naudio
aac
asked on Stack Overflow May 24, 2013 by Faris Zacina

2 Answers

1

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?

answered on Stack Overflow May 29, 2013 by Mark Heath
0

I battled this problem for a few days before ultimately discovering that you need to install The Microsoft Media Foundation AAC Decoder.

https://superuser.com/questions/819227/how-to-fix-missing-media-foundation-microsoft-aac-audio-decoder-transform-mft-wi

https://www.microsoft.com/en-us/download/confirmation.aspx?id=13283

answered on Stack Overflow Jan 25, 2016 by theycallmemorty • edited Mar 20, 2017 by Community

User contributions licensed under CC BY-SA 3.0