Click here to Skip to main content
15,910,773 members
Please Sign up or sign in to vote.
2.50/5 (2 votes)
See more:
Hi all,
In my application i want to convert audio file which is in the form of .amr file to .wav file using c#. How to do that?
Thanks in advance.
Posted
Updated 1-Mar-12 4:19am
v4

You can use the OpenCORE AMR library:
http://sourceforge.net/projects/opencore-amr/[^].

Dowload it here:
http://sourceforge.net/projects/opencore-amr/files/latest/download[^].

This Wikipedia article shows general information of the AMR codec. If you want to try to find some other supporting library, please see:
http://en.wikipedia.org/wiki/Adaptive_Multi-Rate_audio_codec#Software_support[^].

Try to find the Open Source product and see its sour code. VLC is Open Source, for example:
http://en.wikipedia.org/wiki/VLC_media_player[^],
http://www.videolan.org/vlc/[^].

The library I referenced first is written in C, as well as most codecs you may find, so you would need to 1) translate the code in C#; 2) make a native DLL out of it and use in your C# project via P/Invoke, 3) use the code in C++/CLI project; in this case: 3a) translate the code in C++/CLI, 3b) create a mixed-mode (managed+unmanaged) C++/CLI project, wrap C code in C++/CLI "ref" classes/structures and make them public; in both cases, you can make a C++/CLI library and reference it in your C# project as a regular .NET assembly.

If you need to learn P/Invoke, please see:
http://en.wikipedia.org/wiki/P/Invoke[^],
http://msdn.microsoft.com/en-us/library/Aa712982[^].

This CodeProject article can also be useful:
Essential P/Invoke[^].

On C++/CLI, please see:
http://en.wikipedia.org/wiki/C%2B%2B/CLI[^],
http://msdn.microsoft.com/en-us/library/xey702bw.aspx[^],
http://www.ecma-international.org/publications/standards/Ecma-372.htm[^].

All parts of this work will require good programming qualification. Even though you are not required to know all the details of C, quite good understanding of the basics is required. If you are going to use C++/CLI, you would need pretty good understanding of the basics of both C++ and C++/CLI. In all cases, you would need to understand the structure of the presentation of .NET and raw C types to work through marshaling between them. Well, there is no an easier way.

—SA
 
Share this answer
 
REAL SOLUTION (mac):
1) OPEN FILE IN QUICKTIME
2) CLICK FILE > EXPORT
3) CHOOSE .AIF or .WAV

DONE...
www NateBeats com
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900