Java – How do I convert PCM raw data to mp3 files?

How do I convert PCM raw data to mp3 files?… here is a solution to the problem.

How do I convert PCM raw data to mp3 files?

Edited my question: Is there an encoder from PCM raw data to any audio file? mp3,ogg… But not WAV, because it’s too big

I

have a text file containing a raw PCM array and I want to convert it to mp3, ogg files. After a long search, I couldn’t find some libraries that offer this encoding (PCM to MP3). I look forward to some suggestions or links to these libraries.

It should be done programmatically in android phones, so I don’t want to have some desktop solution.

Solution

There is a GitHub project that provides Lame encoders
for Android
https://github.com/intervigilium/liblame

There is also a sample application
that uses the library
https://github.com/intervigilium/Lame4Android

But as mentioned earlier, if you want to encode/decode mp3 files, you may have to pay license/patent fees.

Here you can find MP3 license prices

http://mp3licensing.com/royalty

Related Problems and Solutions