Click here to Skip to main content
15,896,154 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hello guys.
I want to compress audio file (reduce size of audio file) using C# code after compress audio file , that audio file are decompress in android part.


Can you please suggest reference link or code for compress audio file using c# Code and decompress using android code .


Thanks in advance.
Laxman Prajapati .
Posted

Pretty much, you can't.
Most music file formats are compressed already, and the only way to make significant size reductions on existing files is to reduce the quality - which is not reversible.

You can try recoding them into different formats (MP3 -> WMA or FLAC perhaps) but even then you aren't guaranteed to get a smaller file as a result - it will depend on the actual music contained in the file.
 
Share this answer
 
For most purposes, "raw" audio ("WAV") needs to be compressed. There is a good number of media compression standards, containers and algorithms. I just don't want to overview them all and discuss compatibility; this topic is too big. On most purely audio devices, unfortunately, the dominated format is badly obsolete MP3, followed by proprietary Microsoft WMA. In other media, notably in video, these algorithms have become rare, now better MPEG4 audio is dominating. If your devices use are well-known OS, such as Windows or Android, you have much more freedom. Anyway, of you have properly compressed media file, its further compression is pointless.

Best library and the utility for all kinds of media conversion is FFMpeg or libavcodec:
http://en.wikipedia.org/wiki/FFmpeg[^],
http://ffmpeg.org/[^],
http://en.wikipedia.org/wiki/Libavcodec[^],
http://libav.org/[^].

It is available on many platforms, including Microsoft's, and on Android:
http://sourceforge.net/projects/ffmpeg4android[^].

Instead of using the utility by starting a process (which is also a solution), you can use a .NET wrapper. Please see my past answer: how to convert image to video in C#[^].

—SA
 
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