Search code examples
androidsipvoippjsipopus

Enable and configure OPUS codec on PJSIP 2.5.1 on Android


I'm building a VOIP application on Android using PJSIP library.

I was trying to enable OPUS codec since OPUS was supported in PJSIP from v2.5.

I've followed the following link to configure OPUS on PJSIP.

I inserted #define PJMEDIA_HAS_OPUS_CODEC 1 in config_site_sample.h file to enable the OPUS codec.

But when I was trying to build PJSIP, I was getting the following error

../src/pjmedia-codec/opus.c:31:23: fatal error: opus/opus.h: No such file or directory
 #include <opus/opus.h>
                       ^
compilation terminated.

Am I doing anything wrong? What is the actual procedure to enable OPUS codec in PJSIP?


Solution

  • you have to set the compiler-flag --with-opus=[absolute-path-to]/opus-dev-lib like described here: https://trac.pjsip.org/repos/ticket/1904

    Don't change the static variables in the source code.