I want to compile the lame encoder for Android. How can I find the tutorials for Lame and its compiling for Android platform.
Thanks,
LAME (Lame Ain't an MP3 Encoder) is the Hydrogenaudio recommended MP3 encoder. It has been developed by the open-source community since 1998, and has become the highest quality MP3 encoder for most purposes. Some benefits of using LAME: Highly optimised presets.
LAME is a software encoder that converts digital audio into the MP3 Audio coding format. LAME is a free software project that was first released in 1998, and has incorporated many improvements since then, including an improved psychoacoustic model.
LAME is a software codec designed to encode audio data in the MP3 format. LAME is one of the most highly-regarded MP3 encoders, capable of converting audio data to the lossy MP3 format with minimal decline in quality.
There used to be a good blog post on how to compile lame for Android, but for some reason it's been offline for a while and only available on some dodgy Chinese sites.
I'll just copy the content below:
porting compiling lame encoder to Android ARM arch using Android NDK
I was looking for a mp3 encoding application in Android Market, and found very few, the reason I think Android doesn't support mp3 encoding is because mp3 is patented technology. Another reason is I guess people prefer Java programming and Android SDK rather than Android native development kit.
Nevertheless compiling libmp3lame library for Android using Android NDK is very easy actually.
- download Android NDK(also you need Android SDK and Eclipse with ADT plugin) and create simple project.
- create directory called "jni" in your project's directory.
- download lame sources, extract, copy all sources from directory libmp3lame to jni directory. Also copy lame.h which is located in include directory of lame sources.
- create jni/Android.mk file. it should look like this:
LOCAL_PATH := $(call my-dir) include $(CLEAR_VARS)` LOCAL_MODULE := mp3lame LOCAL_SRC_FILES := bitstream.c fft.c id3tag.c mpglib_interface.c presets.c quantize.c reservoir.c tables.c util.c VbrTag.c encoder.c gain_analysis.c lame.c newmdct.c psymodel.c quantize_pvt.c set_get.c takehiro.c vbrquantize.c version.c include $(BUILD_SHARED_LIBRARY)
- clean lame sources, remove what's left from GNU autotools,
Makefile.am
,Makefile.in
,libmp3lame_vc8.vcproj
,logoe.ico
,depcomp
, foldersi386
,vector
.- edit file
jni/utils.h
, and replace definitionextern ieee754_float32_t fast_log2(ieee754_float32_t x);
with thisextern float fast_log2(float x);
- go to the root directory of your Android project and run
$pathtoandroidndk/ndk-build
and you're done, you'll havelimp3lame.so
compiled.
Also, the following question on SO might be of interest for you, as it deals with some issues after compiling lame for Android:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With