Search code examples
androidcodeclinphoneopus

using opus in linphone


i would like to use opus codec in my linphone application

but i have a few questions , if someone with opus codec knowledge could help me out would appreciate

  1. OPUS. Does this codec compress as well as package the data?
  2. What is the output data structure from OPUS?
  3. Is the output data streaming or packets?
  4. What does the audio sampling scheme look like? and….
  5. Within the audio sampling scheme, what are the values for silence?
  6. Within the audio sampling scheme, what are the values for speech?

thx in advance


Solution

  • I see you asked this on the mailing list too, but I'll answer here. I'm not sure what you mean in some the questions, but here's a start. You've tagged your post as relating to Android; I mostly know about the reference C implementation, so if you're asking about the java interface available to Android applications this won't be much help.

    OPUS. Does this codec compress as well as package the data?

    The Opus codec compressed pcm audio data into packets. There's internal structure, but the codec requires a transport layer like RTP to keep track of the boundaries between compressed packets.

    What is the output data structure from OPUS?

    The reference encoder accepts a given duration of pcm audio data an fills in a given buffer with compressed data up to a maximum requested size. See opus_encode() and opus_encode_float() in the encoder documentation for details.

    Is the output data streaming or packets?

    Opus produces a sequence of packets.

    What does the audio sampling scheme look like? and….

    The reference encoder accepts interleaved mono, stereo, or surround pcm audio data with either 16-bit signed integer or floating point samples at 8, 12, 16, 24, or 48 kHz.

    Within the audio sampling scheme, what are the values for silence?

    Zero pcm values are silence. As a perceptual codec Opus will try to encode low-level noise if there is no other signal. There is also support for special zero-data compressed packets for sending silence or handling discontinuous transmission.

    Within the audio sampling scheme, what are the values for speech?

    I'm not sure what you're asking here. Speech is treated the same as music, and will sound equally normal down to 64 kbps. The codec can maintain transparency for speech down to much lower bitrates than for music (something like 24 kbps for mono) and is intelligible down to 6 kbps for narrowband speech.