From: Sergey Matveev Date: Thu, 11 Apr 2024 16:37:31 +0000 (+0300) Subject: Seems DTX won't harm X-Git-Tag: v1.0.0~14 X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=5209e56a4c8a2b160892b965e293209dcadd276fdc67d3b10fa56c62ac91b2a3;p=vors.git Seems DTX won't harm --- diff --git a/cmd/client/sound.go b/cmd/client/audio.go similarity index 95% rename from cmd/client/sound.go rename to cmd/client/audio.go index d8c8bee..0b41d02 100644 --- a/cmd/client/sound.go +++ b/cmd/client/audio.go @@ -31,6 +31,10 @@ func newOpusEnc() *opus.Encoder { if err != nil { log.Fatal(err) } + err = enc.SetDTX(true) + if err != nil { + log.Fatal(err) + } err = enc.SetBitrate(vors.Bitrate) if err != nil { log.Fatal(err) diff --git a/cmd/client/main.go b/cmd/client/main.go index bd7fba6..ceb8563 100644 --- a/cmd/client/main.go +++ b/cmd/client/main.go @@ -533,6 +533,10 @@ func main() { if err != nil { log.Fatal(err) } + if n <= 2 { + // DTX + continue + } incr(nonce[len(nonce)-3:]) copy(buf, nonce[len(nonce)-4:]) diff --git a/doc/proto.texi b/doc/proto.texi index f3c1209..ead9def 100644 --- a/doc/proto.texi +++ b/doc/proto.texi @@ -3,7 +3,8 @@ VoRS uses Opus codec with 20ms frames with 48kHz 1ch 16-bit S-LE sound. It uses native @code{libopus}'es Packet Loss Concealment (PLC) feature -if number of lost frame does not exceed 32 count. +if number of lost frame does not exceed 32 count. DTX (discontinuous +transmission) is also on. Each frame has single byte stream identifier (unique identifier of the participant) and 24-bit big-endian packet counter. Reordered packets are