how to decode amr files using c#.net

2.8k views Asked by At

I need to decode amr format to pcm format, which is later converted to mp3 using c#.net. But I am hardly finding any library to do so. It seems with NAudio it is not possible. Is there any c# based open source library which can be used to decode this format files?. Presently I am working on windows server 2012(64 bit).

NAudio Code:

public void Decode() 
{
 .....
 var result= new MediaFoundationReader("..\\sample.amr");
 // later converted to  mp3 here
}
2

There are 2 answers

0
Roman Ryltsov On BEST ANSWER

It looks you two guys are doing the same thing: How to convert amr files to mp3 using C#

You typically need to have a [third party] AMR decoder installed and integrated into Windows API (ACM, DirectShow, Media Foundation). Then you will use your favorite library around this API, such as NAudio.

Example of AMR decoder: MONOGRAM AMR Pack.

0
Mark Heath On

You're unlikely to find a C# decoder for AMR files. I'd recommend just finding a command-line utility that you can call to convert to PCM. For example, it looks like sox can be used to decode AMR.