Generic CTLs

These macros are used with the opus_decoder_ctl and opus_encoder_ctl calls to generate a particular request.

These macros are used with the opus_decoder_ctl and opus_encoder_ctl calls to generate a particular request.

When called on an OpusDecoder they apply to that particular decoder instance. When called on an OpusEncoder they apply to the corresponding setting on that encoder instance, if present.

Some usage examples:

int ret;
opus_int32 pitch;
ret = opus_decoder_ctl(dec_ctx, OPUS_GET_PITCH(&pitch));
if (ret == OPUS_OK) return ret;
opus_encoder_ctl(enc_ctx, OPUS_RESET_STATE);
opus_decoder_ctl(dec_ctx, OPUS_RESET_STATE);
opus_int32 enc_bw, dec_bw;
opus_encoder_ctl(enc_ctx, OPUS_GET_BANDWIDTH(&enc_bw));
opus_decoder_ctl(dec_ctx, OPUS_GET_BANDWIDTH(&dec_bw));
if (enc_bw != dec_bw) {
printf("packet bandwidth mismatch!\n");
}
See also
Opus Encoder, opus_decoder_ctl, opus_encoder_ctl, Decoder related CTLs, Encoder related CTLs