Daler
Daler

Reputation: 1205

How to convert PCM raw data to mp3 file?

EDITED my question: Is there any encoders from PCM raw data to any audio file? mp3,ogg... but not WAV, as it will be too big

I do have a text file which has raw PCM array, and I want to convert it to mp3,ogg file. After long search I couldnt find some library which does provide this encoding (PCM to MP3). Im looking forward to have some suggestions or maybe links to such libraries.

It should be done programmatically in android phone, so I dont want to have some desktop solutions.

Upvotes: 4

Views: 9678

Answers (2)

18446744073709551615
18446744073709551615

Reputation: 16852

I think, you must check the licensing issues first. AFAIK mp3 software has never been free. Linux did support mp3, but had to build the code on the local machine instead of downloading a ready-to-use package. (Not sure if this has changed in recent years.)

[Re: EDITED] Other formats are easier, e.g.:

How to encode Recorded voice to ogg vorbis?

How to convert the WAV/OGG file to FLAC file in Android?

Upvotes: 0

Dodge
Dodge

Reputation: 8307

there is a github project that provides lame encoder for android
https://github.com/intervigilium/liblame

there is also an sample app that uses the library
https://github.com/intervigilium/Lame4Android

but as allready stated, if you want to encode/decode a mp3 file you may have to pay license/patent fees.

here you can find the mp3 license prices
http://mp3licensing.com/royalty

Upvotes: 0

Related Questions