From 7545f6c648654feb1a497746588f2286a4439f58 Mon Sep 17 00:00:00 2001 From: Sergey Matveev Date: Thu, 11 Apr 2024 20:23:26 +0300 Subject: [PATCH] Decoder.SetComplexity --- decoder.go | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/decoder.go b/decoder.go index da6ac81..176d5be 100644 --- a/decoder.go +++ b/decoder.go @@ -18,6 +18,12 @@ bridge_decoder_get_last_packet_duration(OpusDecoder *st, opus_int32 *samples) { return opus_decoder_ctl(st, OPUS_GET_LAST_PACKET_DURATION(samples)); } + +int +bridge_decoder_set_complexity(OpusDecoder *st, opus_int32 complexity) +{ + return opus_decoder_ctl(st, OPUS_SET_COMPLEXITY(complexity)); +} */ import "C" @@ -260,3 +266,12 @@ func (dec *Decoder) LastPacketDuration() (int, error) { } return int(samples), nil } + +// SetComplexity sets the decoder's computational complexity +func (dec *Decoder) SetComplexity(complexity int) error { + res := C.bridge_decoder_set_complexity(dec.p, C.opus_int32(complexity)) + if res != C.OPUS_OK { + return Error(res) + } + return nil +} -- 2.48.1