Speak protocol 3.0 and fall back to 2.0 only when that is the reflector's maximum.
A reflector that has moved to 3.0 will not accept a station that always announces 2.0, and a 2.x reflector still needs one explicit plaintext session. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -5,6 +5,10 @@ package opus
|
||||
#cgo pkg-config: opus
|
||||
#include <opus.h>
|
||||
|
||||
static void reset_decoder(OpusDecoder *dec) {
|
||||
opus_decoder_ctl(dec, OPUS_RESET_STATE);
|
||||
}
|
||||
|
||||
static int configure_encoder(OpusEncoder *enc) {
|
||||
int err;
|
||||
err = opus_encoder_ctl(enc, OPUS_SET_BITRATE(20000));
|
||||
@@ -114,6 +118,14 @@ func (d *Decoder) Decode(packet []byte) ([]int16, error) {
|
||||
return pcm, nil
|
||||
}
|
||||
|
||||
// Reset clears decoder state after a gap in the received audio.
|
||||
func (d *Decoder) Reset() {
|
||||
if d == nil || d.dec == nil {
|
||||
return
|
||||
}
|
||||
C.reset_decoder(d.dec)
|
||||
}
|
||||
|
||||
// Close releases the decoder.
|
||||
func (d *Decoder) Close() {
|
||||
if d == nil || d.dec == nil {
|
||||
|
||||
Reference in New Issue
Block a user