--- /dev/null
+//go:build !decodersetcomplexity
+
+package main
+
+import "gopkg.in/hraban/opus.v2"
+
+func DecoderSetComplexity(dec *opus.Decoder, complexity int) error {
+ return nil
+}
--- /dev/null
+//go:build decodersetcomplexity
+
+package main
+
+import "gopkg.in/hraban/opus.v2"
+
+func DecoderSetComplexity(dec *opus.Decoder, complexity int) error {
+ return dec.SetComplexity(complexity)
+}
if err != nil {
log.Fatal(err)
}
+ if err = DecoderSetComplexity(dec, 10); err != nil {
+ log.Fatal(err)
+ }
var player io.WriteCloser
var cmd *exec.Cmd
@include install.texi
@include usage.texi
@include vad.texi
+@include libopus.texi
@include proto.texi
@bye
--- /dev/null
+@node libopus
+@unnumbered libopus
+
+It is @strong{strongly} advisable to use the latest and much more
+advanced version of @code{libopus}.
+@url{https://wiki.hydrogenaud.io/index.php?title=Opus, Look} how many
+features and optimisations it gains from version to version.
+
+Current latest version @url{https://opus-codec.org/demo/opus-1.5/, brings}
+various ML-related enhancements for the decoder. Unfortunately Opus
+wrapper library does not provide @code{Decoder.SetComplexity} call.
+There is @url{git://git.stargrave.org/go-opus.git, fork} fork including
+it. Clone it somewhere, add Go module replacement in your current's
+@file{go.mod} file and build client with @code{decodersetcomplexity} tag
+specified:
+
+@example
+$ git clone git://git.stargrave.org/go-opus.git
+$ realpath go-opus | read pth
+$ echo "replace gopkg.in/hraban/opus.v2 => $pth" >> go.mod
+$ ./mk-bin decodersetcomplexity
+@end example
+
+Do not forget, that @code{libopus} must be built with
+@code{--enable-deep-plc} and @code{--enable-osce} to enable use of those
+advanced techniques.
mkdir -p bin
[ -d vendor ] && $vendor="-mod=vendor"
strip=-ldflags=-s
-go build -C cmd/vad $strip $vendor $@ -o ../../bin/vors-vad
-go build -C cmd/keygen $strip $vendor $@ -o ../../bin/vors-keygen
-go build -C cmd/server $strip $vendor $@ -o ../../bin/vors-server
-go build -C cmd/client -tags nolibopusfile $strip $vendor $@ -o ../../bin/vors-client
+tags="nolibopusfile"
+[ -z "$1" ] || tags="$tags,$1"
+go build -C cmd/vad $strip $vendor -o ../../bin/vors-vad
+go build -C cmd/keygen $strip $vendor -o ../../bin/vors-keygen
+go build -C cmd/server $strip $vendor -o ../../bin/vors-server
+go build -C cmd/client -tags $tags $strip $vendor -o ../../bin/vors-client