encoder.go | 5 ++++- diff --git a/encoder.go b/encoder.go index 21696da6a53ea57c8344f1fa90382d0efbf0f35a..976091b73eafb27db3c1ab36b84be7d6f1223993 100644 --- a/encoder.go +++ b/encoder.go @@ -130,7 +130,7 @@ } return n, nil } -// Configures the encoder's use of discontinuous transmission (DTX). +// UseDTX configures the encoder's use of discontinuous transmission (DTX). func (enc *Encoder) UseDTX(use bool) { dtx := 0 if use { @@ -139,11 +139,14 @@ } C.bridge_encoder_set_dtx(enc.p, C.opus_int32(dtx)) } +// DTX reports whether this encoder is configured to use discontinuous +// transmission (DTX). func (enc *Encoder) DTX() bool { dtx := C.bridge_encoder_get_dtx(enc.p) return dtx != 0 } +// SampleRate returns the encoder sample rate in Hz. func (enc *Encoder) SampleRate() int { return int(C.bridge_encoder_get_sample_rate(enc.p)) }