{{{ #!html
}}} = Using OpenCORE AMR NB and WB Codecs (moved) = Moved to: https://docs.pjsip.org/en/latest/specific-guides/audio/opencore-amr.html '''Table of Contents''' [[PageOutline(2-3,,inline)]] This page describes how to add OpenCORE AMR-NB and AMR-WB support into PJSIP. [[BR]] == Building and Installing OpenCORE AMR Library == This instruction applies for '''all platforms''' that OpenCORE supports, '''including Windows'''. For Windows, you need to use MinGW to build the OpenCORE library. We tested building the OpenCORE libraries for Linux, MacOS X, Windows (MinGW), and !BlackBerry 10 (BB10). === Building and installing OpenCORE AMR library === 1. Download the latest [http://sourceforge.net/projects/opencore-amr/files/opencore-amr/ opencore-amr] tarball. We tested with version 0.1.3. 1. Unpack the tarballs to a directory: {{{ $ cd my_build_directory $ tar xzf opencore-amr-0.1.3.tar.gz $ }}} 1. Run configure. Add {{{--prefix}}} to install the library to an alternate directory (such as your home folder) instead of to the system wide {{{/usr}}} directory: {{{ $ ./configure --prefix=/home/foo }}} 1. Or if you're building for BB10, then download {{{generic-configure-bb10}}} script in the attachment in the bottom of this page, copy it to the opencore-amr directory, and use it instead. Make sure BB10 environment variables have been set as per BB10 instructions. {{{ $ chmod +x generic-configure-bb10 $ ./generic-configure-bb10 --prefix=/home/foo }}} 1. Build and install: {{{ $ make && make install }}} === Adding AMR-WB Support === The OpenCORE AMR tarball contains AMR-NB encoder and decoder, but only AMR-WB decoder. We have to install AMR-WB encoder separately: 1. Download the latest [http://sourceforge.net/projects/opencore-amr/files/vo-amrwbenc/ vo-amrwbenc] tarball. We tested with version 0.1.3 1. Unpack the tarballs to a directory: {{{ $ cd my_build_directory $ tar xzf vo-amrwbenc-0.1.3.tar.gz $ }}} 1. Run configure. If you use {{{--prefix}}}, make sure it has the same prefix as the one you used when configuring opencore-amr library: {{{ $ ./configure --prefix=/home/foo }}} 1. Again if you're building for BB10, then download {{{generic-configure-bb10}}} script in the attachment in the bottom of this page, copy it to the opencore-amr directory, and use it instead: {{{ $ chmod +x generic-configure-bb10 $ ./generic-configure-bb10 --prefix=/home/foo }}} 1. Build and install: {{{ $ make && make install }}} === Testing The Installation === To verify, make sure '''include''' directory in the installation directory contains these files. Suppose you use {{{--prefix=/home/foo}}}, then: {{{ $ ls /home/foo/include opencore-amrnb opencore-amrwb vo-amrwbenc }}} [[BR]] == Adding AMR Support in PJSIP == === Make Build System (MacOS X, Linux, BB10, etc.) === 1. In the pjproject directory, run {{{configure}}} script, specifying the installation directory of OpenCORE codec to the {{{--with-opencore-amr}}} option: {{{ $ ./configure --with-opencore-amr=/home/foo }}} 1. Or if you're building for BB10, then use {{{configure-bb10}}} instead. See [wiki:Getting-Started/BB10 BB10 Getting Started] instructions for the complete instructions on how to build PJSIP for BB10: {{{ $ ./configure-bb10 --with-opencore-amr=/home/foo }}} 1. Check the output of {{{configure}}} command, make sure that the codecs are detected: {{{ checking for OpenCORE AMR installations.. Using OpenCORE AMR prefix... /home/foo ... ... OpenCORE AMR-NB library found, AMR-NB support enabled ... ... OpenCORE AMR-WB library found, AMR-WB support enabled }}} 1. If the codecs are not enabled, that means the {{{configure}}} script were unable to find some files in the specified directory. Check the screen output again to see what were missing, and rebuild or reinstall the OpenCORE libraries if necessary. 1. Build PJSIP: {{{ $ make dep && make clean && make }}} 1. PJSIP is now built with OpenCORE AMR support === Windows === 1. Add your installed OpenCORE directories to Visual Studio include and lib paths. You should know how to do this. 1. Configure and build pjsip with Visual Studio: 1. Download the latest pjproject 1. Add this to your {{{config_site.h}}}: {{{ #define PJMEDIA_HAS_OPENCORE_AMRNB_CODEC 1 /* And if you want to have AMR-WB support: */ #define PJMEDIA_HAS_OPENCORE_AMRWB_CODEC 1 }}} 1. Build the pjproject solution. 1. The AMR-NB (and AMR-WB) codecs are now available ready to be used. ==== Notes ==== On MSVC, there may be linking error such as: {{{ unresolved external symbol ___chkstk referenced in function _coder }}} A possible solution is by manually appending {{{_chkstk.o}}} to {{{libvo-amrwbenc.a}}}: {{{ $ cd $ ar x /libgcc.a _chkstk.o $ ar q libvo-amrwbenc.a _chkstk.o }}} [[BR]] == Testing PJSIP For OpenCORE AMR Support == 1. Run {{{pjsua}}} 1. List the codecs with {{{Cp}}} command from pjsua console: {{{ >>> Cp List of audio codecs: ... 128 AMR/8000/1 128 AMR-WB/8000/1 ... List of video codecs: ... Enter codec id and its new priority (e.g. "speex/16000 200", "H263 200"), or empty to cancel. Codec name ("*" for all) and priority: Done >>> }}} {{{ #!html
}}}