Home

Awesome

libilbc

Build Status

This is a packaging-friendly copy of the iLBC codec from the WebRTC project. It provides a base for distribution packages and can be used as drop-in replacement for the code from RFC 3591.

Compiling

libilbc requires the following to compile:

Abseil Common C++ Libraries is also a prerequisite, but it comes bundled with release tarballs (or provided as a submodule for Git users) so there's no need to install it separately.

  1. If you are not using a release tarball, you can clone this repo with:

    git clone --depth=1 https://github.com/TimothyGu/libilbc.git
    git submodule update --init
    
  2. Generate build files: cmake .

    If you instead want a static library, instead run cmake -DBUILD_SHARED_LIBS=OFF . per CMake docs.

  3. Build it: cmake --build .

    You should now get a library file (.so, .dylib, .dll, .a, or .lib depending on your platform) as well as a ilbc_test program.

  4. (optional) Try it out. This repo comes a sample.pcm audio file that is in a form ilbc_test accepts (raw signed 16-bit PCM, mono, sampled at 8000 Hz). The following command encodes sample.pcm to encoded.ilbc, and then decode it again to decoded.pcm.

    ./ilbc_test 20 sample.pcm encoded.ilbc decoded.pcm
    

    You can try to play the before/after audio with mpv:

    mpv --demuxer=rawaudio --demuxer-rawaudio-rate=8000 --demuxer-rawaudio-channels=1 sample.pcm
    mpv --demuxer=rawaudio --demuxer-rawaudio-rate=8000 --demuxer-rawaudio-channels=1 decoded.pcm
    

    You can create your own sample file too. The command I used was:

    ffmpeg -f pulse -i default -f s16le -filter:a "pan=1|c0=c0+c1,aresample=8000" sample.pcm
    

    which gets the audio input from Linux's PulseAudio, and then remixes and resamples it.

  5. (optional; for Unix-like systems) Installing. If you want to install the library and the ilbc_test utility to system locations, run either ninja install or make install depending on which build system you chose (or cmake --install . on CMake 3.15 or later). By default, the library gets installed to /usr/local; to tweak the install prefix, set -DCMAKE_INSTALL_PREFIX=<path> when running cmake; see docs.

Supported platforms

The following platforms are regularly run on CI and are thus supported:

The following architectures get cross-compiled on CI and thus probably work. But we don't know for sure if it actually runs:

These platforms are known to not work:

All other platforms may work out of the box. If they don't, a simple change to rtc_base/system/arch.h will most likely fix it up.

For packagers

There are some additional CMake options available to the fine folks packaging this library. For the most part, we use the GNUInstallDirs CMake module to determine where things are installed, which should generally do the right thing. If it doesn't, try: