External Codecs
Setting the codecs
Ringtone Creator Java Library relies on third-party codecs to support certain PCM formats. The reason is simple: they're already implemented and tested, and since they're compiled in the native code, they're generally faster than the Java implementation.
Codecs are set with the help of system properties. For each codec 4 properties can be specified:
| Property name | Property meaning | Example |
| rtc.parser.format.name | Name of the format decoder | rtc.parser.mp3.name=lame |
| rtc.parser.format.path | Path to the format decoder executable | rtc.parser.mp3.path=/usr/bin/lame |
| rtc.converter.format.name | Name of the format encoder | rtc.converter.mp3.name=lame |
| rtc.converter.format.path | Path to the format encoder executable | rtc.converter.mp3.path=/usr/bin/lame |
Note that encoder and decoder can be different applications.
To enable decoder for some format you should set its two parser properties. Two converter properties should be set to enable encoder.
System properties can be provided in several ways depending on your environment.
You can pass them as the command-line parameters to java with -D options
or set inside your Java code
Supported codecs
| Format | Encoders supported | Decoders supported |
| MP3 | lame – Lame MP3 encoder | lame – Lame MP3 decoder |
| AMR NB | 3GPP – 3GPP AMR NB encoder
SonyEricsson SonyEricsson (MikSoft) encoder (Windows)
NMMC – Nokia Multimedia Converter encoder (Windows) | 3GPP – 3GPP AMR NB decoder
SonyEricsson – SonyEricsson (MikSoft) decoder (Windows) |
| AMR WB | 3GPP – 3GPP AMR NB encoder
NMMC – Nokia Multimedia Converter encoder (Windows) | 3GPP – 3GPP AMR NB decoder |
| QCP | QUALCOMM – Qualcomm Pure Voice encoder (Linux, Windows) | QUALCOMM – Qualcomm PureVoice decoder (Linux, Windows) |
| AAC | FAAC – FAAC encoder | FAAD – FAAD decoder |
| Ffmpeg | Ffmpeg – Ffmpeg encoder | there is no need to use Ffmpeg as decoder |
Downloading and installing the codecs
MP3
MP3 (lame) for Windows is available for download from
http://mitiok.cjb.net/. Other platforms:
http://www.rarewares.org/mp3.html.
Free BSD users can install it from the port located here:
/usr/ports/audio/lame.
AMR NB (Win 32)
Preconditions:
- You need the floating point implementation (TS 26.104). Its sources can be downloaded from
this website.
- Use the MSVC compiler and a standard makefile.win32 build script.
How to make it work:
- Don't change anything. Just run make -f makefile.win32
Postconditions:
- You should get the following executables: encoder.exe and decoder.exe.
AMR NB (*nix)
Preconditions:
- You need the fixed point implementation (TS 26.073). It sources can be downloaded from
this website.
- Use the gcc compiler and the
makefile.cc build script.
How to make it work:
- Use the gcc compiler. Change CC=CC to CC=gcc in the first line.
- Append the MMS_IO definition. Change CFLAGS = -I. $(CFLAGS_$(MODE)) -D$(VAD) to CFLAGS = -I. $(CFLAGS_$(MODE)) -D$(VAD) -DMMS_IO
- Leave the default options: VAD1, no ETSI.
- Make everything: make -f makefile.cc
Postconditions:
- You should get the following executables: encoder and decoder.
AMR NB (Mac OS)
Preconditions:
- You need the fixed point implementation (TS 26.073). It sources can be downloaded from
this website.
- Use the gcc compiler and the
makefile.cc build script.
Postconditions:
- You should get the following executables: encoder and decoder.
AMR WB (Win 32)
Preconditions:
- You need the floating point implementation (TS 26.204). Its sources can be downloaded from
this website.
- Use the lcc-win32 compiler and the
makefile.lcc build script.
How to make it work:
- Download and use the
lcc compiler. We tested AMR WB with lcc version 3.8 (Apr 4, 2005). Use lc, make and lcclnk utilities from this package.
- Leave all options by default.
- Make everything: make -f makefile.lcc
Postconditions:
- You should get the following executables: encoder.exe and decoder.exe.
AMR WB (*nix)
Preconditions:
- You need the floating point implementation (TS 26.204). Its sources can be downloaded from
this website.
- Use the gcc compiler and the
makefile.gcc build script.
How to make it work:
- Download the makefle.gcc from the link above and use it. The build file from the original distribution may not compile on your platform.
- Leave all options by default
- Make everything: make -f makefile.gcc
Postconditions:
- You should get the following executables: encoder and decoder.
AMR WB (Mac OS)
The same as AMR WB for *nix plus the two extra instructions from building AMR NB for Mac OS.
QCP (Linux, Windows)
QCP is supported with the help of Qualcomm
Pure Voice converter. Its binaries are available for download from
http://www.cdmatech.com/products/purevoice_download.jsp. Choose the proper version for your platform. Unfortunately, FreeBSD, Solaris and MacOS don't support this codec.
AAC (All platforms)
AAC is supported with the help of FAAD decoder and FAAC encoder.
Their source code can be obtained at
http://www.audiocoding.com/ and compiled for your platform.
Windows binaries are available for download from
http://www.rarewares.org/aac.html
FreeBSD users can install FAAC/FAAD from the ports located here:
/usr/ports/audio/faac,
/usr/ports/audio/faad.
Or see
http://www.freshports.org/audio/faac/ and
http://www.freshports.org/audio/faad/
Ffmpeg (All platforms)
Ffmpeg is the main video-conversion tool. It is used in RingtoneCreator for conversion of ringtones to 3GP-compatible audio files with AAC audio stream inside.
You can find precompiled Ffmpeg for your OS here:
Get Precompiled Codecs
Or you can build and install Ffmpeg manually. See these pages for details:
FFmpeg
Installation on Linux
Installation on FreeBSD
Installation on Windows