I am encoding data from a receiver (speech or digital data plus noise) using Opus. I am looking at the output as I vary options bench as the predicted packet loss, enabling of FEC, complexity, etc. and I seem to generally get ~75kbps regardless of the settings I choose. Now I can "force" Opus to a specific bitrate by supplying the rate instead of AUTO and in that case I seem to get about 20kbps plus the rate I specified. (10 -> 32, 40 -> 63, 80 -> 103)
Here's my code:
OpusEncoder *ptr = NULL;
ptr = opus_encoder_create(24000, 2, OPUS_APPLICATION_AUDIO, &err);
if (err<0)
{
output("failed to create an encoder: %s\n", opus_strerror(err));
return NULL;
}
err = opus_encoder_ctl(ptr, OPUS_SET_BITRATE(OPUS_AUTO));
opus_encoder_ctl(ptr, OPUS_SET_COMPLEXITY(1));
opus_encoder_ctl(ptr, OPUS_SET_MAX_BANDWIDTH(OPUS_BANDWIDTH_SUPERWIDEBAND));
opus_encoder_ctl(ptr, OPUS_SET_PACKET_LOSS_PERC(5));
opus_encoder_ctl(ptr, OPUS_SET_INBAND_FEC(TRUE));
return ptr;
Is this to be expected or am I missing something? I originally thought maybe my code wasn't "working" but I can change the bandwidth and hear the loss of frequencies in the upper bands not contained in the bandwidth so this makes me believe that things are working, in general.
Thanks