How to convert PCM raw data to mp3 file?

最后都变了- 提交于 2019-12-01 04:29:45

问题


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.


回答1:


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




回答2:


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?



来源:https://stackoverflow.com/questions/15900934/how-to-convert-pcm-raw-data-to-mp3-file

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!