How to convert amr files to mp3 using C#

杀马特。学长 韩版系。学妹 提交于 2019-12-11 02:55:18

问题


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.


回答1:


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.



来源:https://stackoverflow.com/questions/20344191/how-to-convert-amr-files-to-mp3-using-c-sharp

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!