2

I am using NAudio MFT to convert different audio formats to MP3. Now i want to convert amr file to MP3 using Naudio MFT. But, when i given amr file as input to MFT, it has thrown following exception "Exception from HRESULT: 0xC00D36C4". Is there any way to achieve this?

My C# code:

public byte[] ConvertAMRToMP3( )
{      
  var data = new MediaFoundationReader("..\\amr\\test.amr");
  MediaFoundationEncoder.EncodeToMP3(data, "..\\test.mp3", 128000);
  ......
}

I am working on windows server 2012 64-bit platform.

Thanks in advance.

Roman R.
  • 68,205
  • 6
  • 94
  • 158
Champ
  • 118
  • 2
  • 6

1 Answers1

0

0xC00D36C4 is MF_E_UNSUPPORTED_BYTESTREAM_TYPE "The byte stream type of the given URL is unsupported."

There is no support for AMR in Media Foundation codecs.

Roman R.
  • 68,205
  • 6
  • 94
  • 158
  • Hi @Roman, thanks for quick reply, can you please suggest me if there is any way to convert amr files to mp3 using C# – Champ Dec 03 '13 at 07:47
  • You need codecs to back AMR decoding. You need Media Foundation MFT to do it through Media Foundation, or you need an ACM format decoder. Or, DirectShow decoder and then you will change your code to transcode through DirectShow. All in all, you need components to handle this format, since stock components don't cover it. – Roman R. Dec 03 '13 at 08:29