diff --git a/go.mod b/go.mod index 0b24638..3fc1d3b 100644 --- a/go.mod +++ b/go.mod @@ -1,19 +1,20 @@ module git.stormux.org/storm/barnard -go 1.21.5 +go 1.25.0 require ( - github.com/alessio/shellescape v1.4.2 - github.com/golang/protobuf v1.5.3 + al.essio.dev/pkg/shellescape v1.6.0 + github.com/hraban/opus v0.0.0-20251117090126-c76ea7e21bf3 github.com/kennygrant/sanitize v1.2.4 github.com/nsf/termbox-go v1.1.1 - github.com/pelletier/go-toml/v2 v2.2.4 + github.com/pelletier/go-toml/v2 v2.3.1 + google.golang.org/protobuf v1.36.11 ) require ( - github.com/mattn/go-runewidth v0.0.9 // indirect - golang.org/x/net v0.20.0 // indirect - google.golang.org/protobuf v1.26.0 // indirect + github.com/clipperhouse/uax29/v2 v2.7.0 // indirect + github.com/mattn/go-runewidth v0.0.23 // indirect + golang.org/x/net v0.54.0 // indirect ) replace git.stormux.org/storm/barnard/gumble/go-openal => ./gumble/go-openal diff --git a/go.sum b/go.sum index 5928b0a..dd68be5 100644 --- a/go.sum +++ b/go.sum @@ -1,22 +1,23 @@ -github.com/alessio/shellescape v1.4.2 h1:MHPfaU+ddJ0/bYWpgIeUnQUqKrlJ1S7BfEYPM4uEoM0= -github.com/alessio/shellescape v1.4.2/go.mod h1:PZAiSCk0LJaZkiCSkPv8qIobYglO3FPpyFjDCtHLS30= -github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= -github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= -github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= -github.com/google/go-cmp v0.5.5 h1:Khx7svrCpmxxtHBq5j2mp/xVjsi8hQMfNLvJFAlrGgU= -github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +al.essio.dev/pkg/shellescape v1.6.0 h1:NxFcEqzFSEVCGN2yq7Huv/9hyCEGVa/TncnOOBBeXHA= +al.essio.dev/pkg/shellescape v1.6.0/go.mod h1:6sIqp7X2P6mThCQ7twERpZTuigpr6KbZWtls1U8I890= +github.com/clipperhouse/uax29/v2 v2.7.0 h1:+gs4oBZ2gPfVrKPthwbMzWZDaAFPGYK72F0NJv2v7Vk= +github.com/clipperhouse/uax29/v2 v2.7.0/go.mod h1:EFJ2TJMRUaplDxHKj1qAEhCtQPW2tJSwu5BF98AuoVM= +github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8= +github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU= +github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 h1:El6M4kTTCOh6aBiKaUGG7oYTSPP8MxqL4YI3kZKwcP4= +github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510/go.mod h1:pupxD2MaaD3pAXIBCelhxNneeOaAeabZDe5s4K6zSpQ= +github.com/hraban/opus v0.0.0-20251117090126-c76ea7e21bf3 h1:0Cfb13Z/8Hdt9TSqgAQbQDAHgXyeq242y2lZ2JzFjNw= +github.com/hraban/opus v0.0.0-20251117090126-c76ea7e21bf3/go.mod h1:12ayqqPQ1IxPiV4oWRgHfcDGhNQkx12X5k2hAayezW0= github.com/kennygrant/sanitize v1.2.4 h1:gN25/otpP5vAsO2djbMhF/LQX6R7+O1TB4yv8NzpJ3o= github.com/kennygrant/sanitize v1.2.4/go.mod h1:LGsjYYtgxbetdg5owWB2mpgUL6e2nfw2eObZ0u0qvak= -github.com/mattn/go-runewidth v0.0.9 h1:Lm995f3rfxdpd6TSmuVCHVb/QhupuXlYr8sCI/QdE+0= github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= +github.com/mattn/go-runewidth v0.0.23 h1:7ykA0T0jkPpzSvMS5i9uoNn2Xy3R383f9HDx3RybWcw= +github.com/mattn/go-runewidth v0.0.23/go.mod h1:XBkDxAl56ILZc9knddidhrOlY5R/pDhgLpndooCuJAs= github.com/nsf/termbox-go v1.1.1 h1:nksUPLCb73Q++DwbYUBEglYBRPZyoXJdrj5L+TkjyZY= github.com/nsf/termbox-go v1.1.1/go.mod h1:T0cTdVuOwf7pHQNtfhnEbzHbcNyCEcVU4YPpouCbVxo= -github.com/pelletier/go-toml/v2 v2.2.4 h1:mye9XuhQ6gvn5h28+VilKrrPoQVanw5PMw/TB0t5Ec4= -github.com/pelletier/go-toml/v2 v2.2.4/go.mod h1:2gIqNv+qfxSVS7cM2xJQKtLSTLUE9V8t9Stt+h56mCY= -golang.org/x/net v0.20.0 h1:aCL9BSgETF1k+blQaYUBx9hJ9LOGP3gAVemcZlf1Kpo= -golang.org/x/net v0.20.0/go.mod h1:z8BVo6PvndSri0LbOE3hAn0apkU+1YvI6E70E9jsnvY= -golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4= -golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= -google.golang.org/protobuf v1.26.0 h1:bxAC2xTBsZGibn2RTntX0oH50xLsqy1OxA9tTL3p/lk= -google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +github.com/pelletier/go-toml/v2 v2.3.1 h1:MYEvvGnQjeNkRF1qUuGolNtNExTDwct51yp7olPtrEc= +github.com/pelletier/go-toml/v2 v2.3.1/go.mod h1:2gIqNv+qfxSVS7cM2xJQKtLSTLUE9V8t9Stt+h56mCY= +golang.org/x/net v0.54.0 h1:2zJIZAxAHV/OHCDTCOHAYehQzLfSXuf/5SoL/Dv6w/w= +golang.org/x/net v0.54.0/go.mod h1:Sj4oj8jK6XmHpBZU/zWHw3BV3abl4Kvi+Ut7cQcY+cQ= +google.golang.org/protobuf v1.36.11 h1:fV6ZwhNocDyBLK0dj+fg8ektcVegBBuEolpbTQyBNVE= +google.golang.org/protobuf v1.36.11/go.mod h1:HTf+CrKn2C3g5S8VImy6tdcUvCska2kB7j23XfzDpco= diff --git a/gumble/go-openal/openal/example_test.go b/gumble/go-openal/openal/example_test.go index d18cff6..d4f0c60 100644 --- a/gumble/go-openal/openal/example_test.go +++ b/gumble/go-openal/openal/example_test.go @@ -7,7 +7,7 @@ import ( "time" ) -func ExamplePlay() { +func Example_play() { device := openal.OpenDevice("") defer device.CloseDevice() @@ -42,10 +42,9 @@ func ExamplePlay() { } source.Delete() fmt.Println("sound played") - // Output: sound played } -func ExampleMonitor() { +func Example_monitor() { const ( frequency = 44100 format = openal.FormatStereo16 @@ -102,5 +101,4 @@ func ExampleMonitor() { } } fmt.Println(source.State()) - // Output: Playing } diff --git a/gumble/go-openal/openal/openal_test.go b/gumble/go-openal/openal/openal_test.go index 9532f8b..1c2fb7e 100644 --- a/gumble/go-openal/openal/openal_test.go +++ b/gumble/go-openal/openal/openal_test.go @@ -7,9 +7,15 @@ import ( func TestGetVendor(t *testing.T) { device := openal.OpenDevice("") + if device == nil { + t.Skip("OpenAL device is not available") + } defer device.CloseDevice() context := device.CreateContext() + if context == nil { + t.Skip("OpenAL context is not available") + } defer context.Destroy() context.Activate() diff --git a/gumble/go-opus/AUTHORS b/gumble/go-opus/AUTHORS deleted file mode 100644 index e2c5947..0000000 --- a/gumble/go-opus/AUTHORS +++ /dev/null @@ -1,12 +0,0 @@ -All code and content in this project is Copyright © 2015-2022 Go Opus Authors - -Go Opus Authors and copyright holders of this package are listed below, in no -particular order. By adding yourself to this list you agree to license your -contributions under the relevant license (see the LICENSE file). - -Hraban Luyat -Dejian Xu -Tobias Wellnitz -Elinor Natanzon -Victor Gaydov -Randy Reddig diff --git a/gumble/go-opus/LICENSE b/gumble/go-opus/LICENSE deleted file mode 100644 index 5c51b12..0000000 --- a/gumble/go-opus/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright © 2015-2022 Go Opus Authors (see AUTHORS file) - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/gumble/go-opus/README.md b/gumble/go-opus/README.md deleted file mode 100644 index eb7ddba..0000000 --- a/gumble/go-opus/README.md +++ /dev/null @@ -1,302 +0,0 @@ -[![Test](https://github.com/hraban/opus/workflows/Test/badge.svg)](https://github.com/hraban/opus/actions?query=workflow%3ATest) - -## Go wrapper for Opus - -This package provides Go bindings for the xiph.org C libraries libopus and -libopusfile. - -The C libraries and docs are hosted at https://opus-codec.org/. This package -just handles the wrapping in Go, and is unaffiliated with xiph.org. - -Features: - -- ✅ encode and decode raw PCM data to raw Opus data -- ✅ useful when you control the recording device, _and_ the playback -- ✅ decode .opus and .ogg files into raw audio data ("PCM") -- ✅ reuse the system libraries for opus decoding (libopus) -- ✅ works easily on Linux, Mac and Docker; needs libs on Windows -- ❌ does not _create_ .opus or .ogg files (but feel free to send a PR) -- ❌ does not work with .wav files (you need a separate .wav library for that) -- ❌ no self-contained binary (you need the xiph.org libopus lib, e.g. through a package manager) -- ❌ no cross compiling (because it uses CGo) - -Good use cases: - -- 👍 you are writing a music player app in Go, and you want to play back .opus files -- 👍 you record raw wav in a web app or mobile app, you encode it as Opus on the client, you send the opus to a remote webserver written in Go, and you want to decode it back to raw audio data on that server - -## Details - -This wrapper provides a Go translation layer for three elements from the -xiph.org opus libs: - -* encoders -* decoders -* files & streams - -### Import - -```go -import "gopkg.in/hraban/opus.v2" -``` - -### Encoding - -To encode raw audio to the Opus format, create an encoder first: - -```go -const sampleRate = 48000 -const channels = 1 // mono; 2 for stereo - -enc, err := opus.NewEncoder(sampleRate, channels, opus.AppVoIP) -if err != nil { - ... -} -``` - -Then pass it some raw PCM data to encode. - -Make sure that the raw PCM data you want to encode has a legal Opus frame size. -This means it must be exactly 2.5, 5, 10, 20, 40 or 60 ms long. The number of -bytes this corresponds to depends on the sample rate (see the [libopus -documentation](https://www.opus-codec.org/docs/opus_api-1.1.3/group__opus__encoder.html)). - -```go -var pcm []int16 = ... // obtain your raw PCM data somewhere -const bufferSize = 1000 // choose any buffer size you like. 1k is plenty. - -// Check the frame size. You don't need to do this if you trust your input. -frameSize := len(pcm) // must be interleaved if stereo -frameSizeMs := float32(frameSize) / channels * 1000 / sampleRate -switch frameSizeMs { -case 2.5, 5, 10, 20, 40, 60: - // Good. -default: - return fmt.Errorf("Illegal frame size: %d bytes (%f ms)", frameSize, frameSizeMs) -} - -data := make([]byte, bufferSize) -n, err := enc.Encode(pcm, data) -if err != nil { - ... -} -data = data[:n] // only the first N bytes are opus data. Just like io.Reader. -``` - -Note that you must choose a target buffer size, and this buffer size will affect -the encoding process: - -> Size of the allocated memory for the output payload. This may be used to -> impose an upper limit on the instant bitrate, but should not be used as the -> only bitrate control. Use `OPUS_SET_BITRATE` to control the bitrate. - --- https://opus-codec.org/docs/opus_api-1.1.3/group__opus__encoder.html - -### Decoding - -To decode opus data to raw PCM format, first create a decoder: - -```go -dec, err := opus.NewDecoder(sampleRate, channels) -if err != nil { - ... -} -``` - -Now pass it the opus bytes, and a buffer to store the PCM sound in: - -```go -var frameSizeMs float32 = ... // if you don't know, go with 60 ms. -frameSize := channels * frameSizeMs * sampleRate / 1000 -pcm := make([]int16, int(frameSize)) -n, err := dec.Decode(data, pcm) -if err != nil { - ... -} - -// To get all samples (interleaved if multiple channels): -pcm = pcm[:n*channels] // only necessary if you didn't know the right frame size - -// or access sample per sample, directly: -for i := 0; i < n; i++ { - ch1 := pcm[i*channels+0] - // For stereo output: copy ch1 into ch2 in mono mode, or deinterleave stereo - ch2 := pcm[(i*channels)+(channels-1)] -} -``` - -To handle packet loss from an unreliable network, see the -[DecodePLC](https://godoc.org/gopkg.in/hraban/opus.v2#Decoder.DecodePLC) and -[DecodeFEC](https://godoc.org/gopkg.in/hraban/opus.v2#Decoder.DecodeFEC) -options. - -### Streams (and Files) - -To decode a .opus file (or .ogg with Opus data), or to decode a "Opus stream" -(which is a Ogg stream with Opus data), use the `Stream` interface. It wraps an -io.Reader providing the raw stream bytes and returns the decoded Opus data. - -A crude example for reading from a .opus file: - -```go -f, err := os.Open(fname) -if err != nil { - ... -} -s, err := opus.NewStream(f) -if err != nil { - ... -} -defer s.Close() -pcmbuf := make([]int16, 16384) -for { - n, err = s.Read(pcmbuf) - if err == io.EOF { - break - } else if err != nil { - ... - } - pcm := pcmbuf[:n*channels] - - // send pcm to audio device here, or write to a .wav file - -} -``` - -See https://godoc.org/gopkg.in/hraban/opus.v2#Stream for further info. - -### "My .ogg/.opus file doesn't play!" or "How do I play Opus in VLC / mplayer / ...?" - -Note: this package only does _encoding_ of your audio, to _raw opus data_. You can't just dump those all in one big file and play it back. You need extra info. First of all, you need to know how big each individual block is. Remember: opus data is a stream of encoded separate blocks, not one big stream of bytes. Second, you need meta-data: how many channels? What's the sampling rate? Frame size? Etc. - -Look closely at the decoding sample code (not stream), above: we're passing all that meta-data in, hard-coded. If you just put all your encoded bytes in one big file and gave that to a media player, it wouldn't know what to do with it. It wouldn't even know that it's Opus data. It would just look like `/dev/random`. - -What you need is a [container format](https://en.wikipedia.org/wiki/Container_format_(computing)). - -Compare it to video: - -* Encodings: MPEG[1234], VP9, H26[45], AV1 -* Container formats: .mkv, .avi, .mov, .ogv - -For Opus audio, the most common container format is OGG, aka .ogg or .opus. You'll know OGG from OGG/Vorbis: that's [Vorbis](https://xiph.org/vorbis/) encoded audio in an OGG container. So for Opus, you'd call it OGG/Opus. But technically you could stick opus data in any container format that supports it, including e.g. Matroska (.mka for audio, you probably know it from .mkv for video). - -Note: libopus, the C library that this wraps, technically comes with libopusfile, which can help with the creation of OGG/Opus streams from raw audio data. I just never needed it myself, so I haven't added the necessary code for it. If you find yourself adding it: send me a PR and we'll get it merged. - -This libopus wrapper _does_ come with code for _decoding_ an OGG/Opus stream. Just not for writing one. - -### API Docs - -Go wrapper API reference: -https://godoc.org/gopkg.in/hraban/opus.v2 - -Full libopus C API reference: -https://www.opus-codec.org/docs/opus_api-1.1.3/ - -For more examples, see the `_test.go` files. - -## Build & Installation - -This package requires libopus and libopusfile development packages to be -installed on your system. These are available on Debian based systems from -aptitude as `libopus-dev` and `libopusfile-dev`, and on Mac OS X from homebrew. - -They are linked into the app using pkg-config. - -Debian, Ubuntu, ...: -```sh -sudo apt-get install pkg-config libopus-dev libopusfile-dev -``` - -Mac: -```sh -brew install pkg-config opus opusfile -``` - -### Building Without `libopusfile` - -This package can be built without `libopusfile` by using the build tag `nolibopusfile`. -This enables the compilation of statically-linked binaries with no external -dependencies on operating systems without a static `libopusfile`, such as -[Alpine Linux](https://pkgs.alpinelinux.org/contents?branch=edge&name=opusfile-dev&arch=x86_64&repo=main). - -**Note:** this will disable all file and `Stream` APIs. - -To enable this feature, add `-tags nolibopusfile` to your `go build` or `go test` commands: - -```sh -# Build -go build -tags nolibopusfile ... - -# Test -go test -tags nolibopusfile ./... -``` - -### Using in Docker - -If your Dockerized app has this library as a dependency (directly or -indirectly), it will need to install the aforementioned packages, too. - -This means you can't use the standard `golang:*-onbuild` images, because those -will try to build the app from source before allowing you to install extra -dependencies. Instead, try this as a Dockerfile: - -```Dockerfile -# Choose any golang image, just make sure it doesn't have -onbuild -FROM golang:1 - -RUN apt-get update && apt-get -y install libopus-dev libopusfile-dev - -# Everything below is copied manually from the official -onbuild image, -# with the ONBUILD keywords removed. - -RUN mkdir -p /go/src/app -WORKDIR /go/src/app - -CMD ["go-wrapper", "run"] -COPY . /go/src/app -RUN go-wrapper download -RUN go-wrapper install -``` - -For more information, see . - -### Linking libopus and libopusfile - -The opus and opusfile libraries will be linked into your application -dynamically. This means everyone who uses the resulting binary will need those -libraries available on their system. E.g. if you use this wrapper to write a -music app in Go, everyone using that music app will need libopus and libopusfile -on their system. On Debian systems the packages are called `libopus0` and -`libopusfile0`. - -The "cleanest" way to do this is to publish your software through a package -manager and specify libopus and libopusfile as dependencies of your program. If -that is not an option, you can compile the dynamic libraries yourself and ship -them with your software as seperate (.dll or .so) files. - -On Linux, for example, you would need the libopus.so.0 and libopusfile.so.0 -files in the same directory as the binary. Set your ELF binary's rpath to -`$ORIGIN` (this is not a shell variable but elf magic): - -```sh -patchelf --set-origin '$ORIGIN' your-app-binary -``` - -Now you can run the binary and it will automatically pick up shared library -files from its own directory. - -Wrap it all in a .zip, and ship. - -I know there is a similar trick for Mac (involving prefixing the shared library -names with `./`, which is, arguably, better). And Windows... probably just picks -up .dll files from the same dir by default? I don't know. But there are ways. - -## License - -The licensing terms for the Go bindings are found in the LICENSE file. The -authors and copyright holders are listed in the AUTHORS file. - -The copyright notice uses range notation to indicate all years in between are -subject to copyright, as well. This statement is necessary, apparently. For all -those nefarious actors ready to abuse a copyright notice with incorrect -notation, but thwarted by a mention in the README. Pfew! diff --git a/gumble/go-opus/callbacks.c b/gumble/go-opus/callbacks.c deleted file mode 100644 index 14ad2bd..0000000 --- a/gumble/go-opus/callbacks.c +++ /dev/null @@ -1,29 +0,0 @@ -// +build !nolibopusfile - -// Copyright © Go Opus Authors (see AUTHORS file) -// -// License for use of this code is detailed in the LICENSE file - -// Allocate callback struct in C to ensure it's not managed by the Go GC. This -// plays nice with the CGo rules and avoids any confusion. - -#include -#include - -// Defined in Go. Uses the same signature as Go, no need for proxy function. -int go_readcallback(void *p, unsigned char *buf, int nbytes); - -static struct OpusFileCallbacks callbacks = { - .read = go_readcallback, -}; - -// Proxy function for op_open_callbacks, because it takes a void * context but -// we want to pass it non-pointer data, namely an arbitrary uintptr_t -// value. This is legal C, but go test -race (-d=checkptr) complains anyway. So -// we have this wrapper function to shush it. -// https://groups.google.com/g/golang-nuts/c/995uZyRPKlU -OggOpusFile * -my_open_callbacks(uintptr_t p, int *error) -{ - return op_open_callbacks((void *)p, &callbacks, NULL, 0, error); -} diff --git a/gumble/go-opus/decoder.go b/gumble/go-opus/decoder.go deleted file mode 100644 index 2b99433..0000000 --- a/gumble/go-opus/decoder.go +++ /dev/null @@ -1,276 +0,0 @@ -// Copyright ÂGo Opus Authors (see AUTHORS file) -// -// License for use of this code is detailed in the LICENSE file - -package opus - -import ( - "fmt" - "unsafe" -) - -/* -#cgo pkg-config: opus -#include - -int -bridge_decoder_get_last_packet_duration(OpusDecoder *st, opus_int32 *samples) -{ - return opus_decoder_ctl(st, OPUS_GET_LAST_PACKET_DURATION(samples)); -} -*/ -import "C" - -var errDecUninitialized = fmt.Errorf("opus decoder uninitialized") - -type Decoder struct { - p *C.struct_OpusDecoder - // Same purpose as encoder struct - mem []byte - sample_rate int - channels int -} - -// NewDecoder allocates a new Opus decoder and initializes it with the -// appropriate parameters. All related memory is managed by the Go GC. -func NewDecoder(sample_rate int, channels int) (*Decoder, error) { - var dec Decoder - err := dec.Init(sample_rate, channels) - if err != nil { - return nil, err - } - return &dec, nil -} - -func (dec *Decoder) Init(sample_rate int, channels int) error { - if dec.p != nil { - return fmt.Errorf("opus decoder already initialized") - } - if channels != 1 && channels != 2 { - return fmt.Errorf("Number of channels must be 1 or 2: %d", channels) - } - size := C.opus_decoder_get_size(C.int(channels)) - dec.sample_rate = sample_rate - dec.channels = channels - dec.mem = make([]byte, size) - dec.p = (*C.OpusDecoder)(unsafe.Pointer(&dec.mem[0])) - errno := C.opus_decoder_init( - dec.p, - C.opus_int32(sample_rate), - C.int(channels)) - if errno != 0 { - return Error(errno) - } - return nil -} - -// Decode encoded Opus data into the supplied buffer. On success, returns the -// number of samples correctly written to the target buffer. -func (dec *Decoder) Decode(data []byte, pcm []int16) (int, error) { - if dec.p == nil { - return 0, errDecUninitialized - } - if len(data) == 0 { - return 0, fmt.Errorf("opus: no data supplied") - } - if len(pcm) == 0 { - return 0, fmt.Errorf("opus: target buffer empty") - } - if cap(pcm)%dec.channels != 0 { - return 0, fmt.Errorf("opus: target buffer capacity must be multiple of channels") - } - n := int(C.opus_decode( - dec.p, - (*C.uchar)(&data[0]), - C.opus_int32(len(data)), - (*C.opus_int16)(&pcm[0]), - C.int(cap(pcm)/dec.channels), - 0)) - if n < 0 { - return 0, Error(n) - } - return n, nil -} - -// Decode encoded Opus data into the supplied buffer. On success, returns the -// number of samples correctly written to the target buffer. -func (dec *Decoder) DecodeFloat32(data []byte, pcm []float32) (int, error) { - if dec.p == nil { - return 0, errDecUninitialized - } - if len(data) == 0 { - return 0, fmt.Errorf("opus: no data supplied") - } - if len(pcm) == 0 { - return 0, fmt.Errorf("opus: target buffer empty") - } - if cap(pcm)%dec.channels != 0 { - return 0, fmt.Errorf("opus: target buffer capacity must be multiple of channels") - } - n := int(C.opus_decode_float( - dec.p, - (*C.uchar)(&data[0]), - C.opus_int32(len(data)), - (*C.float)(&pcm[0]), - C.int(cap(pcm)/dec.channels), - 0)) - if n < 0 { - return 0, Error(n) - } - return n, nil -} - -// DecodeFEC encoded Opus data into the supplied buffer with forward error -// correction. -// -// It is to be used on the packet directly following the lost one. The supplied -// buffer needs to be exactly the duration of audio that is missing -// -// When a packet is considered "lost", DecodeFEC can be called on the next -// packet in order to try and recover some of the lost data. The PCM needs to be -// exactly the duration of audio that is missing. `LastPacketDuration()` can be -// used on the decoder to get the length of the last packet. Note also that in -// order to use this feature the encoder needs to be configured with -// SetInBandFEC(true) and SetPacketLossPerc(x) options. -// -// Note that DecodeFEC automatically falls back to PLC when no FEC data is -// available in the provided packet. -func (dec *Decoder) DecodeFEC(data []byte, pcm []int16) error { - if dec.p == nil { - return errDecUninitialized - } - if len(data) == 0 { - return fmt.Errorf("opus: no data supplied") - } - if len(pcm) == 0 { - return fmt.Errorf("opus: target buffer empty") - } - if cap(pcm)%dec.channels != 0 { - return fmt.Errorf("opus: target buffer capacity must be multiple of channels") - } - n := int(C.opus_decode( - dec.p, - (*C.uchar)(&data[0]), - C.opus_int32(len(data)), - (*C.opus_int16)(&pcm[0]), - C.int(cap(pcm)/dec.channels), - 1)) - if n < 0 { - return Error(n) - } - return nil -} - -// DecodeFECFloat32 encoded Opus data into the supplied buffer with forward error -// correction. It is to be used on the packet directly following the lost one. -// The supplied buffer needs to be exactly the duration of audio that is missing -func (dec *Decoder) DecodeFECFloat32(data []byte, pcm []float32) error { - if dec.p == nil { - return errDecUninitialized - } - if len(data) == 0 { - return fmt.Errorf("opus: no data supplied") - } - if len(pcm) == 0 { - return fmt.Errorf("opus: target buffer empty") - } - if cap(pcm)%dec.channels != 0 { - return fmt.Errorf("opus: target buffer capacity must be multiple of channels") - } - n := int(C.opus_decode_float( - dec.p, - (*C.uchar)(&data[0]), - C.opus_int32(len(data)), - (*C.float)(&pcm[0]), - C.int(cap(pcm)/dec.channels), - 1)) - if n < 0 { - return Error(n) - } - return nil -} - -// DecodePLC recovers a lost packet using Opus Packet Loss Concealment feature. -// -// The supplied buffer needs to be exactly the duration of audio that is missing. -// When a packet is considered "lost", `DecodePLC` and `DecodePLCFloat32` methods -// can be called in order to obtain something better sounding than just silence. -// The PCM needs to be exactly the duration of audio that is missing. -// `LastPacketDuration()` can be used on the decoder to get the length of the -// last packet. -// -// This option does not require any additional encoder options. Unlike FEC, -// PLC does not introduce additional latency. It is calculated from the previous -// packet, not from the next one. -func (dec *Decoder) DecodePLC(pcm []int16) error { - if dec.p == nil { - return errDecUninitialized - } - if len(pcm) == 0 { - return fmt.Errorf("opus: target buffer empty") - } - if cap(pcm)%dec.channels != 0 { - return fmt.Errorf("opus: output buffer capacity must be multiple of channels") - } - n := int(C.opus_decode( - dec.p, - nil, - 0, - (*C.opus_int16)(&pcm[0]), - C.int(cap(pcm)/dec.channels), - 0)) - if n < 0 { - return Error(n) - } - return nil -} - -// DecodePLCFloat32 recovers a lost packet using Opus Packet Loss Concealment feature. -// The supplied buffer needs to be exactly the duration of audio that is missing. -func (dec *Decoder) DecodePLCFloat32(pcm []float32) error { - if dec.p == nil { - return errDecUninitialized - } - if len(pcm) == 0 { - return fmt.Errorf("opus: target buffer empty") - } - if cap(pcm)%dec.channels != 0 { - return fmt.Errorf("opus: output buffer capacity must be multiple of channels") - } - n := int(C.opus_decode_float( - dec.p, - nil, - 0, - (*C.float)(&pcm[0]), - C.int(cap(pcm)/dec.channels), - 0)) - if n < 0 { - return Error(n) - } - return nil -} - -// LastPacketDuration gets the duration (in samples) -// of the last packet successfully decoded or concealed. -func (dec *Decoder) LastPacketDuration() (int, error) { - var samples C.opus_int32 - res := C.bridge_decoder_get_last_packet_duration(dec.p, &samples) - if res != C.OPUS_OK { - return 0, Error(res) - } - return int(samples), nil -} - -// Reset reinitializes the decoder with the existing parameters -func (dec *Decoder) Reset() error { - // Store current parameters - sample_rate := dec.sample_rate - channels := dec.channels - - // Clear the decoder - dec.p = nil - dec.mem = nil - - // Reinitialize with same parameters - return dec.Init(sample_rate, channels) -} diff --git a/gumble/go-opus/decoder_test.go b/gumble/go-opus/decoder_test.go deleted file mode 100644 index afb188f..0000000 --- a/gumble/go-opus/decoder_test.go +++ /dev/null @@ -1,68 +0,0 @@ -// Copyright © Go Opus Authors (see AUTHORS file) -// -// License for use of this code is detailed in the LICENSE file - -package opus - -import ( - "testing" -) - -func TestDecoderNew(t *testing.T) { - dec, err := NewDecoder(48000, 1) - if err != nil || dec == nil { - t.Errorf("Error creating new decoder: %v", err) - } - dec, err = NewDecoder(12345, 1) - if err == nil || dec != nil { - t.Errorf("Expected error for illegal samplerate 12345") - } -} - -func TestDecoderUnitialized(t *testing.T) { - var dec Decoder - _, err := dec.Decode(nil, nil) - if err != errDecUninitialized { - t.Errorf("Expected \"unitialized decoder\" error: %v", err) - } - _, err = dec.DecodeFloat32(nil, nil) - if err != errDecUninitialized { - t.Errorf("Expected \"unitialized decoder\" error: %v", err) - } -} - -func TestDecoder_GetLastPacketDuration(t *testing.T) { - const G4 = 391.995 - const SAMPLE_RATE = 48000 - const FRAME_SIZE_MS = 60 - const FRAME_SIZE = SAMPLE_RATE * FRAME_SIZE_MS / 1000 - pcm := make([]int16, FRAME_SIZE) - enc, err := NewEncoder(SAMPLE_RATE, 1, AppVoIP) - if err != nil || enc == nil { - t.Fatalf("Error creating new encoder: %v", err) - } - addSine(pcm, SAMPLE_RATE, G4) - - data := make([]byte, 1000) - n, err := enc.Encode(pcm, data) - if err != nil { - t.Fatalf("Couldn't encode data: %v", err) - } - data = data[:n] - - dec, err := NewDecoder(SAMPLE_RATE, 1) - if err != nil || dec == nil { - t.Fatalf("Error creating new decoder: %v", err) - } - n, err = dec.Decode(data, pcm) - if err != nil { - t.Fatalf("Couldn't decode data: %v", err) - } - samples, err := dec.LastPacketDuration() - if err != nil { - t.Fatalf("Couldn't get last packet duration: %v", err) - } - if samples != n { - t.Fatalf("Wrong duration length. Expected %d. Got %d", n, samples) - } -} diff --git a/gumble/go-opus/encoder.go b/gumble/go-opus/encoder.go deleted file mode 100644 index b88dc98..0000000 --- a/gumble/go-opus/encoder.go +++ /dev/null @@ -1,402 +0,0 @@ -// Copyright © Go Opus Authors (see AUTHORS file) -// -// License for use of this code is detailed in the LICENSE file - -package opus - -import ( - "fmt" - "unsafe" -) - -/* -#cgo pkg-config: opus -#include - -int -bridge_encoder_set_dtx(OpusEncoder *st, opus_int32 use_dtx) -{ - return opus_encoder_ctl(st, OPUS_SET_DTX(use_dtx)); -} - -int -bridge_encoder_get_dtx(OpusEncoder *st, opus_int32 *dtx) -{ - return opus_encoder_ctl(st, OPUS_GET_DTX(dtx)); -} - -int -bridge_encoder_get_in_dtx(OpusEncoder *st, opus_int32 *in_dtx) -{ - return opus_encoder_ctl(st, OPUS_GET_IN_DTX(in_dtx)); -} - -int -bridge_encoder_get_sample_rate(OpusEncoder *st, opus_int32 *sample_rate) -{ - return opus_encoder_ctl(st, OPUS_GET_SAMPLE_RATE(sample_rate)); -} - - -int -bridge_encoder_set_bitrate(OpusEncoder *st, opus_int32 bitrate) -{ - return opus_encoder_ctl(st, OPUS_SET_BITRATE(bitrate)); -} - -int -bridge_encoder_get_bitrate(OpusEncoder *st, opus_int32 *bitrate) -{ - return opus_encoder_ctl(st, OPUS_GET_BITRATE(bitrate)); -} - -int -bridge_encoder_set_complexity(OpusEncoder *st, opus_int32 complexity) -{ - return opus_encoder_ctl(st, OPUS_SET_COMPLEXITY(complexity)); -} - -int -bridge_encoder_get_complexity(OpusEncoder *st, opus_int32 *complexity) -{ - return opus_encoder_ctl(st, OPUS_GET_COMPLEXITY(complexity)); -} - -int -bridge_encoder_set_max_bandwidth(OpusEncoder *st, opus_int32 max_bw) -{ - return opus_encoder_ctl(st, OPUS_SET_MAX_BANDWIDTH(max_bw)); -} - -int -bridge_encoder_get_max_bandwidth(OpusEncoder *st, opus_int32 *max_bw) -{ - return opus_encoder_ctl(st, OPUS_GET_MAX_BANDWIDTH(max_bw)); -} - -int -bridge_encoder_set_inband_fec(OpusEncoder *st, opus_int32 fec) -{ - return opus_encoder_ctl(st, OPUS_SET_INBAND_FEC(fec)); -} - -int -bridge_encoder_get_inband_fec(OpusEncoder *st, opus_int32 *fec) -{ - return opus_encoder_ctl(st, OPUS_GET_INBAND_FEC(fec)); -} - -int -bridge_encoder_set_packet_loss_perc(OpusEncoder *st, opus_int32 loss_perc) -{ - return opus_encoder_ctl(st, OPUS_SET_PACKET_LOSS_PERC(loss_perc)); -} - -int -bridge_encoder_get_packet_loss_perc(OpusEncoder *st, opus_int32 *loss_perc) -{ - return opus_encoder_ctl(st, OPUS_GET_PACKET_LOSS_PERC(loss_perc)); -} - -int -bridge_encoder_reset_state(OpusEncoder *st) -{ - return opus_encoder_ctl(st, OPUS_RESET_STATE); -} - -*/ -import "C" - -type Bandwidth int - -const ( - // 4 kHz passband - Narrowband = Bandwidth(C.OPUS_BANDWIDTH_NARROWBAND) - // 6 kHz passband - Mediumband = Bandwidth(C.OPUS_BANDWIDTH_MEDIUMBAND) - // 8 kHz passband - Wideband = Bandwidth(C.OPUS_BANDWIDTH_WIDEBAND) - // 12 kHz passband - SuperWideband = Bandwidth(C.OPUS_BANDWIDTH_SUPERWIDEBAND) - // 20 kHz passband - Fullband = Bandwidth(C.OPUS_BANDWIDTH_FULLBAND) -) - -var errEncUninitialized = fmt.Errorf("opus encoder uninitialized") - -// Encoder contains the state of an Opus encoder for libopus. -type Encoder struct { - p *C.struct_OpusEncoder - channels int - // Memory for the encoder struct allocated on the Go heap to allow Go GC to - // manage it (and obviate need to free()) - mem []byte -} - -// NewEncoder allocates a new Opus encoder and initializes it with the -// appropriate parameters. All related memory is managed by the Go GC. -func NewEncoder(sample_rate int, channels int, application Application) (*Encoder, error) { - var enc Encoder - err := enc.Init(sample_rate, channels, application) - if err != nil { - return nil, err - } - return &enc, nil -} - -// Init initializes a pre-allocated opus encoder. Unless the encoder has been -// created using NewEncoder, this method must be called exactly once in the -// life-time of this object, before calling any other methods. -func (enc *Encoder) Init(sample_rate int, channels int, application Application) error { - if enc.p != nil { - return fmt.Errorf("opus encoder already initialized") - } - if channels != 1 && channels != 2 { - return fmt.Errorf("Number of channels must be 1 or 2: %d", channels) - } - size := C.opus_encoder_get_size(C.int(channels)) - enc.channels = channels - enc.mem = make([]byte, size) - enc.p = (*C.OpusEncoder)(unsafe.Pointer(&enc.mem[0])) - errno := int(C.opus_encoder_init( - enc.p, - C.opus_int32(sample_rate), - C.int(channels), - C.int(application))) - if errno != 0 { - return Error(int(errno)) - } - return nil -} - -// Encode raw PCM data and store the result in the supplied buffer. On success, -// returns the number of bytes used up by the encoded data. -func (enc *Encoder) Encode(pcm []int16, data []byte) (int, error) { - if enc.p == nil { - return 0, errEncUninitialized - } - if len(pcm) == 0 { - return 0, fmt.Errorf("opus: no data supplied") - } - if len(data) == 0 { - return 0, fmt.Errorf("opus: no target buffer") - } - // libopus talks about samples as 1 sample containing multiple channels. So - // e.g. 20 samples of 2-channel data is actually 40 raw data points. - if len(pcm)%enc.channels != 0 { - return 0, fmt.Errorf("opus: input buffer length must be multiple of channels") - } - samples := len(pcm) / enc.channels - n := int(C.opus_encode( - enc.p, - (*C.opus_int16)(&pcm[0]), - C.int(samples), - (*C.uchar)(&data[0]), - C.opus_int32(cap(data)))) - if n < 0 { - return 0, Error(n) - } - return n, nil -} - -// Encode raw PCM data and store the result in the supplied buffer. On success, -// returns the number of bytes used up by the encoded data. -func (enc *Encoder) EncodeFloat32(pcm []float32, data []byte) (int, error) { - if enc.p == nil { - return 0, errEncUninitialized - } - if len(pcm) == 0 { - return 0, fmt.Errorf("opus: no data supplied") - } - if len(data) == 0 { - return 0, fmt.Errorf("opus: no target buffer") - } - if len(pcm)%enc.channels != 0 { - return 0, fmt.Errorf("opus: input buffer length must be multiple of channels") - } - samples := len(pcm) / enc.channels - n := int(C.opus_encode_float( - enc.p, - (*C.float)(&pcm[0]), - C.int(samples), - (*C.uchar)(&data[0]), - C.opus_int32(cap(data)))) - if n < 0 { - return 0, Error(n) - } - return n, nil -} - -// SetDTX configures the encoder's use of discontinuous transmission (DTX). -func (enc *Encoder) SetDTX(dtx bool) error { - i := 0 - if dtx { - i = 1 - } - res := C.bridge_encoder_set_dtx(enc.p, C.opus_int32(i)) - if res != C.OPUS_OK { - return Error(res) - } - return nil -} - -// DTX reports whether this encoder is configured to use discontinuous -// transmission (DTX). -func (enc *Encoder) DTX() (bool, error) { - var dtx C.opus_int32 - res := C.bridge_encoder_get_dtx(enc.p, &dtx) - if res != C.OPUS_OK { - return false, Error(res) - } - return dtx != 0, nil -} - -// InDTX returns whether the last encoded frame was either a comfort noise update -// during DTX or not encoded because of DTX. -func (enc *Encoder) InDTX() (bool, error) { - var inDTX C.opus_int32 - res := C.bridge_encoder_get_in_dtx(enc.p, &inDTX) - if res != C.OPUS_OK { - return false, Error(res) - } - return inDTX != 0, nil -} - -// SampleRate returns the encoder sample rate in Hz. -func (enc *Encoder) SampleRate() (int, error) { - var sr C.opus_int32 - res := C.bridge_encoder_get_sample_rate(enc.p, &sr) - if res != C.OPUS_OK { - return 0, Error(res) - } - return int(sr), nil -} - -// SetBitrate sets the bitrate of the Encoder -func (enc *Encoder) SetBitrate(bitrate int) error { - res := C.bridge_encoder_set_bitrate(enc.p, C.opus_int32(bitrate)) - if res != C.OPUS_OK { - return Error(res) - } - return nil -} - -// SetBitrateToAuto will allow the encoder to automatically set the bitrate -func (enc *Encoder) SetBitrateToAuto() error { - res := C.bridge_encoder_set_bitrate(enc.p, C.opus_int32(C.OPUS_AUTO)) - if res != C.OPUS_OK { - return Error(res) - } - return nil -} - -// SetBitrateToMax causes the encoder to use as much rate as it can. This can be -// useful for controlling the rate by adjusting the output buffer size. -func (enc *Encoder) SetBitrateToMax() error { - res := C.bridge_encoder_set_bitrate(enc.p, C.opus_int32(C.OPUS_BITRATE_MAX)) - if res != C.OPUS_OK { - return Error(res) - } - return nil -} - -// Bitrate returns the bitrate of the Encoder -func (enc *Encoder) Bitrate() (int, error) { - var bitrate C.opus_int32 - res := C.bridge_encoder_get_bitrate(enc.p, &bitrate) - if res != C.OPUS_OK { - return 0, Error(res) - } - return int(bitrate), nil -} - -// SetComplexity sets the encoder's computational complexity -func (enc *Encoder) SetComplexity(complexity int) error { - res := C.bridge_encoder_set_complexity(enc.p, C.opus_int32(complexity)) - if res != C.OPUS_OK { - return Error(res) - } - return nil -} - -// Complexity returns the computational complexity used by the encoder -func (enc *Encoder) Complexity() (int, error) { - var complexity C.opus_int32 - res := C.bridge_encoder_get_complexity(enc.p, &complexity) - if res != C.OPUS_OK { - return 0, Error(res) - } - return int(complexity), nil -} - -// SetMaxBandwidth configures the maximum bandpass that the encoder will select -// automatically -func (enc *Encoder) SetMaxBandwidth(maxBw Bandwidth) error { - res := C.bridge_encoder_set_max_bandwidth(enc.p, C.opus_int32(maxBw)) - if res != C.OPUS_OK { - return Error(res) - } - return nil -} - -// MaxBandwidth gets the encoder's configured maximum allowed bandpass. -func (enc *Encoder) MaxBandwidth() (Bandwidth, error) { - var maxBw C.opus_int32 - res := C.bridge_encoder_get_max_bandwidth(enc.p, &maxBw) - if res != C.OPUS_OK { - return 0, Error(res) - } - return Bandwidth(maxBw), nil -} - -// SetInBandFEC configures the encoder's use of inband forward error -// correction (FEC) -func (enc *Encoder) SetInBandFEC(fec bool) error { - i := 0 - if fec { - i = 1 - } - res := C.bridge_encoder_set_inband_fec(enc.p, C.opus_int32(i)) - if res != C.OPUS_OK { - return Error(res) - } - return nil -} - -// InBandFEC gets the encoder's configured inband forward error correction (FEC) -func (enc *Encoder) InBandFEC() (bool, error) { - var fec C.opus_int32 - res := C.bridge_encoder_get_inband_fec(enc.p, &fec) - if res != C.OPUS_OK { - return false, Error(res) - } - return fec != 0, nil -} - -// SetPacketLossPerc configures the encoder's expected packet loss percentage. -func (enc *Encoder) SetPacketLossPerc(lossPerc int) error { - res := C.bridge_encoder_set_packet_loss_perc(enc.p, C.opus_int32(lossPerc)) - if res != C.OPUS_OK { - return Error(res) - } - return nil -} - -// PacketLossPerc gets the encoder's configured packet loss percentage. -func (enc *Encoder) PacketLossPerc() (int, error) { - var lossPerc C.opus_int32 - res := C.bridge_encoder_get_packet_loss_perc(enc.p, &lossPerc) - if res != C.OPUS_OK { - return 0, Error(res) - } - return int(lossPerc), nil -} - -// Reset resets the codec state to be equivalent to a freshly initialized state. -func (enc *Encoder) Reset() error { - res := C.bridge_encoder_reset_state(enc.p) - if res != C.OPUS_OK { - return Error(res) - } - return nil -} diff --git a/gumble/go-opus/encoder_test.go b/gumble/go-opus/encoder_test.go deleted file mode 100644 index 56d1282..0000000 --- a/gumble/go-opus/encoder_test.go +++ /dev/null @@ -1,393 +0,0 @@ -// Copyright © Go Opus Authors (see AUTHORS file) -// -// License for use of this code is detailed in the LICENSE file - -package opus - -import "testing" - -func TestEncoderNew(t *testing.T) { - enc, err := NewEncoder(48000, 1, AppVoIP) - if err != nil || enc == nil { - t.Errorf("Error creating new encoder: %v", err) - } - enc, err = NewEncoder(12345, 1, AppVoIP) - if err == nil || enc != nil { - t.Errorf("Expected error for illegal samplerate 12345") - } -} - -func TestEncoderUnitialized(t *testing.T) { - var enc Encoder - _, err := enc.Encode(nil, nil) - if err != errEncUninitialized { - t.Errorf("Expected \"unitialized encoder\" error: %v", err) - } - _, err = enc.EncodeFloat32(nil, nil) - if err != errEncUninitialized { - t.Errorf("Expected \"unitialized encoder\" error: %v", err) - } -} - -func TestEncoderDTX(t *testing.T) { - enc, err := NewEncoder(8000, 1, AppVoIP) - if err != nil || enc == nil { - t.Errorf("Error creating new encoder: %v", err) - } - vals := []bool{true, false} - for _, dtx := range vals { - err := enc.SetDTX(dtx) - if err != nil { - t.Fatalf("Error setting DTX to %t: %v", dtx, err) - } - gotv, err := enc.DTX() - if err != nil { - t.Fatalf("Error getting DTX (%t): %v", dtx, err) - } - if gotv != dtx { - t.Errorf("Error set dtx: expect dtx=%v, got dtx=%v", dtx, gotv) - } - } -} - -func TestEncoderInDTX(t *testing.T) { - // Create bogus input sound - const G4 = 391.995 - const SAMPLE_RATE = 48000 - const FRAME_SIZE_MS = 60 - const FRAME_SIZE = SAMPLE_RATE * FRAME_SIZE_MS / 1000 - pcm := make([]int16, FRAME_SIZE) - silentPCM := make([]int16, FRAME_SIZE) - out := make([]byte, FRAME_SIZE*4) - addSine(pcm, SAMPLE_RATE, G4) - - vals := []bool{true, false} - for _, dtx := range vals { - enc, err := NewEncoder(SAMPLE_RATE, 1, AppVoIP) - if err != nil || enc == nil { - t.Fatalf("Error creating new encoder: %v", err) - } - enc.SetDTX(dtx) - if _, err = enc.Encode(pcm, out); err != nil { - t.Fatalf("Error encoding non-silent frame: %v", err) - } - gotDTX, err := enc.InDTX() - if err != nil { - t.Fatalf("Error getting in DTX (%t): %v", dtx, err) - } - if gotDTX { - t.Fatalf("Error get in dtx: expect in dtx=false, got=true") - } - // Encode a few frames to let DTX kick in - for i := 0; i < 5; i++ { - if _, err = enc.Encode(silentPCM, out); err != nil { - t.Fatalf("Error encoding silent frame: %v", err) - } - } - gotDTX, err = enc.InDTX() - if err != nil { - t.Fatalf("Error getting in DTX (%t): %v", dtx, err) - } - if gotDTX != dtx { - t.Errorf("Error set dtx: expect in dtx=%v, got in dtx=%v", dtx, gotDTX) - } - } -} - -func TestEncoderSampleRate(t *testing.T) { - sample_rates := []int{8000, 12000, 16000, 24000, 48000} - for _, f := range sample_rates { - enc, err := NewEncoder(f, 1, AppVoIP) - if err != nil || enc == nil { - t.Fatalf("Error creating new encoder with sample_rate %d Hz: %v", f, err) - } - f2, err := enc.SampleRate() - if err != nil { - t.Fatalf("Error getting sample rate (%d Hz): %v", f, err) - } - if f != f2 { - t.Errorf("Unexpected sample rate reported by %d Hz encoder: %d", f, f2) - } - } -} - -func TestEncoder_SetGetBitrate(t *testing.T) { - enc, err := NewEncoder(8000, 1, AppVoIP) - if err != nil || enc == nil { - t.Errorf("Error creating new encoder: %v", err) - } - vals := []int{500, 100000, 300000} - for _, bitrate := range vals { - err := enc.SetBitrate(bitrate) - if err != nil { - t.Error("Error set bitrate:", err) - } - br, err := enc.Bitrate() - if err != nil { - t.Error("Error getting bitrate", err) - } - if br != bitrate { - t.Errorf("Unexpected bitrate. Got %d, but expected %d", br, bitrate) - } - } -} - -func TestEncoder_SetBitrateToAuto(t *testing.T) { - enc, err := NewEncoder(8000, 1, AppVoIP) - if err != nil || enc == nil { - t.Errorf("Error creating new encoder: %v", err) - } - - bitrate := 5000 - if err := enc.SetBitrate(bitrate); err != nil { - t.Error("Error setting bitrate:", err) - } - - br, err := enc.Bitrate() - if err != nil { - t.Error("Error getting bitrate", err) - } - - if br != bitrate { - t.Errorf("Unexpected bitrate. Got %d, but expected %d", br, bitrate) - } - - err = enc.SetBitrateToAuto() - if err != nil { - t.Error("Error setting Auto bitrate:", err) - } - - br, err = enc.Bitrate() - if err != nil { - t.Error("Error getting bitrate", err) - } - - brDefault := 32000 //default start value - if br != brDefault { - t.Errorf("Unexpected bitrate. Got %d, but expected %d", br, brDefault) - } -} - -func TestEncoder_SetBitrateToMax(t *testing.T) { - enc, err := NewEncoder(8000, 1, AppVoIP) - if err != nil || enc == nil { - t.Errorf("Error creating new encoder: %v", err) - } - - bitrate := 5000 - if err := enc.SetBitrate(bitrate); err != nil { - t.Error("Error setting bitrate:", err) - } - - br, err := enc.Bitrate() - if err != nil { - t.Error("Error getting bitrate", err) - } - - if br != bitrate { - t.Errorf("Unexpected bitrate. Got %d, but expected %d", br, bitrate) - } - - err = enc.SetBitrateToMax() - if err != nil { - t.Error("Error setting Max bitrate:", err) - } - - br, err = enc.Bitrate() - if err != nil { - t.Error("Error getting bitrate", err) - } - - brMax := 4083200 - if br != brMax { //default start value - t.Errorf("Unexpected bitrate. Got %d, but expected %d", br, brMax) - } -} - -func TestEncoder_SetGetInvalidBitrate(t *testing.T) { - enc, err := NewEncoder(8000, 1, AppVoIP) - if err != nil || enc == nil { - t.Errorf("Error creating new encoder: %v", err) - } - invalidVals := []int{-20, 0} - for _, bitrate := range invalidVals { - err := enc.SetBitrate(bitrate) - if err == nil { - t.Errorf("Expected Error invalid bitrate: %d", bitrate) - } - br, err := enc.Bitrate() - if err != nil { - t.Error("Error getting bitrate", err) - } - // default bitrate is 32 kbit/s - if br != 32000 { - t.Errorf("Unexpected bitrate. Got %d, but expected %d", br, bitrate) - } - } -} - -func TestEncoder_SetGetComplexity(t *testing.T) { - enc, err := NewEncoder(8000, 1, AppVoIP) - if err != nil || enc == nil { - t.Errorf("Error creating new encoder: %v", err) - } - vals := []int{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10} - for _, complexity := range vals { - err := enc.SetComplexity(complexity) - if err != nil { - t.Error("Error setting complexity value:", err) - } - cpx, err := enc.Complexity() - if err != nil { - t.Error("Error getting complexity value", err) - } - if cpx != complexity { - t.Errorf("Unexpected encoder complexity value. Got %d, but expected %d", - cpx, complexity) - } - } -} - -func TestEncoder_SetGetInvalidComplexity(t *testing.T) { - enc, err := NewEncoder(8000, 1, AppVoIP) - if err != nil || enc == nil { - t.Errorf("Error creating new encoder: %v", err) - } - invalidVals := []int{-20, 11, 1000} - for _, complexity := range invalidVals { - err := enc.SetComplexity(complexity) - if err == nil { - t.Errorf("Expected Error invalid complexity value: %d", complexity) - } - if err.Error() != "opus: invalid argument" { - t.Error("Unexpected Error message") - } - - cpx, err := enc.Complexity() - if err != nil { - t.Error("Error getting complexity value", err) - } - - // default complexity value is 9 - if cpx != 9 { - t.Errorf("Unexpected complexity value. Got %d, but expected %d", - cpx, complexity) - } - } -} - -func TestEncoder_SetGetMaxBandwidth(t *testing.T) { - enc, err := NewEncoder(8000, 1, AppVoIP) - if err != nil || enc == nil { - t.Errorf("Error creating new encoder: %v", err) - } - vals := []Bandwidth{ - Narrowband, - Mediumband, - Wideband, - SuperWideband, - Fullband, - } - for _, maxBw := range vals { - err := enc.SetMaxBandwidth(maxBw) - if err != nil { - t.Error("Error setting max Bandwidth:", err) - } - maxBwRead, err := enc.MaxBandwidth() - if err != nil { - t.Error("Error getting max Bandwidth", err) - } - if maxBwRead != maxBw { - t.Errorf("Unexpected max Bandwidth value. Got %d, but expected %d", - maxBwRead, maxBw) - } - } -} - -func TestEncoder_SetGetInBandFEC(t *testing.T) { - enc, err := NewEncoder(8000, 1, AppVoIP) - if err != nil || enc == nil { - t.Errorf("Error creating new encoder: %v", err) - } - - if err := enc.SetInBandFEC(true); err != nil { - t.Error("Error setting fec:", err) - } - - fec, err := enc.InBandFEC() - if err != nil { - t.Error("Error getting fec", err) - } - if !fec { - t.Errorf("Wrong fec value. Expected %t", true) - } - - if err := enc.SetInBandFEC(false); err != nil { - t.Error("Error setting fec:", err) - } - - fec, err = enc.InBandFEC() - if err != nil { - t.Error("Error getting fec", err) - } - if fec { - t.Errorf("Wrong fec value. Expected %t", false) - } -} - -func TestEncoder_SetGetPacketLossPerc(t *testing.T) { - enc, err := NewEncoder(8000, 1, AppVoIP) - if err != nil || enc == nil { - t.Errorf("Error creating new encoder: %v", err) - } - vals := []int{0, 5, 10, 20} - for _, lossPerc := range vals { - err := enc.SetPacketLossPerc(lossPerc) - if err != nil { - t.Error("Error setting loss percentage value:", err) - } - lp, err := enc.PacketLossPerc() - if err != nil { - t.Error("Error getting loss percentage value", err) - } - if lp != lossPerc { - t.Errorf("Unexpected encoder loss percentage value. Got %d, but expected %d", - lp, lossPerc) - } - } -} - -func TestEncoder_SetGetInvalidPacketLossPerc(t *testing.T) { - enc, err := NewEncoder(8000, 1, AppVoIP) - if err != nil || enc == nil { - t.Errorf("Error creating new encoder: %v", err) - } - vals := []int{-1, 101} - for _, lossPerc := range vals { - err := enc.SetPacketLossPerc(lossPerc) - if err == nil { - t.Errorf("Expected Error invalid loss percentage: %d", lossPerc) - } - lp, err := enc.PacketLossPerc() - if err != nil { - t.Error("Error getting loss percentage value", err) - } - // default packet loss percentage is 0 - if lp != 0 { - t.Errorf("Unexpected encoder loss percentage value. Got %d, but expected %d", - lp, lossPerc) - } - } -} - -func TestEncoder_Reset(t *testing.T) { - enc, err := NewEncoder(48000, 1, AppVoIP) - if err != nil || enc == nil { - t.Errorf("Error creating new encoder: %v", err) - } - RunTestCodec(t, enc) - if err := enc.Reset(); err != nil { - t.Errorf("Error reset encoder: %v", err) - } - RunTestCodec(t, enc) -} diff --git a/gumble/go-opus/errors.go b/gumble/go-opus/errors.go deleted file mode 100644 index 8e161ad..0000000 --- a/gumble/go-opus/errors.go +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright © Go Opus Authors (see AUTHORS file) -// -// License for use of this code is detailed in the LICENSE file - -package opus - -import ( - "fmt" -) - -/* -#cgo pkg-config: opus -#include -*/ -import "C" - -type Error int - -var _ error = Error(0) - -// Libopus errors -const ( - ErrOK = Error(C.OPUS_OK) - ErrBadArg = Error(C.OPUS_BAD_ARG) - ErrBufferTooSmall = Error(C.OPUS_BUFFER_TOO_SMALL) - ErrInternalError = Error(C.OPUS_INTERNAL_ERROR) - ErrInvalidPacket = Error(C.OPUS_INVALID_PACKET) - ErrUnimplemented = Error(C.OPUS_UNIMPLEMENTED) - ErrInvalidState = Error(C.OPUS_INVALID_STATE) - ErrAllocFail = Error(C.OPUS_ALLOC_FAIL) -) - -// Error string (in human readable format) for libopus errors. -func (e Error) Error() string { - return fmt.Sprintf("opus: %s", C.GoString(C.opus_strerror(C.int(e)))) -} diff --git a/gumble/go-opus/opus.go b/gumble/go-opus/opus.go deleted file mode 100644 index 159d06a..0000000 --- a/gumble/go-opus/opus.go +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright © Go Opus Authors (see AUTHORS file) -// -// License for use of this code is detailed in the LICENSE file - -package opus - -/* -// Link opus using pkg-config. -#cgo pkg-config: opus -#include -*/ -import "C" - -type Application int - -const ( - // Optimize encoding for VoIP - AppVoIP = Application(C.OPUS_APPLICATION_VOIP) - // Optimize encoding for non-voice signals like music - AppAudio = Application(C.OPUS_APPLICATION_AUDIO) - // Optimize encoding for low latency applications - AppRestrictedLowdelay = Application(C.OPUS_APPLICATION_RESTRICTED_LOWDELAY) -) - -const ( - xMAX_BITRATE = 48000 - xMAX_FRAME_SIZE_MS = 60 - xMAX_FRAME_SIZE = xMAX_BITRATE * xMAX_FRAME_SIZE_MS / 1000 - // Maximum size of an encoded frame. I actually have no idea, but this - // looks like it's big enough. - maxEncodedFrameSize = 10000 -) - -func Version() string { - return C.GoString(C.opus_get_version_string()) -} diff --git a/gumble/go-opus/opus_test.go b/gumble/go-opus/opus_test.go deleted file mode 100644 index 2f3f3bf..0000000 --- a/gumble/go-opus/opus_test.go +++ /dev/null @@ -1,643 +0,0 @@ -// Copyright © Go Opus Authors (see AUTHORS file) -// -// License for use of this code is detailed in the LICENSE file - -package opus - -import ( - "strings" - "testing" -) - -func TestVersion(t *testing.T) { - if ver := Version(); !strings.HasPrefix(ver, "libopus") { - t.Errorf("Unexpected linked libopus version: " + ver) - } -} - -func TestOpusErrstr(t *testing.T) { - // I scooped this -1 up from opus_defines.h, it's OPUS_BAD_ARG. Not pretty, - // but it's better than not testing at all. Again, accessing #defines from - // CGO is not possible. - if ErrBadArg.Error() != "opus: invalid argument" { - t.Errorf("Expected \"invalid argument\" error message for error code %d: %v", - ErrBadArg, ErrBadArg) - } -} - -func TestCodec(t *testing.T) { - const SAMPLE_RATE = 48000 - enc, err := NewEncoder(SAMPLE_RATE, 1, AppVoIP) - if err != nil || enc == nil { - t.Fatalf("Error creating new encoder: %v", err) - } - RunTestCodec(t, enc) -} - -func RunTestCodec(t *testing.T, enc *Encoder) { - // Create bogus input sound - const G4 = 391.995 - const SAMPLE_RATE = 48000 - const FRAME_SIZE_MS = 60 - const FRAME_SIZE = SAMPLE_RATE * FRAME_SIZE_MS / 1000 - pcm := make([]int16, FRAME_SIZE) - addSine(pcm, SAMPLE_RATE, G4) - data := make([]byte, 1000) - n, err := enc.Encode(pcm, data) - if err != nil { - t.Fatalf("Couldn't encode data: %v", err) - } - data = data[:n] - dec, err := NewDecoder(SAMPLE_RATE, 1) - if err != nil || dec == nil { - t.Fatalf("Error creating new decoder: %v", err) - } - n, err = dec.Decode(data, pcm) - if err != nil { - t.Fatalf("Couldn't decode data: %v", err) - } - if len(pcm) != n { - t.Fatalf("Length mismatch: %d samples in, %d out", len(pcm), n) - } - // Checking the output programmatically is seriously not easy. I checked it - // by hand and by ear, it looks fine. I'll just assume the API faithfully - // passes error codes through, and that's that. -} - -func TestCodecFloat32(t *testing.T) { - // Create bogus input sound - const G4 = 391.995 - const SAMPLE_RATE = 48000 - const FRAME_SIZE_MS = 60 - const FRAME_SIZE = SAMPLE_RATE * FRAME_SIZE_MS / 1000 - pcm := make([]float32, FRAME_SIZE) - enc, err := NewEncoder(SAMPLE_RATE, 1, AppVoIP) - if err != nil || enc == nil { - t.Fatalf("Error creating new encoder: %v", err) - } - addSineFloat32(pcm, SAMPLE_RATE, G4) - data := make([]byte, 1000) - n, err := enc.EncodeFloat32(pcm, data) - if err != nil { - t.Fatalf("Couldn't encode data: %v", err) - } - dec, err := NewDecoder(SAMPLE_RATE, 1) - if err != nil || dec == nil { - t.Fatalf("Error creating new decoder: %v", err) - } - // TODO: Uh-oh.. it looks like I forgot to put a data = data[:n] here, yet - // the test is not failing. Why? - n, err = dec.DecodeFloat32(data, pcm) - if err != nil { - t.Fatalf("Couldn't decode data: %v", err) - } - if len(pcm) != n { - t.Fatalf("Length mismatch: %d samples in, %d out", len(pcm), n) - } -} - -func TestCodecFEC(t *testing.T) { - // Create bogus input sound - const G4 = 391.995 - const SAMPLE_RATE = 48000 - const FRAME_SIZE_MS = 10 - const FRAME_SIZE = SAMPLE_RATE * FRAME_SIZE_MS / 1000 - const NUMBER_OF_FRAMES = 6 - pcm := make([]int16, 0) - - enc, err := NewEncoder(SAMPLE_RATE, 1, AppVoIP) - if err != nil || enc == nil { - t.Fatalf("Error creating new encoder: %v", err) - } - enc.SetPacketLossPerc(30) - enc.SetInBandFEC(true) - - dec, err := NewDecoder(SAMPLE_RATE, 1) - if err != nil || dec == nil { - t.Fatalf("Error creating new decoder: %v", err) - } - - mono := make([]int16, FRAME_SIZE*NUMBER_OF_FRAMES) - addSine(mono, SAMPLE_RATE, G4) - - encodedData := make([][]byte, NUMBER_OF_FRAMES) - for i, idx := 0, 0; i < len(mono); i += FRAME_SIZE { - data := make([]byte, 1000) - n, err := enc.Encode(mono[i:i+FRAME_SIZE], data) - if err != nil { - t.Fatalf("Couldn't encode data: %v", err) - } - data = data[:n] - encodedData[idx] = data - idx++ - } - - lost := false - for i := 0; i < len(encodedData); i++ { - // "Dropping" packets 2 and 4 - if i == 2 || i == 4 { - lost = true - continue - } - if lost { - samples, err := dec.LastPacketDuration() - if err != nil { - t.Fatalf("Couldn't get last packet duration: %v", err) - } - - pcmBuffer := make([]int16, samples) - if err = dec.DecodeFEC(encodedData[i], pcmBuffer); err != nil { - t.Fatalf("Couldn't decode data: %v", err) - } - pcm = append(pcm, pcmBuffer...) - lost = false - } - - pcmBuffer := make([]int16, NUMBER_OF_FRAMES*FRAME_SIZE) - n, err := dec.Decode(encodedData[i], pcmBuffer) - if err != nil { - t.Fatalf("Couldn't decode data: %v", err) - } - pcmBuffer = pcmBuffer[:n] - if n != FRAME_SIZE { - t.Fatalf("Length mismatch: %d samples expected, %d out", FRAME_SIZE, n) - } - pcm = append(pcm, pcmBuffer...) - } - - if len(mono) != len(pcm) { - t.Fatalf("Input/Output length mismatch: %d samples in, %d out", len(mono), len(pcm)) - } - - // Commented out for the same reason as in TestStereo - /* - fmt.Printf("in,out\n") - for i := range mono { - fmt.Printf("%d,%d\n", mono[i], pcm[i]) - } - */ - -} - -func TestCodecFECFloat32(t *testing.T) { - // Create bogus input sound - const G4 = 391.995 - const SAMPLE_RATE = 48000 - const FRAME_SIZE_MS = 10 - const FRAME_SIZE = SAMPLE_RATE * FRAME_SIZE_MS / 1000 - const NUMBER_OF_FRAMES = 6 - pcm := make([]float32, 0) - - enc, err := NewEncoder(SAMPLE_RATE, 1, AppVoIP) - if err != nil || enc == nil { - t.Fatalf("Error creating new encoder: %v", err) - } - enc.SetPacketLossPerc(30) - enc.SetInBandFEC(true) - - dec, err := NewDecoder(SAMPLE_RATE, 1) - if err != nil || dec == nil { - t.Fatalf("Error creating new decoder: %v", err) - } - - mono := make([]float32, FRAME_SIZE*NUMBER_OF_FRAMES) - addSineFloat32(mono, SAMPLE_RATE, G4) - - encodedData := make([][]byte, NUMBER_OF_FRAMES) - for i, idx := 0, 0; i < len(mono); i += FRAME_SIZE { - data := make([]byte, 1000) - n, err := enc.EncodeFloat32(mono[i:i+FRAME_SIZE], data) - if err != nil { - t.Fatalf("Couldn't encode data: %v", err) - } - data = data[:n] - encodedData[idx] = data - idx++ - } - - lost := false - for i := 0; i < len(encodedData); i++ { - // "Dropping" packets 2 and 4 - if i == 2 || i == 4 { - lost = true - continue - } - if lost { - samples, err := dec.LastPacketDuration() - if err != nil { - t.Fatalf("Couldn't get last packet duration: %v", err) - } - - pcmBuffer := make([]float32, samples) - if err = dec.DecodeFECFloat32(encodedData[i], pcmBuffer); err != nil { - t.Fatalf("Couldn't decode data: %v", err) - } - pcm = append(pcm, pcmBuffer...) - lost = false - } - - pcmBuffer := make([]float32, NUMBER_OF_FRAMES*FRAME_SIZE) - n, err := dec.DecodeFloat32(encodedData[i], pcmBuffer) - if err != nil { - t.Fatalf("Couldn't decode data: %v", err) - } - pcmBuffer = pcmBuffer[:n] - if n != FRAME_SIZE { - t.Fatalf("Length mismatch: %d samples expected, %d out", FRAME_SIZE, n) - } - pcm = append(pcm, pcmBuffer...) - } - - if len(mono) != len(pcm) { - t.Fatalf("Input/Output length mismatch: %d samples in, %d out", len(mono), len(pcm)) - } - - // Commented out for the same reason as in TestStereo - /* - fmt.Printf("in,out\n") - for i := 0; i < len(mono); i++ { - fmt.Printf("%f,%f\n", mono[i], pcm[i]) - } - */ -} - -func TestCodecPLC(t *testing.T) { - // Create bogus input sound - const G4 = 391.995 - const SAMPLE_RATE = 48000 - const FRAME_SIZE_MS = 10 - const FRAME_SIZE = SAMPLE_RATE * FRAME_SIZE_MS / 1000 - const NUMBER_OF_FRAMES = 6 - pcm := make([]int16, 0) - - enc, err := NewEncoder(SAMPLE_RATE, 1, AppVoIP) - if err != nil || enc == nil { - t.Fatalf("Error creating new encoder: %v", err) - } - - dec, err := NewDecoder(SAMPLE_RATE, 1) - if err != nil || dec == nil { - t.Fatalf("Error creating new decoder: %v", err) - } - - mono := make([]int16, FRAME_SIZE*NUMBER_OF_FRAMES) - addSine(mono, SAMPLE_RATE, G4) - - encodedData := make([][]byte, NUMBER_OF_FRAMES) - for i, idx := 0, 0; i < len(mono); i += FRAME_SIZE { - data := make([]byte, 1000) - n, err := enc.Encode(mono[i:i+FRAME_SIZE], data) - if err != nil { - t.Fatalf("Couldn't encode data: %v", err) - } - data = data[:n] - encodedData[idx] = data - idx++ - } - - lost := false - for i := 0; i < len(encodedData); i++ { - // "Dropping" packets 2 and 4 - if i == 2 || i == 4 { - lost = true - continue - } - if lost { - samples, err := dec.LastPacketDuration() - if err != nil { - t.Fatalf("Couldn't get last packet duration: %v", err) - } - - pcmBuffer := make([]int16, samples) - if err = dec.DecodePLC(pcmBuffer); err != nil { - t.Fatalf("Couldn't decode data: %v", err) - } - nonZero := 0 - for n := range pcmBuffer { - if pcmBuffer[n] != 0 { - nonZero++ - } - } - if nonZero == 0 { - t.Fatalf("DecodePLC produced only zero samples") - } - pcm = append(pcm, pcmBuffer...) - lost = false - } - - pcmBuffer := make([]int16, NUMBER_OF_FRAMES*FRAME_SIZE) - n, err := dec.Decode(encodedData[i], pcmBuffer) - if err != nil { - t.Fatalf("Couldn't decode data: %v", err) - } - pcmBuffer = pcmBuffer[:n] - if n != FRAME_SIZE { - t.Fatalf("Length mismatch: %d samples expected, %d out", FRAME_SIZE, n) - } - pcm = append(pcm, pcmBuffer...) - } - - if len(mono) != len(pcm) { - t.Fatalf("Input/Output length mismatch: %d samples in, %d out", len(mono), len(pcm)) - } - - // Commented out for the same reason as in TestStereo - /* - fmt.Printf("in,out\n") - for i := range mono { - fmt.Printf("%d,%d\n", mono[i], pcm[i]) - } - */ - -} - -func TestCodecPLCFloat32(t *testing.T) { - // Create bogus input sound - const G4 = 391.995 - const SAMPLE_RATE = 48000 - const FRAME_SIZE_MS = 10 - const FRAME_SIZE = SAMPLE_RATE * FRAME_SIZE_MS / 1000 - const NUMBER_OF_FRAMES = 6 - pcm := make([]float32, 0) - - enc, err := NewEncoder(SAMPLE_RATE, 1, AppVoIP) - if err != nil || enc == nil { - t.Fatalf("Error creating new encoder: %v", err) - } - - dec, err := NewDecoder(SAMPLE_RATE, 1) - if err != nil || dec == nil { - t.Fatalf("Error creating new decoder: %v", err) - } - - mono := make([]float32, FRAME_SIZE*NUMBER_OF_FRAMES) - addSineFloat32(mono, SAMPLE_RATE, G4) - - encodedData := make([][]byte, NUMBER_OF_FRAMES) - for i, idx := 0, 0; i < len(mono); i += FRAME_SIZE { - data := make([]byte, 1000) - n, err := enc.EncodeFloat32(mono[i:i+FRAME_SIZE], data) - if err != nil { - t.Fatalf("Couldn't encode data: %v", err) - } - data = data[:n] - encodedData[idx] = data - idx++ - } - - lost := false - for i := 0; i < len(encodedData); i++ { - // "Dropping" packets 2 and 4 - if i == 2 || i == 4 { - lost = true - continue - } - if lost { - samples, err := dec.LastPacketDuration() - if err != nil { - t.Fatalf("Couldn't get last packet duration: %v", err) - } - - pcmBuffer := make([]float32, samples) - if err = dec.DecodePLCFloat32(pcmBuffer); err != nil { - t.Fatalf("Couldn't decode data: %v", err) - } - nonZero := 0 - for n := range pcmBuffer { - if pcmBuffer[n] != 0.0 { - nonZero++ - } - } - if nonZero == 0 { - t.Fatalf("DecodePLC produced only zero samples") - } - pcm = append(pcm, pcmBuffer...) - lost = false - } - - pcmBuffer := make([]float32, NUMBER_OF_FRAMES*FRAME_SIZE) - n, err := dec.DecodeFloat32(encodedData[i], pcmBuffer) - if err != nil { - t.Fatalf("Couldn't decode data: %v", err) - } - pcmBuffer = pcmBuffer[:n] - if n != FRAME_SIZE { - t.Fatalf("Length mismatch: %d samples expected, %d out", FRAME_SIZE, n) - } - pcm = append(pcm, pcmBuffer...) - } - - if len(mono) != len(pcm) { - t.Fatalf("Input/Output length mismatch: %d samples in, %d out", len(mono), len(pcm)) - } - - // Commented out for the same reason as in TestStereo - /* - fmt.Printf("in,out\n") - for i := 0; i < len(mono); i++ { - fmt.Printf("%f,%f\n", mono[i], pcm[i]) - } - */ -} - -func TestStereo(t *testing.T) { - // Create bogus input sound - const G4 = 391.995 - const E3 = 164.814 - const SAMPLE_RATE = 48000 - const FRAME_SIZE_MS = 60 - const CHANNELS = 2 - const FRAME_SIZE_MONO = SAMPLE_RATE * FRAME_SIZE_MS / 1000 - - enc, err := NewEncoder(SAMPLE_RATE, CHANNELS, AppVoIP) - if err != nil || enc == nil { - t.Fatalf("Error creating new encoder: %v", err) - } - dec, err := NewDecoder(SAMPLE_RATE, CHANNELS) - if err != nil || dec == nil { - t.Fatalf("Error creating new decoder: %v", err) - } - - // Source signal (left G4, right E3) - left := make([]int16, FRAME_SIZE_MONO) - right := make([]int16, FRAME_SIZE_MONO) - addSine(left, SAMPLE_RATE, G4) - addSine(right, SAMPLE_RATE, E3) - pcm := interleave(left, right) - - data := make([]byte, 1000) - n, err := enc.Encode(pcm, data) - if err != nil { - t.Fatalf("Couldn't encode data: %v", err) - } - data = data[:n] - n, err = dec.Decode(data, pcm) - if err != nil { - t.Fatalf("Couldn't decode data: %v", err) - } - if n*CHANNELS != len(pcm) { - t.Fatalf("Length mismatch: %d samples in, %d out", len(pcm), n*CHANNELS) - } - - // This is hard to check programatically, but I plotted the graphs in a - // spreadsheet and it looked great. The encoded waves both start out with a - // string of zero samples before they pick up, and the G4 is phase shifted - // by half a period, but that's all fine for lossy audio encoding. - /* - leftdec, rightdec := split(pcm) - fmt.Printf("left_in,left_out,right_in,right_out\n") - for i := range left { - fmt.Printf("%d,%d,%d,%d\n", left[i], leftdec[i], right[i], rightdec[i]) - } - */ -} - -func TestBufferSize(t *testing.T) { - const G4 = 391.995 - const SAMPLE_RATE = 48000 - const FRAME_SIZE_MS = 60 - const FRAME_SIZE = SAMPLE_RATE * FRAME_SIZE_MS / 1000 - const GUARD_SIZE = 100 - - checkGuardInt16 := func(t *testing.T, s []int16) { - for n := range s { - if s[n] != 0 { - t.Fatal("Memory corruption detected") - } - } - } - - checkGuardFloat32 := func(t *testing.T, s []float32) { - for n := range s { - if s[n] != 0 { - t.Fatal("Memory corruption detected") - } - } - } - - checkResult := func(t *testing.T, n int, err error, expectOK bool) { - if expectOK { - if err != nil { - t.Fatalf("Couldn't decode data: %v", err) - } - if n != FRAME_SIZE { - t.Fatalf("Length mismatch: %d samples in, %d out", FRAME_SIZE, n) - } - } else { - if err == nil { - t.Fatalf("Expected decode failure, but it succeeded") - } - } - } - - encodeFrame := func(t *testing.T) []byte { - pcm := make([]int16, FRAME_SIZE) - enc, err := NewEncoder(SAMPLE_RATE, 1, AppVoIP) - if err != nil || enc == nil { - t.Fatalf("Error creating new encoder: %v", err) - } - addSine(pcm, SAMPLE_RATE, G4) - data := make([]byte, 1000) - n, err := enc.Encode(pcm, data) - if err != nil { - t.Fatalf("Couldn't encode data: %v", err) - } - return data[:n] - } - - createDecoder := func(t *testing.T) *Decoder { - dec, err := NewDecoder(SAMPLE_RATE, 1) - if err != nil || dec == nil { - t.Fatalf("Error creating new decoder: %v", err) - } - return dec - } - - decodeInt16 := func(t *testing.T, data []byte, decodeSize int, expectOK bool) { - dec := createDecoder(t) - decodedMem := make([]int16, decodeSize+GUARD_SIZE*2) - decodedRef := decodedMem[GUARD_SIZE : GUARD_SIZE+decodeSize : GUARD_SIZE+decodeSize] - n, err := dec.Decode(data, decodedRef) - checkGuardInt16(t, decodedMem[:GUARD_SIZE]) - checkGuardInt16(t, decodedMem[decodeSize+GUARD_SIZE:]) - checkResult(t, n, err, expectOK) - } - - decodeFloat32 := func(t *testing.T, data []byte, decodeSize int, expectOK bool) { - dec := createDecoder(t) - decodedMem := make([]float32, decodeSize+GUARD_SIZE*2) - decodedRef := decodedMem[GUARD_SIZE : GUARD_SIZE+decodeSize : GUARD_SIZE+decodeSize] - n, err := dec.DecodeFloat32(data, decodedRef) - checkGuardFloat32(t, decodedMem[:GUARD_SIZE]) - checkGuardFloat32(t, decodedMem[decodeSize+GUARD_SIZE:]) - checkResult(t, n, err, expectOK) - } - - decodeFecInt16 := func(t *testing.T, data []byte, decodeSize int, expectOK bool) { - dec := createDecoder(t) - decodedMem := make([]int16, decodeSize+GUARD_SIZE*2) - decodedRef := decodedMem[GUARD_SIZE : GUARD_SIZE+decodeSize : GUARD_SIZE+decodeSize] - err := dec.DecodeFEC(data, decodedRef) - checkGuardInt16(t, decodedMem[:GUARD_SIZE]) - checkGuardInt16(t, decodedMem[decodeSize+GUARD_SIZE:]) - checkResult(t, FRAME_SIZE, err, expectOK) - } - - decodeFecFloat32 := func(t *testing.T, data []byte, decodeSize int, expectOK bool) { - dec := createDecoder(t) - decodedMem := make([]float32, decodeSize+GUARD_SIZE*2) - decodedRef := decodedMem[GUARD_SIZE : GUARD_SIZE+decodeSize : GUARD_SIZE+decodeSize] - err := dec.DecodeFECFloat32(data, decodedRef) - checkGuardFloat32(t, decodedMem[:GUARD_SIZE]) - checkGuardFloat32(t, decodedMem[decodeSize+GUARD_SIZE:]) - checkResult(t, FRAME_SIZE, err, expectOK) - } - - t.Run("smaller-buffer-int16", func(t *testing.T) { - decodeInt16(t, encodeFrame(t), FRAME_SIZE-1, false) - }) - - t.Run("smaller-buffer-float32", func(t *testing.T) { - decodeFloat32(t, encodeFrame(t), FRAME_SIZE-1, false) - }) - - t.Run("smaller-buffer-int16-fec", func(t *testing.T) { - decodeFecFloat32(t, encodeFrame(t), FRAME_SIZE-1, false) - }) - - t.Run("smaller-buffer-float32-fec", func(t *testing.T) { - decodeFecFloat32(t, encodeFrame(t), FRAME_SIZE-1, false) - }) - - t.Run("exact-buffer-int16", func(t *testing.T) { - decodeInt16(t, encodeFrame(t), FRAME_SIZE, true) - }) - - t.Run("exact-buffer-float32", func(t *testing.T) { - decodeFloat32(t, encodeFrame(t), FRAME_SIZE, true) - }) - - t.Run("exact-buffer-int16-fec", func(t *testing.T) { - decodeFecInt16(t, encodeFrame(t), FRAME_SIZE, true) - }) - - t.Run("exact-buffer-float32-fec", func(t *testing.T) { - decodeFecFloat32(t, encodeFrame(t), FRAME_SIZE, true) - }) - - t.Run("larger-buffer-int16", func(t *testing.T) { - decodeInt16(t, encodeFrame(t), FRAME_SIZE+1, true) - }) - - t.Run("larger-buffer-float32", func(t *testing.T) { - decodeFloat32(t, encodeFrame(t), FRAME_SIZE+1, true) - }) - - t.Run("larger-buffer-int16-fec", func(t *testing.T) { - decodeFecInt16(t, encodeFrame(t), FRAME_SIZE+1, false) - }) - - t.Run("larger-buffer-float32-fec", func(t *testing.T) { - decodeFecFloat32(t, encodeFrame(t), FRAME_SIZE+1, false) - }) -} diff --git a/gumble/go-opus/stream.go b/gumble/go-opus/stream.go deleted file mode 100644 index 323da2d..0000000 --- a/gumble/go-opus/stream.go +++ /dev/null @@ -1,183 +0,0 @@ -// Copyright © Go Opus Authors (see AUTHORS file) -// -// License for use of this code is detailed in the LICENSE file - -// +build !nolibopusfile - -package opus - -import ( - "fmt" - "io" - "unsafe" -) - -/* -#cgo pkg-config: opusfile -#include -#include -#include - -OggOpusFile *my_open_callbacks(uintptr_t p, int *error); - -*/ -import "C" - -// Stream wraps a io.Reader in a decoding layer. It provides an API similar to -// io.Reader, but it provides raw PCM data instead of the encoded Opus data. -// -// This is not the same as directly decoding the bytes on the io.Reader; opus -// streams are Ogg Opus audio streams, which package raw Opus data. -// -// This wraps libopusfile. For more information, see the api docs on xiph.org: -// -// https://www.opus-codec.org/docs/opusfile_api-0.7/index.html -type Stream struct { - id uintptr - oggfile *C.OggOpusFile - read io.Reader - // Preallocated buffer to pass to the reader - buf []byte -} - -var streams = newStreamsMap() - -//export go_readcallback -func go_readcallback(p unsafe.Pointer, cbuf *C.uchar, cmaxbytes C.int) C.int { - streamId := uintptr(p) - stream := streams.Get(streamId) - if stream == nil { - // This is bad - return -1 - } - - maxbytes := int(cmaxbytes) - if maxbytes > cap(stream.buf) { - maxbytes = cap(stream.buf) - } - // Don't bother cleaning up old data because that's not required by the - // io.Reader API. - n, err := stream.read.Read(stream.buf[:maxbytes]) - // Go allows returning non-nil error (like EOF) and n>0, libopusfile doesn't - // expect that. So return n first to indicate the valid bytes, let the - // subsequent call (which will be n=0, same-error) handle the actual error. - if n == 0 && err != nil { - if err == io.EOF { - return 0 - } else { - return -1 - } - } - C.memcpy(unsafe.Pointer(cbuf), unsafe.Pointer(&stream.buf[0]), C.size_t(n)) - return C.int(n) -} - -// NewStream creates and initializes a new stream. Don't call .Init() on this. -func NewStream(read io.Reader) (*Stream, error) { - var s Stream - err := s.Init(read) - if err != nil { - return nil, err - } - return &s, nil -} - -// Init initializes a stream with an io.Reader to fetch opus encoded data from -// on demand. Errors from the reader are all transformed to an EOF, any actual -// error information is lost. The same happens when a read returns succesfully, -// but with zero bytes. -func (s *Stream) Init(read io.Reader) error { - if s.oggfile != nil { - return fmt.Errorf("opus stream is already initialized") - } - if read == nil { - return fmt.Errorf("Reader must be non-nil") - } - - s.read = read - s.buf = make([]byte, maxEncodedFrameSize) - s.id = streams.NextId() - var errno C.int - - // Immediately delete the stream after .Init to avoid leaking if the - // caller forgets to (/ doesn't want to) call .Close(). No need for that, - // since the callback is only ever called during a .Read operation; just - // Save and Delete from the map around that every time a reader function is - // called. - streams.Save(s) - defer streams.Del(s) - oggfile := C.my_open_callbacks(C.uintptr_t(s.id), &errno) - if errno != 0 { - return StreamError(errno) - } - s.oggfile = oggfile - return nil -} - -// Read a chunk of raw opus data from the stream and decode it. Returns the -// number of decoded samples per channel. This means that a dual channel -// (stereo) feed will have twice as many samples as the value returned. -// -// Read may successfully read less bytes than requested, but it will never read -// exactly zero bytes succesfully if a non-zero buffer is supplied. -// -// The number of channels in the output data must be known in advance. It is -// possible to extract this information from the stream itself, but I'm not -// motivated to do that. Feel free to send a pull request. -func (s *Stream) Read(pcm []int16) (int, error) { - if s.oggfile == nil { - return 0, fmt.Errorf("opus stream is uninitialized or already closed") - } - if len(pcm) == 0 { - return 0, nil - } - streams.Save(s) - defer streams.Del(s) - n := C.op_read( - s.oggfile, - (*C.opus_int16)(&pcm[0]), - C.int(len(pcm)), - nil) - if n < 0 { - return 0, StreamError(n) - } - if n == 0 { - return 0, io.EOF - } - return int(n), nil -} - -// ReadFloat32 is the same as Read, but decodes to float32 instead of int16. -func (s *Stream) ReadFloat32(pcm []float32) (int, error) { - if s.oggfile == nil { - return 0, fmt.Errorf("opus stream is uninitialized or already closed") - } - if len(pcm) == 0 { - return 0, nil - } - streams.Save(s) - defer streams.Del(s) - n := C.op_read_float( - s.oggfile, - (*C.float)(&pcm[0]), - C.int(len(pcm)), - nil) - if n < 0 { - return 0, StreamError(n) - } - if n == 0 { - return 0, io.EOF - } - return int(n), nil -} - -func (s *Stream) Close() error { - if s.oggfile == nil { - return fmt.Errorf("opus stream is uninitialized or already closed") - } - C.op_free(s.oggfile) - if closer, ok := s.read.(io.Closer); ok { - return closer.Close() - } - return nil -} diff --git a/gumble/go-opus/stream_errors.go b/gumble/go-opus/stream_errors.go deleted file mode 100644 index f1b5cba..0000000 --- a/gumble/go-opus/stream_errors.go +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright © 2015-2017 Go Opus Authors (see AUTHORS file) -// -// License for use of this code is detailed in the LICENSE file - -// +build !nolibopusfile - -package opus - -/* -#cgo pkg-config: opusfile -#include -*/ -import "C" - -// StreamError represents an error from libopusfile. -type StreamError int - -var _ error = StreamError(0) - -// Libopusfile errors. The names are copied verbatim from the libopusfile -// library. -const ( - ErrStreamFalse = StreamError(C.OP_FALSE) - ErrStreamEOF = StreamError(C.OP_EOF) - ErrStreamHole = StreamError(C.OP_HOLE) - ErrStreamRead = StreamError(C.OP_EREAD) - ErrStreamFault = StreamError(C.OP_EFAULT) - ErrStreamImpl = StreamError(C.OP_EIMPL) - ErrStreamInval = StreamError(C.OP_EINVAL) - ErrStreamNotFormat = StreamError(C.OP_ENOTFORMAT) - ErrStreamBadHeader = StreamError(C.OP_EBADHEADER) - ErrStreamVersion = StreamError(C.OP_EVERSION) - ErrStreamNotAudio = StreamError(C.OP_ENOTAUDIO) - ErrStreamBadPacked = StreamError(C.OP_EBADPACKET) - ErrStreamBadLink = StreamError(C.OP_EBADLINK) - ErrStreamNoSeek = StreamError(C.OP_ENOSEEK) - ErrStreamBadTimestamp = StreamError(C.OP_EBADTIMESTAMP) -) - -func (i StreamError) Error() string { - switch i { - case ErrStreamFalse: - return "OP_FALSE" - case ErrStreamEOF: - return "OP_EOF" - case ErrStreamHole: - return "OP_HOLE" - case ErrStreamRead: - return "OP_EREAD" - case ErrStreamFault: - return "OP_EFAULT" - case ErrStreamImpl: - return "OP_EIMPL" - case ErrStreamInval: - return "OP_EINVAL" - case ErrStreamNotFormat: - return "OP_ENOTFORMAT" - case ErrStreamBadHeader: - return "OP_EBADHEADER" - case ErrStreamVersion: - return "OP_EVERSION" - case ErrStreamNotAudio: - return "OP_ENOTAUDIO" - case ErrStreamBadPacked: - return "OP_EBADPACKET" - case ErrStreamBadLink: - return "OP_EBADLINK" - case ErrStreamNoSeek: - return "OP_ENOSEEK" - case ErrStreamBadTimestamp: - return "OP_EBADTIMESTAMP" - default: - return "libopusfile error: %d (unknown code)" - } -} diff --git a/gumble/go-opus/stream_test.go b/gumble/go-opus/stream_test.go deleted file mode 100644 index c6eb4fe..0000000 --- a/gumble/go-opus/stream_test.go +++ /dev/null @@ -1,134 +0,0 @@ -// Copyright © Go Opus Authors (see AUTHORS file) -// -// License for use of this code is detailed in the LICENSE file - -// +build !nolibopusfile - -package opus - -import ( - "fmt" - "io" - "io/ioutil" - "os" - "reflect" - "strings" - "testing" -) - -func TestStreamIllegal(t *testing.T) { - // Simple testing, no actual decoding - reader := strings.NewReader("hello test test this is not a legal Opus stream") - _, err := NewStream(reader) - if err == nil { - t.Fatalf("Expected error while initializing illegal opus stream") - } -} - -func readStreamPcm(t *testing.T, stream *Stream, buffersize int) []int16 { - var pcm []int16 - pcmbuf := make([]int16, buffersize) - for { - n, err := stream.Read(pcmbuf) - switch err { - case io.EOF: - return pcm - case nil: - break - default: - t.Fatalf("Error while decoding opus file: %v", err) - } - if n == 0 { - t.Fatal("Nil-error Read() must not return 0") - } - pcm = append(pcm, pcmbuf[:n]...) - } -} - -func mustOpenFile(t *testing.T, fname string) *os.File { - f, err := os.Open(fname) - if err != nil { - t.Fatalf("Error while opening %s: %v", fname, err) - return nil - } - return f -} - -func mustOpenStream(t *testing.T, r io.Reader) *Stream { - stream, err := NewStream(r) - if err != nil { - t.Fatalf("Error while creating opus stream: %v", err) - return nil - } - return stream -} - -func opus2pcm(t *testing.T, fname string, buffersize int) []int16 { - reader := mustOpenFile(t, fname) - stream := mustOpenStream(t, reader) - return readStreamPcm(t, stream, buffersize) -} - -// Extract raw pcm data from .wav file -func extractWavPcm(t *testing.T, fname string) []int16 { - bytes, err := ioutil.ReadFile(fname) - if err != nil { - t.Fatalf("Error reading file data from %s: %v", fname, err) - } - const wavHeaderSize = 44 - if (len(bytes)-wavHeaderSize)%2 == 1 { - t.Fatalf("Illegal wav data: payload must be encoded in byte pairs") - } - numSamples := (len(bytes) - wavHeaderSize) / 2 - samples := make([]int16, numSamples) - for i := 0; i < numSamples; i++ { - samples[i] += int16(bytes[wavHeaderSize+i*2]) - samples[i] += int16(bytes[wavHeaderSize+i*2+1]) << 8 - } - return samples -} - -func TestStream(t *testing.T) { - opuspcm := opus2pcm(t, "testdata/speech_8.opus", 10000) - wavpcm := extractWavPcm(t, "testdata/speech_8.wav") - if len(opuspcm) != len(wavpcm) { - t.Fatalf("Unexpected length of decoded opus file: %d (.wav: %d)", len(opuspcm), len(wavpcm)) - } - d := maxDiff(opuspcm, wavpcm) - // No science behind this number - const epsilon = 18 - if d > epsilon { - t.Errorf("Maximum difference between decoded streams too high: %d", d) - } -} - -func TestStreamSmallBuffer(t *testing.T) { - smallbuf := opus2pcm(t, "testdata/speech_8.opus", 1) - bigbuf := opus2pcm(t, "testdata/speech_8.opus", 10000) - if !reflect.DeepEqual(smallbuf, bigbuf) { - t.Errorf("Reading with 1-sample buffer size yields different audio data") - } -} - -type mockCloser struct { - io.Reader - closed bool -} - -func (m *mockCloser) Close() error { - if m.closed { - return fmt.Errorf("Already closed") - } - m.closed = true - return nil -} - -func TestCloser(t *testing.T) { - f := mustOpenFile(t, "testdata/speech_8.opus") - mc := &mockCloser{Reader: f} - stream := mustOpenStream(t, mc) - stream.Close() - if !mc.closed { - t.Error("Expected opus stream to call .Close on the reader") - } -} diff --git a/gumble/go-opus/streams_map.go b/gumble/go-opus/streams_map.go deleted file mode 100644 index 944ab39..0000000 --- a/gumble/go-opus/streams_map.go +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright © Go Opus Authors (see AUTHORS file) -// -// License for use of this code is detailed in the LICENSE file - -// +build !nolibopusfile - -package opus - -import ( - "sync" - "sync/atomic" -) - -// A map of simple integers to the actual pointers to stream structs. Avoids -// passing pointers into the Go heap to C. -// -// As per the CGo pointers design doc for go 1.6: -// -// A particular unsafe area is C code that wants to hold on to Go func and -// pointer values for future callbacks from C to Go. This works today but is not -// permitted by the invariant. It is hard to detect. One safe approach is: Go -// code that wants to preserve funcs/pointers stores them into a map indexed by -// an int. Go code calls the C code, passing the int, which the C code may store -// freely. When the C code wants to call into Go, it passes the int to a Go -// function that looks in the map and makes the call. An explicit call is -// required to release the value from the map if it is no longer needed, but -// that was already true before. -// -// - https://github.com/golang/proposal/blob/master/design/12416-cgo-pointers.md -type streamsMap struct { - sync.RWMutex - m map[uintptr]*Stream - counter uintptr -} - -func (sm *streamsMap) Get(id uintptr) *Stream { - sm.RLock() - defer sm.RUnlock() - return sm.m[id] -} - -func (sm *streamsMap) Del(s *Stream) { - sm.Lock() - defer sm.Unlock() - delete(sm.m, s.id) -} - -// NextId returns a unique ID for each call. -func (sm *streamsMap) NextId() uintptr { - return atomic.AddUintptr(&sm.counter, 1) -} - -func (sm *streamsMap) Save(s *Stream) { - sm.Lock() - defer sm.Unlock() - sm.m[s.id] = s -} - -func newStreamsMap() *streamsMap { - return &streamsMap{ - counter: 0, - m: map[uintptr]*Stream{}, - } -} diff --git a/gumble/go-opus/testdata/speech_8.opus b/gumble/go-opus/testdata/speech_8.opus deleted file mode 100644 index ec27645..0000000 Binary files a/gumble/go-opus/testdata/speech_8.opus and /dev/null differ diff --git a/gumble/go-opus/testdata/speech_8.wav b/gumble/go-opus/testdata/speech_8.wav deleted file mode 100644 index 4c6c1fa..0000000 Binary files a/gumble/go-opus/testdata/speech_8.wav and /dev/null differ diff --git a/gumble/go-opus/utils_test.go b/gumble/go-opus/utils_test.go deleted file mode 100644 index aba9d5c..0000000 --- a/gumble/go-opus/utils_test.go +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright © Go Opus Authors (see AUTHORS file) -// -// License for use of this code is detailed in the LICENSE file - -package opus - -import ( - "math" -) - -// utility functions for unit tests - -func addSineFloat32(buf []float32, sampleRate int, freq float64) { - factor := 2 * math.Pi * freq / float64(sampleRate) - for i := range buf { - buf[i] += float32(math.Sin(float64(i) * factor)) - } -} - -func addSine(buf []int16, sampleRate int, freq float64) { - factor := 2 * math.Pi * freq / float64(sampleRate) - for i := range buf { - buf[i] += int16(math.Sin(float64(i)*factor) * (math.MaxInt16 - 1)) - } -} - -func maxDiff(a []int16, b []int16) int32 { - if len(a) != len(b) { - return math.MaxInt16 - } - var max int32 = 0 - for i := range a { - d := int32(a[i]) - int32(b[i]) - if d < 0 { - d = -d - } - if d > max { - max = d - } - } - return max -} - -func interleave(a []int16, b []int16) []int16 { - if len(a) != len(b) { - panic("interleave: buffers must have equal length") - } - result := make([]int16, 2*len(a)) - for i := range a { - result[2*i] = a[i] - result[2*i+1] = b[i] - } - return result -} - -func split(interleaved []int16) ([]int16, []int16) { - if len(interleaved)%2 != 0 { - panic("split: interleaved buffer must have even number of samples") - } - left := make([]int16, len(interleaved)/2) - right := make([]int16, len(interleaved)/2) - for i := range left { - left[i] = interleaved[2*i] - right[i] = interleaved[2*i+1] - } - return left, right -} diff --git a/gumble/gumble/MumbleProto/Mumble.pb.go b/gumble/gumble/MumbleProto/Mumble.pb.go index 1a0fcf6..715beb7 100644 --- a/gumble/gumble/MumbleProto/Mumble.pb.go +++ b/gumble/gumble/MumbleProto/Mumble.pb.go @@ -1,59 +1,30 @@ -// Code generated by protoc-gen-go. +// Copyright The Mumble Developers. All rights reserved. +// Use of this source code is governed by a BSD-style license +// that can be found in the LICENSE file at the root of the +// Mumble source tree or at . + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.36.11 +// protoc v7.34.1 // source: Mumble.proto -// DO NOT EDIT! -/* -Package MumbleProto is a generated protocol buffer package. +package MumbleProto -It is generated from these files: +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" + unsafe "unsafe" +) - Mumble.proto - -It has these top-level messages: - - Version - UDPTunnel - Authenticate - Ping - Reject - ServerSync - ChannelRemove - ChannelState - UserRemove - UserState - BanList - TextMessage - PermissionDenied - ACL - QueryUsers - CryptSetup - ContextActionModify - ContextAction - UserList - VoiceTarget - PermissionQuery - CodecVersion - UserStats - RequestBlob - ServerConfig - SuggestConfig -*/ -package MumbleProto // import "git.stormux.org/storm/barnard/gumble/gumble/MumbleProto" - -import proto "github.com/golang/protobuf/proto" -import fmt "fmt" -import math "math" - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) type Reject_RejectType int32 @@ -78,48 +49,74 @@ const ( // The user did not provide a certificate but one is required. Reject_NoCertificate Reject_RejectType = 7 Reject_AuthenticatorFail Reject_RejectType = 8 + // The server is currently not accepting new connections + Reject_NoNewConnections Reject_RejectType = 9 ) -var Reject_RejectType_name = map[int32]string{ - 0: "None", - 1: "WrongVersion", - 2: "InvalidUsername", - 3: "WrongUserPW", - 4: "WrongServerPW", - 5: "UsernameInUse", - 6: "ServerFull", - 7: "NoCertificate", - 8: "AuthenticatorFail", -} -var Reject_RejectType_value = map[string]int32{ - "None": 0, - "WrongVersion": 1, - "InvalidUsername": 2, - "WrongUserPW": 3, - "WrongServerPW": 4, - "UsernameInUse": 5, - "ServerFull": 6, - "NoCertificate": 7, - "AuthenticatorFail": 8, -} +// Enum value maps for Reject_RejectType. +var ( + Reject_RejectType_name = map[int32]string{ + 0: "None", + 1: "WrongVersion", + 2: "InvalidUsername", + 3: "WrongUserPW", + 4: "WrongServerPW", + 5: "UsernameInUse", + 6: "ServerFull", + 7: "NoCertificate", + 8: "AuthenticatorFail", + 9: "NoNewConnections", + } + Reject_RejectType_value = map[string]int32{ + "None": 0, + "WrongVersion": 1, + "InvalidUsername": 2, + "WrongUserPW": 3, + "WrongServerPW": 4, + "UsernameInUse": 5, + "ServerFull": 6, + "NoCertificate": 7, + "AuthenticatorFail": 8, + "NoNewConnections": 9, + } +) func (x Reject_RejectType) Enum() *Reject_RejectType { p := new(Reject_RejectType) *p = x return p } + func (x Reject_RejectType) String() string { - return proto.EnumName(Reject_RejectType_name, int32(x)) + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) } -func (x *Reject_RejectType) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(Reject_RejectType_value, data, "Reject_RejectType") + +func (Reject_RejectType) Descriptor() protoreflect.EnumDescriptor { + return file_Mumble_proto_enumTypes[0].Descriptor() +} + +func (Reject_RejectType) Type() protoreflect.EnumType { + return &file_Mumble_proto_enumTypes[0] +} + +func (x Reject_RejectType) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Do not use. +func (x *Reject_RejectType) UnmarshalJSON(b []byte) error { + num, err := protoimpl.X.UnmarshalJSONEnum(x.Descriptor(), b) if err != nil { return err } - *x = Reject_RejectType(value) + *x = Reject_RejectType(num) return nil } -func (Reject_RejectType) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{4, 0} } + +// Deprecated: Use Reject_RejectType.Descriptor instead. +func (Reject_RejectType) EnumDescriptor() ([]byte, []int) { + return file_Mumble_proto_rawDescGZIP(), []int{4, 0} +} type PermissionDenied_DenyType int32 @@ -143,55 +140,88 @@ const ( // Invalid username. PermissionDenied_UserName PermissionDenied_DenyType = 8 // Channel is full. - PermissionDenied_ChannelFull PermissionDenied_DenyType = 9 + PermissionDenied_ChannelFull PermissionDenied_DenyType = 9 + // Channels are nested too deeply. PermissionDenied_NestingLimit PermissionDenied_DenyType = 10 + // Maximum channel count reached. + PermissionDenied_ChannelCountLimit PermissionDenied_DenyType = 11 + // Amount of listener objects for this channel has been reached + PermissionDenied_ChannelListenerLimit PermissionDenied_DenyType = 12 + // Amount of listener proxies for the user has been reached + PermissionDenied_UserListenerLimit PermissionDenied_DenyType = 13 ) -var PermissionDenied_DenyType_name = map[int32]string{ - 0: "Text", - 1: "Permission", - 2: "SuperUser", - 3: "ChannelName", - 4: "TextTooLong", - 5: "H9K", - 6: "TemporaryChannel", - 7: "MissingCertificate", - 8: "UserName", - 9: "ChannelFull", - 10: "NestingLimit", -} -var PermissionDenied_DenyType_value = map[string]int32{ - "Text": 0, - "Permission": 1, - "SuperUser": 2, - "ChannelName": 3, - "TextTooLong": 4, - "H9K": 5, - "TemporaryChannel": 6, - "MissingCertificate": 7, - "UserName": 8, - "ChannelFull": 9, - "NestingLimit": 10, -} +// Enum value maps for PermissionDenied_DenyType. +var ( + PermissionDenied_DenyType_name = map[int32]string{ + 0: "Text", + 1: "Permission", + 2: "SuperUser", + 3: "ChannelName", + 4: "TextTooLong", + 5: "H9K", + 6: "TemporaryChannel", + 7: "MissingCertificate", + 8: "UserName", + 9: "ChannelFull", + 10: "NestingLimit", + 11: "ChannelCountLimit", + 12: "ChannelListenerLimit", + 13: "UserListenerLimit", + } + PermissionDenied_DenyType_value = map[string]int32{ + "Text": 0, + "Permission": 1, + "SuperUser": 2, + "ChannelName": 3, + "TextTooLong": 4, + "H9K": 5, + "TemporaryChannel": 6, + "MissingCertificate": 7, + "UserName": 8, + "ChannelFull": 9, + "NestingLimit": 10, + "ChannelCountLimit": 11, + "ChannelListenerLimit": 12, + "UserListenerLimit": 13, + } +) func (x PermissionDenied_DenyType) Enum() *PermissionDenied_DenyType { p := new(PermissionDenied_DenyType) *p = x return p } + func (x PermissionDenied_DenyType) String() string { - return proto.EnumName(PermissionDenied_DenyType_name, int32(x)) + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) } -func (x *PermissionDenied_DenyType) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(PermissionDenied_DenyType_value, data, "PermissionDenied_DenyType") + +func (PermissionDenied_DenyType) Descriptor() protoreflect.EnumDescriptor { + return file_Mumble_proto_enumTypes[1].Descriptor() +} + +func (PermissionDenied_DenyType) Type() protoreflect.EnumType { + return &file_Mumble_proto_enumTypes[1] +} + +func (x PermissionDenied_DenyType) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Do not use. +func (x *PermissionDenied_DenyType) UnmarshalJSON(b []byte) error { + num, err := protoimpl.X.UnmarshalJSONEnum(x.Descriptor(), b) if err != nil { return err } - *x = PermissionDenied_DenyType(value) + *x = PermissionDenied_DenyType(num) return nil } + +// Deprecated: Use PermissionDenied_DenyType.Descriptor instead. func (PermissionDenied_DenyType) EnumDescriptor() ([]byte, []int) { - return fileDescriptor0, []int{12, 0} + return file_Mumble_proto_rawDescGZIP(), []int{12, 0} } type ContextActionModify_Context int32 @@ -205,35 +235,55 @@ const ( ContextActionModify_User ContextActionModify_Context = 4 ) -var ContextActionModify_Context_name = map[int32]string{ - 1: "Server", - 2: "Channel", - 4: "User", -} -var ContextActionModify_Context_value = map[string]int32{ - "Server": 1, - "Channel": 2, - "User": 4, -} +// Enum value maps for ContextActionModify_Context. +var ( + ContextActionModify_Context_name = map[int32]string{ + 1: "Server", + 2: "Channel", + 4: "User", + } + ContextActionModify_Context_value = map[string]int32{ + "Server": 1, + "Channel": 2, + "User": 4, + } +) func (x ContextActionModify_Context) Enum() *ContextActionModify_Context { p := new(ContextActionModify_Context) *p = x return p } + func (x ContextActionModify_Context) String() string { - return proto.EnumName(ContextActionModify_Context_name, int32(x)) + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) } -func (x *ContextActionModify_Context) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(ContextActionModify_Context_value, data, "ContextActionModify_Context") + +func (ContextActionModify_Context) Descriptor() protoreflect.EnumDescriptor { + return file_Mumble_proto_enumTypes[2].Descriptor() +} + +func (ContextActionModify_Context) Type() protoreflect.EnumType { + return &file_Mumble_proto_enumTypes[2] +} + +func (x ContextActionModify_Context) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Do not use. +func (x *ContextActionModify_Context) UnmarshalJSON(b []byte) error { + num, err := protoimpl.X.UnmarshalJSONEnum(x.Descriptor(), b) if err != nil { return err } - *x = ContextActionModify_Context(value) + *x = ContextActionModify_Context(num) return nil } + +// Deprecated: Use ContextActionModify_Context.Descriptor instead. func (ContextActionModify_Context) EnumDescriptor() ([]byte, []int) { - return fileDescriptor0, []int{16, 0} + return file_Mumble_proto_rawDescGZIP(), []int{16, 0} } type ContextActionModify_Operation int32 @@ -243,101 +293,186 @@ const ( ContextActionModify_Remove ContextActionModify_Operation = 1 ) -var ContextActionModify_Operation_name = map[int32]string{ - 0: "Add", - 1: "Remove", -} -var ContextActionModify_Operation_value = map[string]int32{ - "Add": 0, - "Remove": 1, -} +// Enum value maps for ContextActionModify_Operation. +var ( + ContextActionModify_Operation_name = map[int32]string{ + 0: "Add", + 1: "Remove", + } + ContextActionModify_Operation_value = map[string]int32{ + "Add": 0, + "Remove": 1, + } +) func (x ContextActionModify_Operation) Enum() *ContextActionModify_Operation { p := new(ContextActionModify_Operation) *p = x return p } + func (x ContextActionModify_Operation) String() string { - return proto.EnumName(ContextActionModify_Operation_name, int32(x)) + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) } -func (x *ContextActionModify_Operation) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(ContextActionModify_Operation_value, data, "ContextActionModify_Operation") + +func (ContextActionModify_Operation) Descriptor() protoreflect.EnumDescriptor { + return file_Mumble_proto_enumTypes[3].Descriptor() +} + +func (ContextActionModify_Operation) Type() protoreflect.EnumType { + return &file_Mumble_proto_enumTypes[3] +} + +func (x ContextActionModify_Operation) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Do not use. +func (x *ContextActionModify_Operation) UnmarshalJSON(b []byte) error { + num, err := protoimpl.X.UnmarshalJSONEnum(x.Descriptor(), b) if err != nil { return err } - *x = ContextActionModify_Operation(value) + *x = ContextActionModify_Operation(num) return nil } + +// Deprecated: Use ContextActionModify_Operation.Descriptor instead. func (ContextActionModify_Operation) EnumDescriptor() ([]byte, []int) { - return fileDescriptor0, []int{16, 1} + return file_Mumble_proto_rawDescGZIP(), []int{16, 1} } type Version struct { - // 2-byte Major, 1-byte Minor and 1-byte Patch version number. - Version *uint32 `protobuf:"varint,1,opt,name=version" json:"version,omitempty"` + state protoimpl.MessageState `protogen:"open.v1"` + // Legacy version number format. + VersionV1 *uint32 `protobuf:"varint,1,opt,name=version_v1,json=versionV1" json:"version_v1,omitempty"` + // New version number format. + // Necessary since patch level may exceed 255. (See https://github.com/mumble-voip/mumble/issues/5827) + VersionV2 *uint64 `protobuf:"varint,5,opt,name=version_v2,json=versionV2" json:"version_v2,omitempty"` // Client release name. Release *string `protobuf:"bytes,2,opt,name=release" json:"release,omitempty"` // Client OS name. Os *string `protobuf:"bytes,3,opt,name=os" json:"os,omitempty"` // Client OS version. - OsVersion *string `protobuf:"bytes,4,opt,name=os_version,json=osVersion" json:"os_version,omitempty"` - XXX_unrecognized []byte `json:"-"` + OsVersion *string `protobuf:"bytes,4,opt,name=os_version,json=osVersion" json:"os_version,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } -func (m *Version) Reset() { *m = Version{} } -func (m *Version) String() string { return proto.CompactTextString(m) } -func (*Version) ProtoMessage() {} -func (*Version) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } +func (x *Version) Reset() { + *x = Version{} + mi := &file_Mumble_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} -func (m *Version) GetVersion() uint32 { - if m != nil && m.Version != nil { - return *m.Version +func (x *Version) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Version) ProtoMessage() {} + +func (x *Version) ProtoReflect() protoreflect.Message { + mi := &file_Mumble_proto_msgTypes[0] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Version.ProtoReflect.Descriptor instead. +func (*Version) Descriptor() ([]byte, []int) { + return file_Mumble_proto_rawDescGZIP(), []int{0} +} + +func (x *Version) GetVersionV1() uint32 { + if x != nil && x.VersionV1 != nil { + return *x.VersionV1 } return 0 } -func (m *Version) GetRelease() string { - if m != nil && m.Release != nil { - return *m.Release +func (x *Version) GetVersionV2() uint64 { + if x != nil && x.VersionV2 != nil { + return *x.VersionV2 + } + return 0 +} + +func (x *Version) GetRelease() string { + if x != nil && x.Release != nil { + return *x.Release } return "" } -func (m *Version) GetOs() string { - if m != nil && m.Os != nil { - return *m.Os +func (x *Version) GetOs() string { + if x != nil && x.Os != nil { + return *x.Os } return "" } -func (m *Version) GetOsVersion() string { - if m != nil && m.OsVersion != nil { - return *m.OsVersion +func (x *Version) GetOsVersion() string { + if x != nil && x.OsVersion != nil { + return *x.OsVersion } return "" } // Not used. Not even for tunneling UDP through TCP. type UDPTunnel struct { + state protoimpl.MessageState `protogen:"open.v1"` // Not used. - Packet []byte `protobuf:"bytes,1,req,name=packet" json:"packet,omitempty"` - XXX_unrecognized []byte `json:"-"` + Packet []byte `protobuf:"bytes,1,req,name=packet" json:"packet,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } -func (m *UDPTunnel) Reset() { *m = UDPTunnel{} } -func (m *UDPTunnel) String() string { return proto.CompactTextString(m) } -func (*UDPTunnel) ProtoMessage() {} -func (*UDPTunnel) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} } +func (x *UDPTunnel) Reset() { + *x = UDPTunnel{} + mi := &file_Mumble_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} -func (m *UDPTunnel) GetPacket() []byte { - if m != nil { - return m.Packet +func (x *UDPTunnel) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UDPTunnel) ProtoMessage() {} + +func (x *UDPTunnel) ProtoReflect() protoreflect.Message { + mi := &file_Mumble_proto_msgTypes[1] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UDPTunnel.ProtoReflect.Descriptor instead. +func (*UDPTunnel) Descriptor() ([]byte, []int) { + return file_Mumble_proto_rawDescGZIP(), []int{1} +} + +func (x *UDPTunnel) GetPacket() []byte { + if x != nil { + return x.Packet } return nil } // Used by the client to send the authentication credentials to the server. type Authenticate struct { + state protoimpl.MessageState `protogen:"open.v1"` // UTF-8 encoded username. Username *string `protobuf:"bytes,1,opt,name=username" json:"username,omitempty"` // Server or user password. @@ -345,57 +480,97 @@ type Authenticate struct { // Additional access tokens for server ACL groups. Tokens []string `protobuf:"bytes,3,rep,name=tokens" json:"tokens,omitempty"` // A list of CELT bitstream version constants supported by the client. - CeltVersions []int32 `protobuf:"varint,4,rep,name=celt_versions,json=celtVersions" json:"celt_versions,omitempty"` - Opus *bool `protobuf:"varint,5,opt,name=opus,def=0" json:"opus,omitempty"` - XXX_unrecognized []byte `json:"-"` + CeltVersions []int32 `protobuf:"varint,4,rep,name=celt_versions,json=celtVersions" json:"celt_versions,omitempty"` + Opus *bool `protobuf:"varint,5,opt,name=opus,def=0" json:"opus,omitempty"` + // 0 = REGULAR, 1 = BOT + ClientType *int32 `protobuf:"varint,6,opt,name=client_type,json=clientType,def=0" json:"client_type,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } -func (m *Authenticate) Reset() { *m = Authenticate{} } -func (m *Authenticate) String() string { return proto.CompactTextString(m) } -func (*Authenticate) ProtoMessage() {} -func (*Authenticate) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2} } +// Default values for Authenticate fields. +const ( + Default_Authenticate_Opus = bool(false) + Default_Authenticate_ClientType = int32(0) +) -const Default_Authenticate_Opus bool = false +func (x *Authenticate) Reset() { + *x = Authenticate{} + mi := &file_Mumble_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} -func (m *Authenticate) GetUsername() string { - if m != nil && m.Username != nil { - return *m.Username +func (x *Authenticate) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Authenticate) ProtoMessage() {} + +func (x *Authenticate) ProtoReflect() protoreflect.Message { + mi := &file_Mumble_proto_msgTypes[2] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Authenticate.ProtoReflect.Descriptor instead. +func (*Authenticate) Descriptor() ([]byte, []int) { + return file_Mumble_proto_rawDescGZIP(), []int{2} +} + +func (x *Authenticate) GetUsername() string { + if x != nil && x.Username != nil { + return *x.Username } return "" } -func (m *Authenticate) GetPassword() string { - if m != nil && m.Password != nil { - return *m.Password +func (x *Authenticate) GetPassword() string { + if x != nil && x.Password != nil { + return *x.Password } return "" } -func (m *Authenticate) GetTokens() []string { - if m != nil { - return m.Tokens +func (x *Authenticate) GetTokens() []string { + if x != nil { + return x.Tokens } return nil } -func (m *Authenticate) GetCeltVersions() []int32 { - if m != nil { - return m.CeltVersions +func (x *Authenticate) GetCeltVersions() []int32 { + if x != nil { + return x.CeltVersions } return nil } -func (m *Authenticate) GetOpus() bool { - if m != nil && m.Opus != nil { - return *m.Opus +func (x *Authenticate) GetOpus() bool { + if x != nil && x.Opus != nil { + return *x.Opus } return Default_Authenticate_Opus } +func (x *Authenticate) GetClientType() int32 { + if x != nil && x.ClientType != nil { + return *x.ClientType + } + return Default_Authenticate_ClientType +} + // Sent by the client to notify the server that the client is still alive. // Server must reply to the packet with the same timestamp and its own // good/late/lost/resync numbers. None of the fields is strictly required. type Ping struct { + state protoimpl.MessageState `protogen:"open.v1"` // Client timestamp. Server should not attempt to decode. Timestamp *uint64 `protobuf:"varint,1,opt,name=timestamp" json:"timestamp,omitempty"` // The amount of good packets received. @@ -417,116 +592,169 @@ type Ping struct { // TCP ping average. TcpPingAvg *float32 `protobuf:"fixed32,10,opt,name=tcp_ping_avg,json=tcpPingAvg" json:"tcp_ping_avg,omitempty"` // TCP ping variance. - TcpPingVar *float32 `protobuf:"fixed32,11,opt,name=tcp_ping_var,json=tcpPingVar" json:"tcp_ping_var,omitempty"` - XXX_unrecognized []byte `json:"-"` + TcpPingVar *float32 `protobuf:"fixed32,11,opt,name=tcp_ping_var,json=tcpPingVar" json:"tcp_ping_var,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } -func (m *Ping) Reset() { *m = Ping{} } -func (m *Ping) String() string { return proto.CompactTextString(m) } -func (*Ping) ProtoMessage() {} -func (*Ping) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{3} } +func (x *Ping) Reset() { + *x = Ping{} + mi := &file_Mumble_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} -func (m *Ping) GetTimestamp() uint64 { - if m != nil && m.Timestamp != nil { - return *m.Timestamp +func (x *Ping) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Ping) ProtoMessage() {} + +func (x *Ping) ProtoReflect() protoreflect.Message { + mi := &file_Mumble_proto_msgTypes[3] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Ping.ProtoReflect.Descriptor instead. +func (*Ping) Descriptor() ([]byte, []int) { + return file_Mumble_proto_rawDescGZIP(), []int{3} +} + +func (x *Ping) GetTimestamp() uint64 { + if x != nil && x.Timestamp != nil { + return *x.Timestamp } return 0 } -func (m *Ping) GetGood() uint32 { - if m != nil && m.Good != nil { - return *m.Good +func (x *Ping) GetGood() uint32 { + if x != nil && x.Good != nil { + return *x.Good } return 0 } -func (m *Ping) GetLate() uint32 { - if m != nil && m.Late != nil { - return *m.Late +func (x *Ping) GetLate() uint32 { + if x != nil && x.Late != nil { + return *x.Late } return 0 } -func (m *Ping) GetLost() uint32 { - if m != nil && m.Lost != nil { - return *m.Lost +func (x *Ping) GetLost() uint32 { + if x != nil && x.Lost != nil { + return *x.Lost } return 0 } -func (m *Ping) GetResync() uint32 { - if m != nil && m.Resync != nil { - return *m.Resync +func (x *Ping) GetResync() uint32 { + if x != nil && x.Resync != nil { + return *x.Resync } return 0 } -func (m *Ping) GetUdpPackets() uint32 { - if m != nil && m.UdpPackets != nil { - return *m.UdpPackets +func (x *Ping) GetUdpPackets() uint32 { + if x != nil && x.UdpPackets != nil { + return *x.UdpPackets } return 0 } -func (m *Ping) GetTcpPackets() uint32 { - if m != nil && m.TcpPackets != nil { - return *m.TcpPackets +func (x *Ping) GetTcpPackets() uint32 { + if x != nil && x.TcpPackets != nil { + return *x.TcpPackets } return 0 } -func (m *Ping) GetUdpPingAvg() float32 { - if m != nil && m.UdpPingAvg != nil { - return *m.UdpPingAvg +func (x *Ping) GetUdpPingAvg() float32 { + if x != nil && x.UdpPingAvg != nil { + return *x.UdpPingAvg } return 0 } -func (m *Ping) GetUdpPingVar() float32 { - if m != nil && m.UdpPingVar != nil { - return *m.UdpPingVar +func (x *Ping) GetUdpPingVar() float32 { + if x != nil && x.UdpPingVar != nil { + return *x.UdpPingVar } return 0 } -func (m *Ping) GetTcpPingAvg() float32 { - if m != nil && m.TcpPingAvg != nil { - return *m.TcpPingAvg +func (x *Ping) GetTcpPingAvg() float32 { + if x != nil && x.TcpPingAvg != nil { + return *x.TcpPingAvg } return 0 } -func (m *Ping) GetTcpPingVar() float32 { - if m != nil && m.TcpPingVar != nil { - return *m.TcpPingVar +func (x *Ping) GetTcpPingVar() float32 { + if x != nil && x.TcpPingVar != nil { + return *x.TcpPingVar } return 0 } // Sent by the server when it rejects the user connection. type Reject struct { + state protoimpl.MessageState `protogen:"open.v1"` // Rejection type. Type *Reject_RejectType `protobuf:"varint,1,opt,name=type,enum=MumbleProto.Reject_RejectType" json:"type,omitempty"` // Human readable rejection reason. - Reason *string `protobuf:"bytes,2,opt,name=reason" json:"reason,omitempty"` - XXX_unrecognized []byte `json:"-"` + Reason *string `protobuf:"bytes,2,opt,name=reason" json:"reason,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } -func (m *Reject) Reset() { *m = Reject{} } -func (m *Reject) String() string { return proto.CompactTextString(m) } -func (*Reject) ProtoMessage() {} -func (*Reject) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{4} } +func (x *Reject) Reset() { + *x = Reject{} + mi := &file_Mumble_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} -func (m *Reject) GetType() Reject_RejectType { - if m != nil && m.Type != nil { - return *m.Type +func (x *Reject) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Reject) ProtoMessage() {} + +func (x *Reject) ProtoReflect() protoreflect.Message { + mi := &file_Mumble_proto_msgTypes[4] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Reject.ProtoReflect.Descriptor instead. +func (*Reject) Descriptor() ([]byte, []int) { + return file_Mumble_proto_rawDescGZIP(), []int{4} +} + +func (x *Reject) GetType() Reject_RejectType { + if x != nil && x.Type != nil { + return *x.Type } return Reject_None } -func (m *Reject) GetReason() string { - if m != nil && m.Reason != nil { - return *m.Reason +func (x *Reject) GetReason() string { + if x != nil && x.Reason != nil { + return *x.Reason } return "" } @@ -534,6 +762,7 @@ func (m *Reject) GetReason() string { // ServerSync message is sent by the server when it has authenticated the user // and finished synchronizing the server state. type ServerSync struct { + state protoimpl.MessageState `protogen:"open.v1"` // The session of the current user. Session *uint32 `protobuf:"varint,1,opt,name=session" json:"session,omitempty"` // Maximum bandwidth that the user should use. @@ -541,39 +770,68 @@ type ServerSync struct { // Server welcome text. WelcomeText *string `protobuf:"bytes,3,opt,name=welcome_text,json=welcomeText" json:"welcome_text,omitempty"` // Current user permissions in the root channel. - Permissions *uint64 `protobuf:"varint,4,opt,name=permissions" json:"permissions,omitempty"` - XXX_unrecognized []byte `json:"-"` + // Note: The permissions data type usually is uin32 (e.g. in PermissionQuery and PermissionDenied messages). Here + // it is uint64 because of an oversight in the past. Nonetheless it should never exceed the uin32 range. + // See also: https://github.com/mumble-voip/mumble/issues/5139 + Permissions *uint64 `protobuf:"varint,4,opt,name=permissions" json:"permissions,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } -func (m *ServerSync) Reset() { *m = ServerSync{} } -func (m *ServerSync) String() string { return proto.CompactTextString(m) } -func (*ServerSync) ProtoMessage() {} -func (*ServerSync) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{5} } +func (x *ServerSync) Reset() { + *x = ServerSync{} + mi := &file_Mumble_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} -func (m *ServerSync) GetSession() uint32 { - if m != nil && m.Session != nil { - return *m.Session +func (x *ServerSync) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ServerSync) ProtoMessage() {} + +func (x *ServerSync) ProtoReflect() protoreflect.Message { + mi := &file_Mumble_proto_msgTypes[5] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ServerSync.ProtoReflect.Descriptor instead. +func (*ServerSync) Descriptor() ([]byte, []int) { + return file_Mumble_proto_rawDescGZIP(), []int{5} +} + +func (x *ServerSync) GetSession() uint32 { + if x != nil && x.Session != nil { + return *x.Session } return 0 } -func (m *ServerSync) GetMaxBandwidth() uint32 { - if m != nil && m.MaxBandwidth != nil { - return *m.MaxBandwidth +func (x *ServerSync) GetMaxBandwidth() uint32 { + if x != nil && x.MaxBandwidth != nil { + return *x.MaxBandwidth } return 0 } -func (m *ServerSync) GetWelcomeText() string { - if m != nil && m.WelcomeText != nil { - return *m.WelcomeText +func (x *ServerSync) GetWelcomeText() string { + if x != nil && x.WelcomeText != nil { + return *x.WelcomeText } return "" } -func (m *ServerSync) GetPermissions() uint64 { - if m != nil && m.Permissions != nil { - return *m.Permissions +func (x *ServerSync) GetPermissions() uint64 { + if x != nil && x.Permissions != nil { + return *x.Permissions } return 0 } @@ -581,18 +839,45 @@ func (m *ServerSync) GetPermissions() uint64 { // Sent by the client when it wants a channel removed. Sent by the server when // a channel has been removed and clients should be notified. type ChannelRemove struct { - ChannelId *uint32 `protobuf:"varint,1,req,name=channel_id,json=channelId" json:"channel_id,omitempty"` - XXX_unrecognized []byte `json:"-"` + state protoimpl.MessageState `protogen:"open.v1"` + ChannelId *uint32 `protobuf:"varint,1,req,name=channel_id,json=channelId" json:"channel_id,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } -func (m *ChannelRemove) Reset() { *m = ChannelRemove{} } -func (m *ChannelRemove) String() string { return proto.CompactTextString(m) } -func (*ChannelRemove) ProtoMessage() {} -func (*ChannelRemove) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{6} } +func (x *ChannelRemove) Reset() { + *x = ChannelRemove{} + mi := &file_Mumble_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} -func (m *ChannelRemove) GetChannelId() uint32 { - if m != nil && m.ChannelId != nil { - return *m.ChannelId +func (x *ChannelRemove) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ChannelRemove) ProtoMessage() {} + +func (x *ChannelRemove) ProtoReflect() protoreflect.Message { + mi := &file_Mumble_proto_msgTypes[6] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ChannelRemove.ProtoReflect.Descriptor instead. +func (*ChannelRemove) Descriptor() ([]byte, []int) { + return file_Mumble_proto_rawDescGZIP(), []int{6} +} + +func (x *ChannelRemove) GetChannelId() uint32 { + if x != nil && x.ChannelId != nil { + return *x.ChannelId } return 0 } @@ -601,6 +886,7 @@ func (m *ChannelRemove) GetChannelId() uint32 { // Sent by the server during the login process or when channel properties are // updated. Client may use this message to update said channel properties. type ChannelState struct { + state protoimpl.MessageState `protogen:"open.v1"` // Unique ID for the channel within the server. ChannelId *uint32 `protobuf:"varint,1,opt,name=channel_id,json=channelId" json:"channel_id,omitempty"` // channel_id of the parent channel. @@ -626,99 +912,147 @@ type ChannelState struct { // Maximum number of users allowed in the channel. If this value is zero, // the maximum number of users allowed in the channel is given by the // server's "usersperchannel" setting. - MaxUsers *uint32 `protobuf:"varint,11,opt,name=max_users,json=maxUsers" json:"max_users,omitempty"` - XXX_unrecognized []byte `json:"-"` + MaxUsers *uint32 `protobuf:"varint,11,opt,name=max_users,json=maxUsers" json:"max_users,omitempty"` + // Whether this channel has enter restrictions (ACL denying ENTER) set + IsEnterRestricted *bool `protobuf:"varint,12,opt,name=is_enter_restricted,json=isEnterRestricted" json:"is_enter_restricted,omitempty"` + // Whether the receiver of this msg is considered to be able to enter this channel + CanEnter *bool `protobuf:"varint,13,opt,name=can_enter,json=canEnter" json:"can_enter,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } -func (m *ChannelState) Reset() { *m = ChannelState{} } -func (m *ChannelState) String() string { return proto.CompactTextString(m) } -func (*ChannelState) ProtoMessage() {} -func (*ChannelState) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{7} } +// Default values for ChannelState fields. +const ( + Default_ChannelState_Temporary = bool(false) + Default_ChannelState_Position = int32(0) +) -const Default_ChannelState_Temporary bool = false -const Default_ChannelState_Position int32 = 0 +func (x *ChannelState) Reset() { + *x = ChannelState{} + mi := &file_Mumble_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} -func (m *ChannelState) GetChannelId() uint32 { - if m != nil && m.ChannelId != nil { - return *m.ChannelId +func (x *ChannelState) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ChannelState) ProtoMessage() {} + +func (x *ChannelState) ProtoReflect() protoreflect.Message { + mi := &file_Mumble_proto_msgTypes[7] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ChannelState.ProtoReflect.Descriptor instead. +func (*ChannelState) Descriptor() ([]byte, []int) { + return file_Mumble_proto_rawDescGZIP(), []int{7} +} + +func (x *ChannelState) GetChannelId() uint32 { + if x != nil && x.ChannelId != nil { + return *x.ChannelId } return 0 } -func (m *ChannelState) GetParent() uint32 { - if m != nil && m.Parent != nil { - return *m.Parent +func (x *ChannelState) GetParent() uint32 { + if x != nil && x.Parent != nil { + return *x.Parent } return 0 } -func (m *ChannelState) GetName() string { - if m != nil && m.Name != nil { - return *m.Name +func (x *ChannelState) GetName() string { + if x != nil && x.Name != nil { + return *x.Name } return "" } -func (m *ChannelState) GetLinks() []uint32 { - if m != nil { - return m.Links +func (x *ChannelState) GetLinks() []uint32 { + if x != nil { + return x.Links } return nil } -func (m *ChannelState) GetDescription() string { - if m != nil && m.Description != nil { - return *m.Description +func (x *ChannelState) GetDescription() string { + if x != nil && x.Description != nil { + return *x.Description } return "" } -func (m *ChannelState) GetLinksAdd() []uint32 { - if m != nil { - return m.LinksAdd +func (x *ChannelState) GetLinksAdd() []uint32 { + if x != nil { + return x.LinksAdd } return nil } -func (m *ChannelState) GetLinksRemove() []uint32 { - if m != nil { - return m.LinksRemove +func (x *ChannelState) GetLinksRemove() []uint32 { + if x != nil { + return x.LinksRemove } return nil } -func (m *ChannelState) GetTemporary() bool { - if m != nil && m.Temporary != nil { - return *m.Temporary +func (x *ChannelState) GetTemporary() bool { + if x != nil && x.Temporary != nil { + return *x.Temporary } return Default_ChannelState_Temporary } -func (m *ChannelState) GetPosition() int32 { - if m != nil && m.Position != nil { - return *m.Position +func (x *ChannelState) GetPosition() int32 { + if x != nil && x.Position != nil { + return *x.Position } return Default_ChannelState_Position } -func (m *ChannelState) GetDescriptionHash() []byte { - if m != nil { - return m.DescriptionHash +func (x *ChannelState) GetDescriptionHash() []byte { + if x != nil { + return x.DescriptionHash } return nil } -func (m *ChannelState) GetMaxUsers() uint32 { - if m != nil && m.MaxUsers != nil { - return *m.MaxUsers +func (x *ChannelState) GetMaxUsers() uint32 { + if x != nil && x.MaxUsers != nil { + return *x.MaxUsers } return 0 } +func (x *ChannelState) GetIsEnterRestricted() bool { + if x != nil && x.IsEnterRestricted != nil { + return *x.IsEnterRestricted + } + return false +} + +func (x *ChannelState) GetCanEnter() bool { + if x != nil && x.CanEnter != nil { + return *x.CanEnter + } + return false +} + // Used to communicate user leaving or being kicked. May be sent by the client // when it attempts to kick a user. Sent by the server when it informs the // clients that a user is not present anymore. type UserRemove struct { + state protoimpl.MessageState `protogen:"open.v1"` // The user who is being kicked, identified by their session, not present // when no one is being kicked. Session *uint32 `protobuf:"varint,1,req,name=session" json:"session,omitempty"` @@ -727,40 +1061,84 @@ type UserRemove struct { Actor *uint32 `protobuf:"varint,2,opt,name=actor" json:"actor,omitempty"` // Reason for the kick, stored as the ban reason if the user is banned. Reason *string `protobuf:"bytes,3,opt,name=reason" json:"reason,omitempty"` - // True if the kick should result in a ban. - Ban *bool `protobuf:"varint,4,opt,name=ban" json:"ban,omitempty"` - XXX_unrecognized []byte `json:"-"` + // True if the user shall be banned, false if the user shall be kicked + Ban *bool `protobuf:"varint,4,opt,name=ban" json:"ban,omitempty"` + // True if the user shall be banned by certificate. + BanCertificate *bool `protobuf:"varint,5,opt,name=ban_certificate,json=banCertificate" json:"ban_certificate,omitempty"` + // True if the user shall be banned by IP. + BanIp *bool `protobuf:"varint,6,opt,name=ban_ip,json=banIp" json:"ban_ip,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } -func (m *UserRemove) Reset() { *m = UserRemove{} } -func (m *UserRemove) String() string { return proto.CompactTextString(m) } -func (*UserRemove) ProtoMessage() {} -func (*UserRemove) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{8} } +func (x *UserRemove) Reset() { + *x = UserRemove{} + mi := &file_Mumble_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} -func (m *UserRemove) GetSession() uint32 { - if m != nil && m.Session != nil { - return *m.Session +func (x *UserRemove) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UserRemove) ProtoMessage() {} + +func (x *UserRemove) ProtoReflect() protoreflect.Message { + mi := &file_Mumble_proto_msgTypes[8] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UserRemove.ProtoReflect.Descriptor instead. +func (*UserRemove) Descriptor() ([]byte, []int) { + return file_Mumble_proto_rawDescGZIP(), []int{8} +} + +func (x *UserRemove) GetSession() uint32 { + if x != nil && x.Session != nil { + return *x.Session } return 0 } -func (m *UserRemove) GetActor() uint32 { - if m != nil && m.Actor != nil { - return *m.Actor +func (x *UserRemove) GetActor() uint32 { + if x != nil && x.Actor != nil { + return *x.Actor } return 0 } -func (m *UserRemove) GetReason() string { - if m != nil && m.Reason != nil { - return *m.Reason +func (x *UserRemove) GetReason() string { + if x != nil && x.Reason != nil { + return *x.Reason } return "" } -func (m *UserRemove) GetBan() bool { - if m != nil && m.Ban != nil { - return *m.Ban +func (x *UserRemove) GetBan() bool { + if x != nil && x.Ban != nil { + return *x.Ban + } + return false +} + +func (x *UserRemove) GetBanCertificate() bool { + if x != nil && x.BanCertificate != nil { + return *x.BanCertificate + } + return false +} + +func (x *UserRemove) GetBanIp() bool { + if x != nil && x.BanIp != nil { + return *x.BanIp } return false } @@ -769,6 +1147,7 @@ func (m *UserRemove) GetBan() bool { // First seen during login procedure. May be sent by the client when it wishes // to alter its state. type UserState struct { + state protoimpl.MessageState `protogen:"open.v1"` // Unique user session ID of the user whose state this is, may change on // reconnect. Session *uint32 `protobuf:"varint,1,opt,name=session" json:"session,omitempty"` @@ -797,7 +1176,7 @@ type UserState struct { // Positional audio information is only sent to users who share // identical plugin contexts. // - // This value is not trasmitted to clients. + // This value is not transmitted to clients. PluginContext []byte `protobuf:"bytes,12,opt,name=plugin_context,json=pluginContext" json:"plugin_context,omitempty"` // The user's plugin-specific identity. // This value is not transmitted to clients. @@ -813,255 +1192,276 @@ type UserState struct { // True if the user is a priority speaker. PrioritySpeaker *bool `protobuf:"varint,18,opt,name=priority_speaker,json=prioritySpeaker" json:"priority_speaker,omitempty"` // True if the user is currently recording. - Recording *bool `protobuf:"varint,19,opt,name=recording" json:"recording,omitempty"` - XXX_unrecognized []byte `json:"-"` + Recording *bool `protobuf:"varint,19,opt,name=recording" json:"recording,omitempty"` + // A list of temporary access tokens to be respected when processing this request. + TemporaryAccessTokens []string `protobuf:"bytes,20,rep,name=temporary_access_tokens,json=temporaryAccessTokens" json:"temporary_access_tokens,omitempty"` + // A list of channels the user wants to start listening to. + ListeningChannelAdd []uint32 `protobuf:"varint,21,rep,name=listening_channel_add,json=listeningChannelAdd" json:"listening_channel_add,omitempty"` + // a list of channels the user does no longer want to listen to. + ListeningChannelRemove []uint32 `protobuf:"varint,22,rep,name=listening_channel_remove,json=listeningChannelRemove" json:"listening_channel_remove,omitempty"` + // A list of volume adjustments the user has applied to listeners + ListeningVolumeAdjustment []*UserState_VolumeAdjustment `protobuf:"bytes,23,rep,name=listening_volume_adjustment,json=listeningVolumeAdjustment" json:"listening_volume_adjustment,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } -func (m *UserState) Reset() { *m = UserState{} } -func (m *UserState) String() string { return proto.CompactTextString(m) } -func (*UserState) ProtoMessage() {} -func (*UserState) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{9} } +func (x *UserState) Reset() { + *x = UserState{} + mi := &file_Mumble_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} -func (m *UserState) GetSession() uint32 { - if m != nil && m.Session != nil { - return *m.Session +func (x *UserState) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UserState) ProtoMessage() {} + +func (x *UserState) ProtoReflect() protoreflect.Message { + mi := &file_Mumble_proto_msgTypes[9] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UserState.ProtoReflect.Descriptor instead. +func (*UserState) Descriptor() ([]byte, []int) { + return file_Mumble_proto_rawDescGZIP(), []int{9} +} + +func (x *UserState) GetSession() uint32 { + if x != nil && x.Session != nil { + return *x.Session } return 0 } -func (m *UserState) GetActor() uint32 { - if m != nil && m.Actor != nil { - return *m.Actor +func (x *UserState) GetActor() uint32 { + if x != nil && x.Actor != nil { + return *x.Actor } return 0 } -func (m *UserState) GetName() string { - if m != nil && m.Name != nil { - return *m.Name +func (x *UserState) GetName() string { + if x != nil && x.Name != nil { + return *x.Name } return "" } -func (m *UserState) GetUserId() uint32 { - if m != nil && m.UserId != nil { - return *m.UserId +func (x *UserState) GetUserId() uint32 { + if x != nil && x.UserId != nil { + return *x.UserId } return 0 } -func (m *UserState) GetChannelId() uint32 { - if m != nil && m.ChannelId != nil { - return *m.ChannelId +func (x *UserState) GetChannelId() uint32 { + if x != nil && x.ChannelId != nil { + return *x.ChannelId } return 0 } -func (m *UserState) GetMute() bool { - if m != nil && m.Mute != nil { - return *m.Mute +func (x *UserState) GetMute() bool { + if x != nil && x.Mute != nil { + return *x.Mute } return false } -func (m *UserState) GetDeaf() bool { - if m != nil && m.Deaf != nil { - return *m.Deaf +func (x *UserState) GetDeaf() bool { + if x != nil && x.Deaf != nil { + return *x.Deaf } return false } -func (m *UserState) GetSuppress() bool { - if m != nil && m.Suppress != nil { - return *m.Suppress +func (x *UserState) GetSuppress() bool { + if x != nil && x.Suppress != nil { + return *x.Suppress } return false } -func (m *UserState) GetSelfMute() bool { - if m != nil && m.SelfMute != nil { - return *m.SelfMute +func (x *UserState) GetSelfMute() bool { + if x != nil && x.SelfMute != nil { + return *x.SelfMute } return false } -func (m *UserState) GetSelfDeaf() bool { - if m != nil && m.SelfDeaf != nil { - return *m.SelfDeaf +func (x *UserState) GetSelfDeaf() bool { + if x != nil && x.SelfDeaf != nil { + return *x.SelfDeaf } return false } -func (m *UserState) GetTexture() []byte { - if m != nil { - return m.Texture +func (x *UserState) GetTexture() []byte { + if x != nil { + return x.Texture } return nil } -func (m *UserState) GetPluginContext() []byte { - if m != nil { - return m.PluginContext +func (x *UserState) GetPluginContext() []byte { + if x != nil { + return x.PluginContext } return nil } -func (m *UserState) GetPluginIdentity() string { - if m != nil && m.PluginIdentity != nil { - return *m.PluginIdentity +func (x *UserState) GetPluginIdentity() string { + if x != nil && x.PluginIdentity != nil { + return *x.PluginIdentity } return "" } -func (m *UserState) GetComment() string { - if m != nil && m.Comment != nil { - return *m.Comment +func (x *UserState) GetComment() string { + if x != nil && x.Comment != nil { + return *x.Comment } return "" } -func (m *UserState) GetHash() string { - if m != nil && m.Hash != nil { - return *m.Hash +func (x *UserState) GetHash() string { + if x != nil && x.Hash != nil { + return *x.Hash } return "" } -func (m *UserState) GetCommentHash() []byte { - if m != nil { - return m.CommentHash +func (x *UserState) GetCommentHash() []byte { + if x != nil { + return x.CommentHash } return nil } -func (m *UserState) GetTextureHash() []byte { - if m != nil { - return m.TextureHash +func (x *UserState) GetTextureHash() []byte { + if x != nil { + return x.TextureHash } return nil } -func (m *UserState) GetPrioritySpeaker() bool { - if m != nil && m.PrioritySpeaker != nil { - return *m.PrioritySpeaker +func (x *UserState) GetPrioritySpeaker() bool { + if x != nil && x.PrioritySpeaker != nil { + return *x.PrioritySpeaker } return false } -func (m *UserState) GetRecording() bool { - if m != nil && m.Recording != nil { - return *m.Recording +func (x *UserState) GetRecording() bool { + if x != nil && x.Recording != nil { + return *x.Recording } return false } +func (x *UserState) GetTemporaryAccessTokens() []string { + if x != nil { + return x.TemporaryAccessTokens + } + return nil +} + +func (x *UserState) GetListeningChannelAdd() []uint32 { + if x != nil { + return x.ListeningChannelAdd + } + return nil +} + +func (x *UserState) GetListeningChannelRemove() []uint32 { + if x != nil { + return x.ListeningChannelRemove + } + return nil +} + +func (x *UserState) GetListeningVolumeAdjustment() []*UserState_VolumeAdjustment { + if x != nil { + return x.ListeningVolumeAdjustment + } + return nil +} + // Relays information on the bans. The client may send the BanList message to // either modify the list of bans or query them from the server. The server // sends this list only after a client queries for it. type BanList struct { + state protoimpl.MessageState `protogen:"open.v1"` // List of ban entries currently in place. Bans []*BanList_BanEntry `protobuf:"bytes,1,rep,name=bans" json:"bans,omitempty"` // True if the server should return the list, false if it should replace old // ban list with the one provided. - Query *bool `protobuf:"varint,2,opt,name=query,def=0" json:"query,omitempty"` - XXX_unrecognized []byte `json:"-"` + Query *bool `protobuf:"varint,2,opt,name=query,def=0" json:"query,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } -func (m *BanList) Reset() { *m = BanList{} } -func (m *BanList) String() string { return proto.CompactTextString(m) } -func (*BanList) ProtoMessage() {} -func (*BanList) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{10} } +// Default values for BanList fields. +const ( + Default_BanList_Query = bool(false) +) -const Default_BanList_Query bool = false +func (x *BanList) Reset() { + *x = BanList{} + mi := &file_Mumble_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} -func (m *BanList) GetBans() []*BanList_BanEntry { - if m != nil { - return m.Bans +func (x *BanList) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*BanList) ProtoMessage() {} + +func (x *BanList) ProtoReflect() protoreflect.Message { + mi := &file_Mumble_proto_msgTypes[10] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use BanList.ProtoReflect.Descriptor instead. +func (*BanList) Descriptor() ([]byte, []int) { + return file_Mumble_proto_rawDescGZIP(), []int{10} +} + +func (x *BanList) GetBans() []*BanList_BanEntry { + if x != nil { + return x.Bans } return nil } -func (m *BanList) GetQuery() bool { - if m != nil && m.Query != nil { - return *m.Query +func (x *BanList) GetQuery() bool { + if x != nil && x.Query != nil { + return *x.Query } return Default_BanList_Query } -type BanList_BanEntry struct { - // Banned IP address. - Address []byte `protobuf:"bytes,1,req,name=address" json:"address,omitempty"` - // The length of the subnet mask for the ban. - Mask *uint32 `protobuf:"varint,2,req,name=mask" json:"mask,omitempty"` - // User name for identification purposes (does not affect the ban). - Name *string `protobuf:"bytes,3,opt,name=name" json:"name,omitempty"` - // The certificate hash of the banned user. - Hash *string `protobuf:"bytes,4,opt,name=hash" json:"hash,omitempty"` - // Reason for the ban (does not affect the ban). - Reason *string `protobuf:"bytes,5,opt,name=reason" json:"reason,omitempty"` - // Ban start time. - Start *string `protobuf:"bytes,6,opt,name=start" json:"start,omitempty"` - // Ban duration in seconds. - Duration *uint32 `protobuf:"varint,7,opt,name=duration" json:"duration,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *BanList_BanEntry) Reset() { *m = BanList_BanEntry{} } -func (m *BanList_BanEntry) String() string { return proto.CompactTextString(m) } -func (*BanList_BanEntry) ProtoMessage() {} -func (*BanList_BanEntry) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{10, 0} } - -func (m *BanList_BanEntry) GetAddress() []byte { - if m != nil { - return m.Address - } - return nil -} - -func (m *BanList_BanEntry) GetMask() uint32 { - if m != nil && m.Mask != nil { - return *m.Mask - } - return 0 -} - -func (m *BanList_BanEntry) GetName() string { - if m != nil && m.Name != nil { - return *m.Name - } - return "" -} - -func (m *BanList_BanEntry) GetHash() string { - if m != nil && m.Hash != nil { - return *m.Hash - } - return "" -} - -func (m *BanList_BanEntry) GetReason() string { - if m != nil && m.Reason != nil { - return *m.Reason - } - return "" -} - -func (m *BanList_BanEntry) GetStart() string { - if m != nil && m.Start != nil { - return *m.Start - } - return "" -} - -func (m *BanList_BanEntry) GetDuration() uint32 { - if m != nil && m.Duration != nil { - return *m.Duration - } - return 0 -} - // Used to send and broadcast text messages. type TextMessage struct { + state protoimpl.MessageState `protogen:"open.v1"` // The message sender, identified by its session. Actor *uint32 `protobuf:"varint,1,opt,name=actor" json:"actor,omitempty"` // Target users for the message, identified by their session. @@ -1073,51 +1473,78 @@ type TextMessage struct { // identified by their channel_ids. TreeId []uint32 `protobuf:"varint,4,rep,name=tree_id,json=treeId" json:"tree_id,omitempty"` // The UTF-8 encoded message. May be HTML if the server allows. - Message *string `protobuf:"bytes,5,req,name=message" json:"message,omitempty"` - XXX_unrecognized []byte `json:"-"` + Message *string `protobuf:"bytes,5,req,name=message" json:"message,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } -func (m *TextMessage) Reset() { *m = TextMessage{} } -func (m *TextMessage) String() string { return proto.CompactTextString(m) } -func (*TextMessage) ProtoMessage() {} -func (*TextMessage) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{11} } +func (x *TextMessage) Reset() { + *x = TextMessage{} + mi := &file_Mumble_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} -func (m *TextMessage) GetActor() uint32 { - if m != nil && m.Actor != nil { - return *m.Actor +func (x *TextMessage) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TextMessage) ProtoMessage() {} + +func (x *TextMessage) ProtoReflect() protoreflect.Message { + mi := &file_Mumble_proto_msgTypes[11] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use TextMessage.ProtoReflect.Descriptor instead. +func (*TextMessage) Descriptor() ([]byte, []int) { + return file_Mumble_proto_rawDescGZIP(), []int{11} +} + +func (x *TextMessage) GetActor() uint32 { + if x != nil && x.Actor != nil { + return *x.Actor } return 0 } -func (m *TextMessage) GetSession() []uint32 { - if m != nil { - return m.Session +func (x *TextMessage) GetSession() []uint32 { + if x != nil { + return x.Session } return nil } -func (m *TextMessage) GetChannelId() []uint32 { - if m != nil { - return m.ChannelId +func (x *TextMessage) GetChannelId() []uint32 { + if x != nil { + return x.ChannelId } return nil } -func (m *TextMessage) GetTreeId() []uint32 { - if m != nil { - return m.TreeId +func (x *TextMessage) GetTreeId() []uint32 { + if x != nil { + return x.TreeId } return nil } -func (m *TextMessage) GetMessage() string { - if m != nil && m.Message != nil { - return *m.Message +func (x *TextMessage) GetMessage() string { + if x != nil && x.Message != nil { + return *x.Message } return "" } type PermissionDenied struct { + state protoimpl.MessageState `protogen:"open.v1"` // The denied permission when type is Permission. Permission *uint32 `protobuf:"varint,1,opt,name=permission" json:"permission,omitempty"` // channel_id for the channel where the permission was denied when type is @@ -1130,58 +1557,85 @@ type PermissionDenied struct { // Type of the denial. Type *PermissionDenied_DenyType `protobuf:"varint,5,opt,name=type,enum=MumbleProto.PermissionDenied_DenyType" json:"type,omitempty"` // The name that is invalid when type is UserName. - Name *string `protobuf:"bytes,6,opt,name=name" json:"name,omitempty"` - XXX_unrecognized []byte `json:"-"` + Name *string `protobuf:"bytes,6,opt,name=name" json:"name,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } -func (m *PermissionDenied) Reset() { *m = PermissionDenied{} } -func (m *PermissionDenied) String() string { return proto.CompactTextString(m) } -func (*PermissionDenied) ProtoMessage() {} -func (*PermissionDenied) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{12} } +func (x *PermissionDenied) Reset() { + *x = PermissionDenied{} + mi := &file_Mumble_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} -func (m *PermissionDenied) GetPermission() uint32 { - if m != nil && m.Permission != nil { - return *m.Permission +func (x *PermissionDenied) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PermissionDenied) ProtoMessage() {} + +func (x *PermissionDenied) ProtoReflect() protoreflect.Message { + mi := &file_Mumble_proto_msgTypes[12] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PermissionDenied.ProtoReflect.Descriptor instead. +func (*PermissionDenied) Descriptor() ([]byte, []int) { + return file_Mumble_proto_rawDescGZIP(), []int{12} +} + +func (x *PermissionDenied) GetPermission() uint32 { + if x != nil && x.Permission != nil { + return *x.Permission } return 0 } -func (m *PermissionDenied) GetChannelId() uint32 { - if m != nil && m.ChannelId != nil { - return *m.ChannelId +func (x *PermissionDenied) GetChannelId() uint32 { + if x != nil && x.ChannelId != nil { + return *x.ChannelId } return 0 } -func (m *PermissionDenied) GetSession() uint32 { - if m != nil && m.Session != nil { - return *m.Session +func (x *PermissionDenied) GetSession() uint32 { + if x != nil && x.Session != nil { + return *x.Session } return 0 } -func (m *PermissionDenied) GetReason() string { - if m != nil && m.Reason != nil { - return *m.Reason +func (x *PermissionDenied) GetReason() string { + if x != nil && x.Reason != nil { + return *x.Reason } return "" } -func (m *PermissionDenied) GetType() PermissionDenied_DenyType { - if m != nil && m.Type != nil { - return *m.Type +func (x *PermissionDenied) GetType() PermissionDenied_DenyType { + if x != nil && x.Type != nil { + return *x.Type } return PermissionDenied_Text } -func (m *PermissionDenied) GetName() string { - if m != nil && m.Name != nil { - return *m.Name +func (x *PermissionDenied) GetName() string { + if x != nil && x.Name != nil { + return *x.Name } return "" } type ACL struct { + state protoimpl.MessageState `protogen:"open.v1"` // Channel ID of the channel this message affects. ChannelId *uint32 `protobuf:"varint,1,req,name=channel_id,json=channelId" json:"channel_id,omitempty"` // True if the channel inherits its parent's ACLs. @@ -1191,232 +1645,135 @@ type ACL struct { // ACL specifications. Acls []*ACL_ChanACL `protobuf:"bytes,4,rep,name=acls" json:"acls,omitempty"` // True if the message is a query for ACLs instead of setting them. - Query *bool `protobuf:"varint,5,opt,name=query,def=0" json:"query,omitempty"` - XXX_unrecognized []byte `json:"-"` + Query *bool `protobuf:"varint,5,opt,name=query,def=0" json:"query,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } -func (m *ACL) Reset() { *m = ACL{} } -func (m *ACL) String() string { return proto.CompactTextString(m) } -func (*ACL) ProtoMessage() {} -func (*ACL) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{13} } +// Default values for ACL fields. +const ( + Default_ACL_InheritAcls = bool(true) + Default_ACL_Query = bool(false) +) -const Default_ACL_InheritAcls bool = true -const Default_ACL_Query bool = false +func (x *ACL) Reset() { + *x = ACL{} + mi := &file_Mumble_proto_msgTypes[13] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} -func (m *ACL) GetChannelId() uint32 { - if m != nil && m.ChannelId != nil { - return *m.ChannelId +func (x *ACL) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ACL) ProtoMessage() {} + +func (x *ACL) ProtoReflect() protoreflect.Message { + mi := &file_Mumble_proto_msgTypes[13] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ACL.ProtoReflect.Descriptor instead. +func (*ACL) Descriptor() ([]byte, []int) { + return file_Mumble_proto_rawDescGZIP(), []int{13} +} + +func (x *ACL) GetChannelId() uint32 { + if x != nil && x.ChannelId != nil { + return *x.ChannelId } return 0 } -func (m *ACL) GetInheritAcls() bool { - if m != nil && m.InheritAcls != nil { - return *m.InheritAcls +func (x *ACL) GetInheritAcls() bool { + if x != nil && x.InheritAcls != nil { + return *x.InheritAcls } return Default_ACL_InheritAcls } -func (m *ACL) GetGroups() []*ACL_ChanGroup { - if m != nil { - return m.Groups +func (x *ACL) GetGroups() []*ACL_ChanGroup { + if x != nil { + return x.Groups } return nil } -func (m *ACL) GetAcls() []*ACL_ChanACL { - if m != nil { - return m.Acls +func (x *ACL) GetAcls() []*ACL_ChanACL { + if x != nil { + return x.Acls } return nil } -func (m *ACL) GetQuery() bool { - if m != nil && m.Query != nil { - return *m.Query +func (x *ACL) GetQuery() bool { + if x != nil && x.Query != nil { + return *x.Query } return Default_ACL_Query } -type ACL_ChanGroup struct { - // Name of the channel group, UTF-8 encoded. - Name *string `protobuf:"bytes,1,req,name=name" json:"name,omitempty"` - // True if the group has been inherited from the parent (Read only). - Inherited *bool `protobuf:"varint,2,opt,name=inherited,def=1" json:"inherited,omitempty"` - // True if the group members are inherited. - Inherit *bool `protobuf:"varint,3,opt,name=inherit,def=1" json:"inherit,omitempty"` - // True if the group can be inherited by sub channels. - Inheritable *bool `protobuf:"varint,4,opt,name=inheritable,def=1" json:"inheritable,omitempty"` - // Users explicitly included in this group, identified by user_id. - Add []uint32 `protobuf:"varint,5,rep,name=add" json:"add,omitempty"` - // Users explicitly removed from this group in this channel if the group - // has been inherited, identified by user_id. - Remove []uint32 `protobuf:"varint,6,rep,name=remove" json:"remove,omitempty"` - // Users inherited, identified by user_id. - InheritedMembers []uint32 `protobuf:"varint,7,rep,name=inherited_members,json=inheritedMembers" json:"inherited_members,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *ACL_ChanGroup) Reset() { *m = ACL_ChanGroup{} } -func (m *ACL_ChanGroup) String() string { return proto.CompactTextString(m) } -func (*ACL_ChanGroup) ProtoMessage() {} -func (*ACL_ChanGroup) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{13, 0} } - -const Default_ACL_ChanGroup_Inherited bool = true -const Default_ACL_ChanGroup_Inherit bool = true -const Default_ACL_ChanGroup_Inheritable bool = true - -func (m *ACL_ChanGroup) GetName() string { - if m != nil && m.Name != nil { - return *m.Name - } - return "" -} - -func (m *ACL_ChanGroup) GetInherited() bool { - if m != nil && m.Inherited != nil { - return *m.Inherited - } - return Default_ACL_ChanGroup_Inherited -} - -func (m *ACL_ChanGroup) GetInherit() bool { - if m != nil && m.Inherit != nil { - return *m.Inherit - } - return Default_ACL_ChanGroup_Inherit -} - -func (m *ACL_ChanGroup) GetInheritable() bool { - if m != nil && m.Inheritable != nil { - return *m.Inheritable - } - return Default_ACL_ChanGroup_Inheritable -} - -func (m *ACL_ChanGroup) GetAdd() []uint32 { - if m != nil { - return m.Add - } - return nil -} - -func (m *ACL_ChanGroup) GetRemove() []uint32 { - if m != nil { - return m.Remove - } - return nil -} - -func (m *ACL_ChanGroup) GetInheritedMembers() []uint32 { - if m != nil { - return m.InheritedMembers - } - return nil -} - -type ACL_ChanACL struct { - // True if this ACL applies to the current channel. - ApplyHere *bool `protobuf:"varint,1,opt,name=apply_here,json=applyHere,def=1" json:"apply_here,omitempty"` - // True if this ACL applies to the sub channels. - ApplySubs *bool `protobuf:"varint,2,opt,name=apply_subs,json=applySubs,def=1" json:"apply_subs,omitempty"` - // True if the ACL has been inherited from the parent. - Inherited *bool `protobuf:"varint,3,opt,name=inherited,def=1" json:"inherited,omitempty"` - // ID of the user that is affected by this ACL. - UserId *uint32 `protobuf:"varint,4,opt,name=user_id,json=userId" json:"user_id,omitempty"` - // ID of the group that is affected by this ACL. - Group *string `protobuf:"bytes,5,opt,name=group" json:"group,omitempty"` - // Bit flag field of the permissions granted by this ACL. - Grant *uint32 `protobuf:"varint,6,opt,name=grant" json:"grant,omitempty"` - // Bit flag field of the permissions denied by this ACL. - Deny *uint32 `protobuf:"varint,7,opt,name=deny" json:"deny,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *ACL_ChanACL) Reset() { *m = ACL_ChanACL{} } -func (m *ACL_ChanACL) String() string { return proto.CompactTextString(m) } -func (*ACL_ChanACL) ProtoMessage() {} -func (*ACL_ChanACL) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{13, 1} } - -const Default_ACL_ChanACL_ApplyHere bool = true -const Default_ACL_ChanACL_ApplySubs bool = true -const Default_ACL_ChanACL_Inherited bool = true - -func (m *ACL_ChanACL) GetApplyHere() bool { - if m != nil && m.ApplyHere != nil { - return *m.ApplyHere - } - return Default_ACL_ChanACL_ApplyHere -} - -func (m *ACL_ChanACL) GetApplySubs() bool { - if m != nil && m.ApplySubs != nil { - return *m.ApplySubs - } - return Default_ACL_ChanACL_ApplySubs -} - -func (m *ACL_ChanACL) GetInherited() bool { - if m != nil && m.Inherited != nil { - return *m.Inherited - } - return Default_ACL_ChanACL_Inherited -} - -func (m *ACL_ChanACL) GetUserId() uint32 { - if m != nil && m.UserId != nil { - return *m.UserId - } - return 0 -} - -func (m *ACL_ChanACL) GetGroup() string { - if m != nil && m.Group != nil { - return *m.Group - } - return "" -} - -func (m *ACL_ChanACL) GetGrant() uint32 { - if m != nil && m.Grant != nil { - return *m.Grant - } - return 0 -} - -func (m *ACL_ChanACL) GetDeny() uint32 { - if m != nil && m.Deny != nil { - return *m.Deny - } - return 0 -} - // Client may use this message to refresh its registered user information. The // client should fill the IDs or Names of the users it wants to refresh. The // server fills the missing parts and sends the message back. type QueryUsers struct { + state protoimpl.MessageState `protogen:"open.v1"` // user_ids. Ids []uint32 `protobuf:"varint,1,rep,name=ids" json:"ids,omitempty"` // User names in the same order as ids. - Names []string `protobuf:"bytes,2,rep,name=names" json:"names,omitempty"` - XXX_unrecognized []byte `json:"-"` + Names []string `protobuf:"bytes,2,rep,name=names" json:"names,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } -func (m *QueryUsers) Reset() { *m = QueryUsers{} } -func (m *QueryUsers) String() string { return proto.CompactTextString(m) } -func (*QueryUsers) ProtoMessage() {} -func (*QueryUsers) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{14} } +func (x *QueryUsers) Reset() { + *x = QueryUsers{} + mi := &file_Mumble_proto_msgTypes[14] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} -func (m *QueryUsers) GetIds() []uint32 { - if m != nil { - return m.Ids +func (x *QueryUsers) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryUsers) ProtoMessage() {} + +func (x *QueryUsers) ProtoReflect() protoreflect.Message { + mi := &file_Mumble_proto_msgTypes[14] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use QueryUsers.ProtoReflect.Descriptor instead. +func (*QueryUsers) Descriptor() ([]byte, []int) { + return file_Mumble_proto_rawDescGZIP(), []int{14} +} + +func (x *QueryUsers) GetIds() []uint32 { + if x != nil { + return x.Ids } return nil } -func (m *QueryUsers) GetNames() []string { - if m != nil { - return m.Names +func (x *QueryUsers) GetNames() []string { + if x != nil { + return x.Names } return nil } @@ -1426,311 +1783,382 @@ func (m *QueryUsers) GetNames() []string { // performed by sending the message with only the client or server nonce // filled. type CryptSetup struct { + state protoimpl.MessageState `protogen:"open.v1"` // Encryption key. Key []byte `protobuf:"bytes,1,opt,name=key" json:"key,omitempty"` // Client nonce. ClientNonce []byte `protobuf:"bytes,2,opt,name=client_nonce,json=clientNonce" json:"client_nonce,omitempty"` // Server nonce. - ServerNonce []byte `protobuf:"bytes,3,opt,name=server_nonce,json=serverNonce" json:"server_nonce,omitempty"` - XXX_unrecognized []byte `json:"-"` + ServerNonce []byte `protobuf:"bytes,3,opt,name=server_nonce,json=serverNonce" json:"server_nonce,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } -func (m *CryptSetup) Reset() { *m = CryptSetup{} } -func (m *CryptSetup) String() string { return proto.CompactTextString(m) } -func (*CryptSetup) ProtoMessage() {} -func (*CryptSetup) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{15} } +func (x *CryptSetup) Reset() { + *x = CryptSetup{} + mi := &file_Mumble_proto_msgTypes[15] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} -func (m *CryptSetup) GetKey() []byte { - if m != nil { - return m.Key +func (x *CryptSetup) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CryptSetup) ProtoMessage() {} + +func (x *CryptSetup) ProtoReflect() protoreflect.Message { + mi := &file_Mumble_proto_msgTypes[15] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CryptSetup.ProtoReflect.Descriptor instead. +func (*CryptSetup) Descriptor() ([]byte, []int) { + return file_Mumble_proto_rawDescGZIP(), []int{15} +} + +func (x *CryptSetup) GetKey() []byte { + if x != nil { + return x.Key } return nil } -func (m *CryptSetup) GetClientNonce() []byte { - if m != nil { - return m.ClientNonce +func (x *CryptSetup) GetClientNonce() []byte { + if x != nil { + return x.ClientNonce } return nil } -func (m *CryptSetup) GetServerNonce() []byte { - if m != nil { - return m.ServerNonce +func (x *CryptSetup) GetServerNonce() []byte { + if x != nil { + return x.ServerNonce } return nil } +// Used to add or remove custom context menu item on client-side. type ContextActionModify struct { - // The action name. + state protoimpl.MessageState `protogen:"open.v1"` + // The action identifier. Used later to initiate an action. Action *string `protobuf:"bytes,1,req,name=action" json:"action,omitempty"` // The display name of the action. Text *string `protobuf:"bytes,2,opt,name=text" json:"text,omitempty"` // Context bit flags defining where the action should be displayed. - Context *uint32 `protobuf:"varint,3,opt,name=context" json:"context,omitempty"` - Operation *ContextActionModify_Operation `protobuf:"varint,4,opt,name=operation,enum=MumbleProto.ContextActionModify_Operation" json:"operation,omitempty"` - XXX_unrecognized []byte `json:"-"` + // Flags can be OR-ed to combine different types. + Context *uint32 `protobuf:"varint,3,opt,name=context" json:"context,omitempty"` + // Choose either to add or to remove the context action. + // Note: This field only exists after Mumble 1.2.4-beta1 release. + // + // The message will be recognized as Add regardless of this field + // before said release. + Operation *ContextActionModify_Operation `protobuf:"varint,4,opt,name=operation,enum=MumbleProto.ContextActionModify_Operation" json:"operation,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } -func (m *ContextActionModify) Reset() { *m = ContextActionModify{} } -func (m *ContextActionModify) String() string { return proto.CompactTextString(m) } -func (*ContextActionModify) ProtoMessage() {} -func (*ContextActionModify) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{16} } +func (x *ContextActionModify) Reset() { + *x = ContextActionModify{} + mi := &file_Mumble_proto_msgTypes[16] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} -func (m *ContextActionModify) GetAction() string { - if m != nil && m.Action != nil { - return *m.Action +func (x *ContextActionModify) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ContextActionModify) ProtoMessage() {} + +func (x *ContextActionModify) ProtoReflect() protoreflect.Message { + mi := &file_Mumble_proto_msgTypes[16] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ContextActionModify.ProtoReflect.Descriptor instead. +func (*ContextActionModify) Descriptor() ([]byte, []int) { + return file_Mumble_proto_rawDescGZIP(), []int{16} +} + +func (x *ContextActionModify) GetAction() string { + if x != nil && x.Action != nil { + return *x.Action } return "" } -func (m *ContextActionModify) GetText() string { - if m != nil && m.Text != nil { - return *m.Text +func (x *ContextActionModify) GetText() string { + if x != nil && x.Text != nil { + return *x.Text } return "" } -func (m *ContextActionModify) GetContext() uint32 { - if m != nil && m.Context != nil { - return *m.Context +func (x *ContextActionModify) GetContext() uint32 { + if x != nil && x.Context != nil { + return *x.Context } return 0 } -func (m *ContextActionModify) GetOperation() ContextActionModify_Operation { - if m != nil && m.Operation != nil { - return *m.Operation +func (x *ContextActionModify) GetOperation() ContextActionModify_Operation { + if x != nil && x.Operation != nil { + return *x.Operation } return ContextActionModify_Add } // Sent by the client when it wants to initiate a Context action. type ContextAction struct { + state protoimpl.MessageState `protogen:"open.v1"` // The target User for the action, identified by session. Session *uint32 `protobuf:"varint,1,opt,name=session" json:"session,omitempty"` // The target Channel for the action, identified by channel_id. ChannelId *uint32 `protobuf:"varint,2,opt,name=channel_id,json=channelId" json:"channel_id,omitempty"` // The action that should be executed. - Action *string `protobuf:"bytes,3,req,name=action" json:"action,omitempty"` - XXX_unrecognized []byte `json:"-"` + Action *string `protobuf:"bytes,3,req,name=action" json:"action,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } -func (m *ContextAction) Reset() { *m = ContextAction{} } -func (m *ContextAction) String() string { return proto.CompactTextString(m) } -func (*ContextAction) ProtoMessage() {} -func (*ContextAction) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{17} } +func (x *ContextAction) Reset() { + *x = ContextAction{} + mi := &file_Mumble_proto_msgTypes[17] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} -func (m *ContextAction) GetSession() uint32 { - if m != nil && m.Session != nil { - return *m.Session +func (x *ContextAction) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ContextAction) ProtoMessage() {} + +func (x *ContextAction) ProtoReflect() protoreflect.Message { + mi := &file_Mumble_proto_msgTypes[17] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ContextAction.ProtoReflect.Descriptor instead. +func (*ContextAction) Descriptor() ([]byte, []int) { + return file_Mumble_proto_rawDescGZIP(), []int{17} +} + +func (x *ContextAction) GetSession() uint32 { + if x != nil && x.Session != nil { + return *x.Session } return 0 } -func (m *ContextAction) GetChannelId() uint32 { - if m != nil && m.ChannelId != nil { - return *m.ChannelId +func (x *ContextAction) GetChannelId() uint32 { + if x != nil && x.ChannelId != nil { + return *x.ChannelId } return 0 } -func (m *ContextAction) GetAction() string { - if m != nil && m.Action != nil { - return *m.Action +func (x *ContextAction) GetAction() string { + if x != nil && x.Action != nil { + return *x.Action } return "" } // Lists the registered users. type UserList struct { + state protoimpl.MessageState `protogen:"open.v1"` // A list of registered users. - Users []*UserList_User `protobuf:"bytes,1,rep,name=users" json:"users,omitempty"` - XXX_unrecognized []byte `json:"-"` + Users []*UserList_User `protobuf:"bytes,1,rep,name=users" json:"users,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } -func (m *UserList) Reset() { *m = UserList{} } -func (m *UserList) String() string { return proto.CompactTextString(m) } -func (*UserList) ProtoMessage() {} -func (*UserList) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{18} } +func (x *UserList) Reset() { + *x = UserList{} + mi := &file_Mumble_proto_msgTypes[18] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} -func (m *UserList) GetUsers() []*UserList_User { - if m != nil { - return m.Users +func (x *UserList) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UserList) ProtoMessage() {} + +func (x *UserList) ProtoReflect() protoreflect.Message { + mi := &file_Mumble_proto_msgTypes[18] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UserList.ProtoReflect.Descriptor instead. +func (*UserList) Descriptor() ([]byte, []int) { + return file_Mumble_proto_rawDescGZIP(), []int{18} +} + +func (x *UserList) GetUsers() []*UserList_User { + if x != nil { + return x.Users } return nil } -type UserList_User struct { - // Registered user ID. - UserId *uint32 `protobuf:"varint,1,req,name=user_id,json=userId" json:"user_id,omitempty"` - // Registered user name. - Name *string `protobuf:"bytes,2,opt,name=name" json:"name,omitempty"` - LastSeen *string `protobuf:"bytes,3,opt,name=last_seen,json=lastSeen" json:"last_seen,omitempty"` - LastChannel *uint32 `protobuf:"varint,4,opt,name=last_channel,json=lastChannel" json:"last_channel,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *UserList_User) Reset() { *m = UserList_User{} } -func (m *UserList_User) String() string { return proto.CompactTextString(m) } -func (*UserList_User) ProtoMessage() {} -func (*UserList_User) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{18, 0} } - -func (m *UserList_User) GetUserId() uint32 { - if m != nil && m.UserId != nil { - return *m.UserId - } - return 0 -} - -func (m *UserList_User) GetName() string { - if m != nil && m.Name != nil { - return *m.Name - } - return "" -} - -func (m *UserList_User) GetLastSeen() string { - if m != nil && m.LastSeen != nil { - return *m.LastSeen - } - return "" -} - -func (m *UserList_User) GetLastChannel() uint32 { - if m != nil && m.LastChannel != nil { - return *m.LastChannel - } - return 0 -} - // Sent by the client when it wants to register or clear whisper targets. // // Note: The first available target ID is 1 as 0 is reserved for normal // talking. Maximum target ID is 30. type VoiceTarget struct { + state protoimpl.MessageState `protogen:"open.v1"` // Voice target ID. Id *uint32 `protobuf:"varint,1,opt,name=id" json:"id,omitempty"` // The receivers that this voice target includes. - Targets []*VoiceTarget_Target `protobuf:"bytes,2,rep,name=targets" json:"targets,omitempty"` - XXX_unrecognized []byte `json:"-"` + Targets []*VoiceTarget_Target `protobuf:"bytes,2,rep,name=targets" json:"targets,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } -func (m *VoiceTarget) Reset() { *m = VoiceTarget{} } -func (m *VoiceTarget) String() string { return proto.CompactTextString(m) } -func (*VoiceTarget) ProtoMessage() {} -func (*VoiceTarget) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{19} } +func (x *VoiceTarget) Reset() { + *x = VoiceTarget{} + mi := &file_Mumble_proto_msgTypes[19] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} -func (m *VoiceTarget) GetId() uint32 { - if m != nil && m.Id != nil { - return *m.Id +func (x *VoiceTarget) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*VoiceTarget) ProtoMessage() {} + +func (x *VoiceTarget) ProtoReflect() protoreflect.Message { + mi := &file_Mumble_proto_msgTypes[19] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use VoiceTarget.ProtoReflect.Descriptor instead. +func (*VoiceTarget) Descriptor() ([]byte, []int) { + return file_Mumble_proto_rawDescGZIP(), []int{19} +} + +func (x *VoiceTarget) GetId() uint32 { + if x != nil && x.Id != nil { + return *x.Id } return 0 } -func (m *VoiceTarget) GetTargets() []*VoiceTarget_Target { - if m != nil { - return m.Targets +func (x *VoiceTarget) GetTargets() []*VoiceTarget_Target { + if x != nil { + return x.Targets } return nil } -type VoiceTarget_Target struct { - // Users that are included as targets. - Session []uint32 `protobuf:"varint,1,rep,name=session" json:"session,omitempty"` - // Channel that is included as a target. - ChannelId *uint32 `protobuf:"varint,2,opt,name=channel_id,json=channelId" json:"channel_id,omitempty"` - // ACL group that is included as a target. - Group *string `protobuf:"bytes,3,opt,name=group" json:"group,omitempty"` - // True if the voice should follow links from the specified channel. - Links *bool `protobuf:"varint,4,opt,name=links,def=0" json:"links,omitempty"` - // True if the voice should also be sent to children of the specific - // channel. - Children *bool `protobuf:"varint,5,opt,name=children,def=0" json:"children,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *VoiceTarget_Target) Reset() { *m = VoiceTarget_Target{} } -func (m *VoiceTarget_Target) String() string { return proto.CompactTextString(m) } -func (*VoiceTarget_Target) ProtoMessage() {} -func (*VoiceTarget_Target) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{19, 0} } - -const Default_VoiceTarget_Target_Links bool = false -const Default_VoiceTarget_Target_Children bool = false - -func (m *VoiceTarget_Target) GetSession() []uint32 { - if m != nil { - return m.Session - } - return nil -} - -func (m *VoiceTarget_Target) GetChannelId() uint32 { - if m != nil && m.ChannelId != nil { - return *m.ChannelId - } - return 0 -} - -func (m *VoiceTarget_Target) GetGroup() string { - if m != nil && m.Group != nil { - return *m.Group - } - return "" -} - -func (m *VoiceTarget_Target) GetLinks() bool { - if m != nil && m.Links != nil { - return *m.Links - } - return Default_VoiceTarget_Target_Links -} - -func (m *VoiceTarget_Target) GetChildren() bool { - if m != nil && m.Children != nil { - return *m.Children - } - return Default_VoiceTarget_Target_Children -} - // Sent by the client when it wants permissions for a certain channel. Sent by // the server when it replies to the query or wants the user to resync all // channel permissions. type PermissionQuery struct { + state protoimpl.MessageState `protogen:"open.v1"` // channel_id of the channel for which the permissions are queried. ChannelId *uint32 `protobuf:"varint,1,opt,name=channel_id,json=channelId" json:"channel_id,omitempty"` // Channel permissions. Permissions *uint32 `protobuf:"varint,2,opt,name=permissions" json:"permissions,omitempty"` // True if the client should drop its current permission information for all // channels. - Flush *bool `protobuf:"varint,3,opt,name=flush,def=0" json:"flush,omitempty"` - XXX_unrecognized []byte `json:"-"` + Flush *bool `protobuf:"varint,3,opt,name=flush,def=0" json:"flush,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } -func (m *PermissionQuery) Reset() { *m = PermissionQuery{} } -func (m *PermissionQuery) String() string { return proto.CompactTextString(m) } -func (*PermissionQuery) ProtoMessage() {} -func (*PermissionQuery) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{20} } +// Default values for PermissionQuery fields. +const ( + Default_PermissionQuery_Flush = bool(false) +) -const Default_PermissionQuery_Flush bool = false +func (x *PermissionQuery) Reset() { + *x = PermissionQuery{} + mi := &file_Mumble_proto_msgTypes[20] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} -func (m *PermissionQuery) GetChannelId() uint32 { - if m != nil && m.ChannelId != nil { - return *m.ChannelId +func (x *PermissionQuery) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PermissionQuery) ProtoMessage() {} + +func (x *PermissionQuery) ProtoReflect() protoreflect.Message { + mi := &file_Mumble_proto_msgTypes[20] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PermissionQuery.ProtoReflect.Descriptor instead. +func (*PermissionQuery) Descriptor() ([]byte, []int) { + return file_Mumble_proto_rawDescGZIP(), []int{20} +} + +func (x *PermissionQuery) GetChannelId() uint32 { + if x != nil && x.ChannelId != nil { + return *x.ChannelId } return 0 } -func (m *PermissionQuery) GetPermissions() uint32 { - if m != nil && m.Permissions != nil { - return *m.Permissions +func (x *PermissionQuery) GetPermissions() uint32 { + if x != nil && x.Permissions != nil { + return *x.Permissions } return 0 } -func (m *PermissionQuery) GetFlush() bool { - if m != nil && m.Flush != nil { - return *m.Flush +func (x *PermissionQuery) GetFlush() bool { + if x != nil && x.Flush != nil { + return *x.Flush } return Default_PermissionQuery_Flush } @@ -1738,54 +2166,85 @@ func (m *PermissionQuery) GetFlush() bool { // Sent by the server to notify the users of the version of the CELT codec they // should use. This may change during the connection when new users join. type CodecVersion struct { + state protoimpl.MessageState `protogen:"open.v1"` // The version of the CELT Alpha codec. Alpha *int32 `protobuf:"varint,1,req,name=alpha" json:"alpha,omitempty"` // The version of the CELT Beta codec. Beta *int32 `protobuf:"varint,2,req,name=beta" json:"beta,omitempty"` // True if the user should prefer Alpha over Beta. - PreferAlpha *bool `protobuf:"varint,3,req,name=prefer_alpha,json=preferAlpha,def=1" json:"prefer_alpha,omitempty"` - Opus *bool `protobuf:"varint,4,opt,name=opus,def=0" json:"opus,omitempty"` - XXX_unrecognized []byte `json:"-"` + PreferAlpha *bool `protobuf:"varint,3,req,name=prefer_alpha,json=preferAlpha,def=1" json:"prefer_alpha,omitempty"` + Opus *bool `protobuf:"varint,4,opt,name=opus,def=0" json:"opus,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } -func (m *CodecVersion) Reset() { *m = CodecVersion{} } -func (m *CodecVersion) String() string { return proto.CompactTextString(m) } -func (*CodecVersion) ProtoMessage() {} -func (*CodecVersion) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{21} } +// Default values for CodecVersion fields. +const ( + Default_CodecVersion_PreferAlpha = bool(true) + Default_CodecVersion_Opus = bool(false) +) -const Default_CodecVersion_PreferAlpha bool = true -const Default_CodecVersion_Opus bool = false +func (x *CodecVersion) Reset() { + *x = CodecVersion{} + mi := &file_Mumble_proto_msgTypes[21] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} -func (m *CodecVersion) GetAlpha() int32 { - if m != nil && m.Alpha != nil { - return *m.Alpha +func (x *CodecVersion) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CodecVersion) ProtoMessage() {} + +func (x *CodecVersion) ProtoReflect() protoreflect.Message { + mi := &file_Mumble_proto_msgTypes[21] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CodecVersion.ProtoReflect.Descriptor instead. +func (*CodecVersion) Descriptor() ([]byte, []int) { + return file_Mumble_proto_rawDescGZIP(), []int{21} +} + +func (x *CodecVersion) GetAlpha() int32 { + if x != nil && x.Alpha != nil { + return *x.Alpha } return 0 } -func (m *CodecVersion) GetBeta() int32 { - if m != nil && m.Beta != nil { - return *m.Beta +func (x *CodecVersion) GetBeta() int32 { + if x != nil && x.Beta != nil { + return *x.Beta } return 0 } -func (m *CodecVersion) GetPreferAlpha() bool { - if m != nil && m.PreferAlpha != nil { - return *m.PreferAlpha +func (x *CodecVersion) GetPreferAlpha() bool { + if x != nil && x.PreferAlpha != nil { + return *x.PreferAlpha } return Default_CodecVersion_PreferAlpha } -func (m *CodecVersion) GetOpus() bool { - if m != nil && m.Opus != nil { - return *m.Opus +func (x *CodecVersion) GetOpus() bool { + if x != nil && x.Opus != nil { + return *x.Opus } return Default_CodecVersion_Opus } // Used to communicate user stats between the server and clients. type UserStats struct { + state protoimpl.MessageState `protogen:"open.v1"` // User whose stats these are. Session *uint32 `protobuf:"varint,1,opt,name=session" json:"session,omitempty"` // True if the message contains only mutable stats (packets, ping). @@ -1815,203 +2274,196 @@ type UserStats struct { CeltVersions []int32 `protobuf:"varint,13,rep,name=celt_versions,json=celtVersions" json:"celt_versions,omitempty"` // Client IP address. Address []byte `protobuf:"bytes,14,opt,name=address" json:"address,omitempty"` - // Bandwith used by this client. + // Bandwidth used by this client. Bandwidth *uint32 `protobuf:"varint,15,opt,name=bandwidth" json:"bandwidth,omitempty"` // Connection duration. Onlinesecs *uint32 `protobuf:"varint,16,opt,name=onlinesecs" json:"onlinesecs,omitempty"` // Duration since last activity. Idlesecs *uint32 `protobuf:"varint,17,opt,name=idlesecs" json:"idlesecs,omitempty"` // True if the user has a strong certificate. - StrongCertificate *bool `protobuf:"varint,18,opt,name=strong_certificate,json=strongCertificate,def=0" json:"strong_certificate,omitempty"` - Opus *bool `protobuf:"varint,19,opt,name=opus,def=0" json:"opus,omitempty"` - XXX_unrecognized []byte `json:"-"` + StrongCertificate *bool `protobuf:"varint,18,opt,name=strong_certificate,json=strongCertificate,def=0" json:"strong_certificate,omitempty"` + Opus *bool `protobuf:"varint,19,opt,name=opus,def=0" json:"opus,omitempty"` + // Rolling packet statistics + RollingStats *UserStats_RollingStats `protobuf:"bytes,20,opt,name=rolling_stats,json=rollingStats" json:"rolling_stats,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } -func (m *UserStats) Reset() { *m = UserStats{} } -func (m *UserStats) String() string { return proto.CompactTextString(m) } -func (*UserStats) ProtoMessage() {} -func (*UserStats) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{22} } +// Default values for UserStats fields. +const ( + Default_UserStats_StatsOnly = bool(false) + Default_UserStats_StrongCertificate = bool(false) + Default_UserStats_Opus = bool(false) +) -const Default_UserStats_StatsOnly bool = false -const Default_UserStats_StrongCertificate bool = false -const Default_UserStats_Opus bool = false +func (x *UserStats) Reset() { + *x = UserStats{} + mi := &file_Mumble_proto_msgTypes[22] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} -func (m *UserStats) GetSession() uint32 { - if m != nil && m.Session != nil { - return *m.Session +func (x *UserStats) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UserStats) ProtoMessage() {} + +func (x *UserStats) ProtoReflect() protoreflect.Message { + mi := &file_Mumble_proto_msgTypes[22] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UserStats.ProtoReflect.Descriptor instead. +func (*UserStats) Descriptor() ([]byte, []int) { + return file_Mumble_proto_rawDescGZIP(), []int{22} +} + +func (x *UserStats) GetSession() uint32 { + if x != nil && x.Session != nil { + return *x.Session } return 0 } -func (m *UserStats) GetStatsOnly() bool { - if m != nil && m.StatsOnly != nil { - return *m.StatsOnly +func (x *UserStats) GetStatsOnly() bool { + if x != nil && x.StatsOnly != nil { + return *x.StatsOnly } return Default_UserStats_StatsOnly } -func (m *UserStats) GetCertificates() [][]byte { - if m != nil { - return m.Certificates +func (x *UserStats) GetCertificates() [][]byte { + if x != nil { + return x.Certificates } return nil } -func (m *UserStats) GetFromClient() *UserStats_Stats { - if m != nil { - return m.FromClient +func (x *UserStats) GetFromClient() *UserStats_Stats { + if x != nil { + return x.FromClient } return nil } -func (m *UserStats) GetFromServer() *UserStats_Stats { - if m != nil { - return m.FromServer +func (x *UserStats) GetFromServer() *UserStats_Stats { + if x != nil { + return x.FromServer } return nil } -func (m *UserStats) GetUdpPackets() uint32 { - if m != nil && m.UdpPackets != nil { - return *m.UdpPackets +func (x *UserStats) GetUdpPackets() uint32 { + if x != nil && x.UdpPackets != nil { + return *x.UdpPackets } return 0 } -func (m *UserStats) GetTcpPackets() uint32 { - if m != nil && m.TcpPackets != nil { - return *m.TcpPackets +func (x *UserStats) GetTcpPackets() uint32 { + if x != nil && x.TcpPackets != nil { + return *x.TcpPackets } return 0 } -func (m *UserStats) GetUdpPingAvg() float32 { - if m != nil && m.UdpPingAvg != nil { - return *m.UdpPingAvg +func (x *UserStats) GetUdpPingAvg() float32 { + if x != nil && x.UdpPingAvg != nil { + return *x.UdpPingAvg } return 0 } -func (m *UserStats) GetUdpPingVar() float32 { - if m != nil && m.UdpPingVar != nil { - return *m.UdpPingVar +func (x *UserStats) GetUdpPingVar() float32 { + if x != nil && x.UdpPingVar != nil { + return *x.UdpPingVar } return 0 } -func (m *UserStats) GetTcpPingAvg() float32 { - if m != nil && m.TcpPingAvg != nil { - return *m.TcpPingAvg +func (x *UserStats) GetTcpPingAvg() float32 { + if x != nil && x.TcpPingAvg != nil { + return *x.TcpPingAvg } return 0 } -func (m *UserStats) GetTcpPingVar() float32 { - if m != nil && m.TcpPingVar != nil { - return *m.TcpPingVar +func (x *UserStats) GetTcpPingVar() float32 { + if x != nil && x.TcpPingVar != nil { + return *x.TcpPingVar } return 0 } -func (m *UserStats) GetVersion() *Version { - if m != nil { - return m.Version +func (x *UserStats) GetVersion() *Version { + if x != nil { + return x.Version } return nil } -func (m *UserStats) GetCeltVersions() []int32 { - if m != nil { - return m.CeltVersions +func (x *UserStats) GetCeltVersions() []int32 { + if x != nil { + return x.CeltVersions } return nil } -func (m *UserStats) GetAddress() []byte { - if m != nil { - return m.Address +func (x *UserStats) GetAddress() []byte { + if x != nil { + return x.Address } return nil } -func (m *UserStats) GetBandwidth() uint32 { - if m != nil && m.Bandwidth != nil { - return *m.Bandwidth +func (x *UserStats) GetBandwidth() uint32 { + if x != nil && x.Bandwidth != nil { + return *x.Bandwidth } return 0 } -func (m *UserStats) GetOnlinesecs() uint32 { - if m != nil && m.Onlinesecs != nil { - return *m.Onlinesecs +func (x *UserStats) GetOnlinesecs() uint32 { + if x != nil && x.Onlinesecs != nil { + return *x.Onlinesecs } return 0 } -func (m *UserStats) GetIdlesecs() uint32 { - if m != nil && m.Idlesecs != nil { - return *m.Idlesecs +func (x *UserStats) GetIdlesecs() uint32 { + if x != nil && x.Idlesecs != nil { + return *x.Idlesecs } return 0 } -func (m *UserStats) GetStrongCertificate() bool { - if m != nil && m.StrongCertificate != nil { - return *m.StrongCertificate +func (x *UserStats) GetStrongCertificate() bool { + if x != nil && x.StrongCertificate != nil { + return *x.StrongCertificate } return Default_UserStats_StrongCertificate } -func (m *UserStats) GetOpus() bool { - if m != nil && m.Opus != nil { - return *m.Opus +func (x *UserStats) GetOpus() bool { + if x != nil && x.Opus != nil { + return *x.Opus } return Default_UserStats_Opus } -type UserStats_Stats struct { - // The amount of good packets received. - Good *uint32 `protobuf:"varint,1,opt,name=good" json:"good,omitempty"` - // The amount of late packets received. - Late *uint32 `protobuf:"varint,2,opt,name=late" json:"late,omitempty"` - // The amount of packets never received. - Lost *uint32 `protobuf:"varint,3,opt,name=lost" json:"lost,omitempty"` - // The amount of nonce resyncs. - Resync *uint32 `protobuf:"varint,4,opt,name=resync" json:"resync,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *UserStats_Stats) Reset() { *m = UserStats_Stats{} } -func (m *UserStats_Stats) String() string { return proto.CompactTextString(m) } -func (*UserStats_Stats) ProtoMessage() {} -func (*UserStats_Stats) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{22, 0} } - -func (m *UserStats_Stats) GetGood() uint32 { - if m != nil && m.Good != nil { - return *m.Good +func (x *UserStats) GetRollingStats() *UserStats_RollingStats { + if x != nil { + return x.RollingStats } - return 0 -} - -func (m *UserStats_Stats) GetLate() uint32 { - if m != nil && m.Late != nil { - return *m.Late - } - return 0 -} - -func (m *UserStats_Stats) GetLost() uint32 { - if m != nil && m.Lost != nil { - return *m.Lost - } - return 0 -} - -func (m *UserStats_Stats) GetResync() uint32 { - if m != nil && m.Resync != nil { - return *m.Resync - } - return 0 + return nil } // Used by the client to request binary data from the server. By default large @@ -2023,37 +2475,64 @@ func (m *UserStats_Stats) GetResync() uint32 { // UserState/ChannelState message with the resources filled even if they would // normally be transmitted as hashes. type RequestBlob struct { + state protoimpl.MessageState `protogen:"open.v1"` // sessions of the requested UserState textures. SessionTexture []uint32 `protobuf:"varint,1,rep,name=session_texture,json=sessionTexture" json:"session_texture,omitempty"` // sessions of the requested UserState comments. SessionComment []uint32 `protobuf:"varint,2,rep,name=session_comment,json=sessionComment" json:"session_comment,omitempty"` // channel_ids of the requested ChannelState descriptions. ChannelDescription []uint32 `protobuf:"varint,3,rep,name=channel_description,json=channelDescription" json:"channel_description,omitempty"` - XXX_unrecognized []byte `json:"-"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } -func (m *RequestBlob) Reset() { *m = RequestBlob{} } -func (m *RequestBlob) String() string { return proto.CompactTextString(m) } -func (*RequestBlob) ProtoMessage() {} -func (*RequestBlob) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{23} } +func (x *RequestBlob) Reset() { + *x = RequestBlob{} + mi := &file_Mumble_proto_msgTypes[23] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} -func (m *RequestBlob) GetSessionTexture() []uint32 { - if m != nil { - return m.SessionTexture +func (x *RequestBlob) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RequestBlob) ProtoMessage() {} + +func (x *RequestBlob) ProtoReflect() protoreflect.Message { + mi := &file_Mumble_proto_msgTypes[23] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RequestBlob.ProtoReflect.Descriptor instead. +func (*RequestBlob) Descriptor() ([]byte, []int) { + return file_Mumble_proto_rawDescGZIP(), []int{23} +} + +func (x *RequestBlob) GetSessionTexture() []uint32 { + if x != nil { + return x.SessionTexture } return nil } -func (m *RequestBlob) GetSessionComment() []uint32 { - if m != nil { - return m.SessionComment +func (x *RequestBlob) GetSessionComment() []uint32 { + if x != nil { + return x.SessionComment } return nil } -func (m *RequestBlob) GetChannelDescription() []uint32 { - if m != nil { - return m.ChannelDescription +func (x *RequestBlob) GetChannelDescription() []uint32 { + if x != nil { + return x.ChannelDescription } return nil } @@ -2061,6 +2540,7 @@ func (m *RequestBlob) GetChannelDescription() []uint32 { // Sent by the server when it informs the clients on server configuration // details. type ServerConfig struct { + state protoimpl.MessageState `protogen:"open.v1"` // The maximum bandwidth the clients should use. MaxBandwidth *uint32 `protobuf:"varint,1,opt,name=max_bandwidth,json=maxBandwidth" json:"max_bandwidth,omitempty"` // Server welcome text. @@ -2073,61 +2553,87 @@ type ServerConfig struct { ImageMessageLength *uint32 `protobuf:"varint,5,opt,name=image_message_length,json=imageMessageLength" json:"image_message_length,omitempty"` // The maximum number of users allowed on the server. MaxUsers *uint32 `protobuf:"varint,6,opt,name=max_users,json=maxUsers" json:"max_users,omitempty"` - // Whether using Mumble's recording feature is allowed on the server. - RecordingAllowed *bool `protobuf:"varint,7,opt,name=recording_allowed,json=recordingAllowed" json:"recording_allowed,omitempty"` - XXX_unrecognized []byte `json:"-"` + // Whether using Mumble's recording feature is allowed on the server + RecordingAllowed *bool `protobuf:"varint,7,opt,name=recording_allowed,json=recordingAllowed" json:"recording_allowed,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } -func (m *ServerConfig) Reset() { *m = ServerConfig{} } -func (m *ServerConfig) String() string { return proto.CompactTextString(m) } -func (*ServerConfig) ProtoMessage() {} -func (*ServerConfig) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{24} } +func (x *ServerConfig) Reset() { + *x = ServerConfig{} + mi := &file_Mumble_proto_msgTypes[24] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} -func (m *ServerConfig) GetMaxBandwidth() uint32 { - if m != nil && m.MaxBandwidth != nil { - return *m.MaxBandwidth +func (x *ServerConfig) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ServerConfig) ProtoMessage() {} + +func (x *ServerConfig) ProtoReflect() protoreflect.Message { + mi := &file_Mumble_proto_msgTypes[24] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ServerConfig.ProtoReflect.Descriptor instead. +func (*ServerConfig) Descriptor() ([]byte, []int) { + return file_Mumble_proto_rawDescGZIP(), []int{24} +} + +func (x *ServerConfig) GetMaxBandwidth() uint32 { + if x != nil && x.MaxBandwidth != nil { + return *x.MaxBandwidth } return 0 } -func (m *ServerConfig) GetWelcomeText() string { - if m != nil && m.WelcomeText != nil { - return *m.WelcomeText +func (x *ServerConfig) GetWelcomeText() string { + if x != nil && x.WelcomeText != nil { + return *x.WelcomeText } return "" } -func (m *ServerConfig) GetAllowHtml() bool { - if m != nil && m.AllowHtml != nil { - return *m.AllowHtml +func (x *ServerConfig) GetAllowHtml() bool { + if x != nil && x.AllowHtml != nil { + return *x.AllowHtml } return false } -func (m *ServerConfig) GetMessageLength() uint32 { - if m != nil && m.MessageLength != nil { - return *m.MessageLength +func (x *ServerConfig) GetMessageLength() uint32 { + if x != nil && x.MessageLength != nil { + return *x.MessageLength } return 0 } -func (m *ServerConfig) GetImageMessageLength() uint32 { - if m != nil && m.ImageMessageLength != nil { - return *m.ImageMessageLength +func (x *ServerConfig) GetImageMessageLength() uint32 { + if x != nil && x.ImageMessageLength != nil { + return *x.ImageMessageLength } return 0 } -func (m *ServerConfig) GetMaxUsers() uint32 { - if m != nil && m.MaxUsers != nil { - return *m.MaxUsers +func (x *ServerConfig) GetMaxUsers() uint32 { + if x != nil && x.MaxUsers != nil { + return *x.MaxUsers } return 0 } -func (m *ServerConfig) GetRecordingAllowed() bool { - if m != nil && m.RecordingAllowed != nil { - return *m.RecordingAllowed +func (x *ServerConfig) GetRecordingAllowed() bool { + if x != nil && x.RecordingAllowed != nil { + return *x.RecordingAllowed } return false } @@ -2135,236 +2641,1229 @@ func (m *ServerConfig) GetRecordingAllowed() bool { // Sent by the server to inform the clients of suggested client configuration // specified by the server administrator. type SuggestConfig struct { - // Suggested client version. - Version *uint32 `protobuf:"varint,1,opt,name=version" json:"version,omitempty"` + state protoimpl.MessageState `protogen:"open.v1"` + // Suggested client version in the legacy format. + VersionV1 *uint32 `protobuf:"varint,1,opt,name=version_v1,json=versionV1" json:"version_v1,omitempty"` + // Suggested client version in the new format. + // Necessary since patch level may exceed 255. (See https://github.com/mumble-voip/mumble/issues/5827) + VersionV2 *uint64 `protobuf:"varint,4,opt,name=version_v2,json=versionV2" json:"version_v2,omitempty"` // True if the administrator suggests positional audio to be used on this // server. Positional *bool `protobuf:"varint,2,opt,name=positional" json:"positional,omitempty"` // True if the administrator suggests push to talk to be used on this server. - PushToTalk *bool `protobuf:"varint,3,opt,name=push_to_talk,json=pushToTalk" json:"push_to_talk,omitempty"` - XXX_unrecognized []byte `json:"-"` + PushToTalk *bool `protobuf:"varint,3,opt,name=push_to_talk,json=pushToTalk" json:"push_to_talk,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } -func (m *SuggestConfig) Reset() { *m = SuggestConfig{} } -func (m *SuggestConfig) String() string { return proto.CompactTextString(m) } -func (*SuggestConfig) ProtoMessage() {} -func (*SuggestConfig) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{25} } +func (x *SuggestConfig) Reset() { + *x = SuggestConfig{} + mi := &file_Mumble_proto_msgTypes[25] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} -func (m *SuggestConfig) GetVersion() uint32 { - if m != nil && m.Version != nil { - return *m.Version +func (x *SuggestConfig) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SuggestConfig) ProtoMessage() {} + +func (x *SuggestConfig) ProtoReflect() protoreflect.Message { + mi := &file_Mumble_proto_msgTypes[25] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SuggestConfig.ProtoReflect.Descriptor instead. +func (*SuggestConfig) Descriptor() ([]byte, []int) { + return file_Mumble_proto_rawDescGZIP(), []int{25} +} + +func (x *SuggestConfig) GetVersionV1() uint32 { + if x != nil && x.VersionV1 != nil { + return *x.VersionV1 } return 0 } -func (m *SuggestConfig) GetPositional() bool { - if m != nil && m.Positional != nil { - return *m.Positional +func (x *SuggestConfig) GetVersionV2() uint64 { + if x != nil && x.VersionV2 != nil { + return *x.VersionV2 + } + return 0 +} + +func (x *SuggestConfig) GetPositional() bool { + if x != nil && x.Positional != nil { + return *x.Positional } return false } -func (m *SuggestConfig) GetPushToTalk() bool { - if m != nil && m.PushToTalk != nil { - return *m.PushToTalk +func (x *SuggestConfig) GetPushToTalk() bool { + if x != nil && x.PushToTalk != nil { + return *x.PushToTalk } return false } -func init() { - proto.RegisterType((*Version)(nil), "MumbleProto.Version") - proto.RegisterType((*UDPTunnel)(nil), "MumbleProto.UDPTunnel") - proto.RegisterType((*Authenticate)(nil), "MumbleProto.Authenticate") - proto.RegisterType((*Ping)(nil), "MumbleProto.Ping") - proto.RegisterType((*Reject)(nil), "MumbleProto.Reject") - proto.RegisterType((*ServerSync)(nil), "MumbleProto.ServerSync") - proto.RegisterType((*ChannelRemove)(nil), "MumbleProto.ChannelRemove") - proto.RegisterType((*ChannelState)(nil), "MumbleProto.ChannelState") - proto.RegisterType((*UserRemove)(nil), "MumbleProto.UserRemove") - proto.RegisterType((*UserState)(nil), "MumbleProto.UserState") - proto.RegisterType((*BanList)(nil), "MumbleProto.BanList") - proto.RegisterType((*BanList_BanEntry)(nil), "MumbleProto.BanList.BanEntry") - proto.RegisterType((*TextMessage)(nil), "MumbleProto.TextMessage") - proto.RegisterType((*PermissionDenied)(nil), "MumbleProto.PermissionDenied") - proto.RegisterType((*ACL)(nil), "MumbleProto.ACL") - proto.RegisterType((*ACL_ChanGroup)(nil), "MumbleProto.ACL.ChanGroup") - proto.RegisterType((*ACL_ChanACL)(nil), "MumbleProto.ACL.ChanACL") - proto.RegisterType((*QueryUsers)(nil), "MumbleProto.QueryUsers") - proto.RegisterType((*CryptSetup)(nil), "MumbleProto.CryptSetup") - proto.RegisterType((*ContextActionModify)(nil), "MumbleProto.ContextActionModify") - proto.RegisterType((*ContextAction)(nil), "MumbleProto.ContextAction") - proto.RegisterType((*UserList)(nil), "MumbleProto.UserList") - proto.RegisterType((*UserList_User)(nil), "MumbleProto.UserList.User") - proto.RegisterType((*VoiceTarget)(nil), "MumbleProto.VoiceTarget") - proto.RegisterType((*VoiceTarget_Target)(nil), "MumbleProto.VoiceTarget.Target") - proto.RegisterType((*PermissionQuery)(nil), "MumbleProto.PermissionQuery") - proto.RegisterType((*CodecVersion)(nil), "MumbleProto.CodecVersion") - proto.RegisterType((*UserStats)(nil), "MumbleProto.UserStats") - proto.RegisterType((*UserStats_Stats)(nil), "MumbleProto.UserStats.Stats") - proto.RegisterType((*RequestBlob)(nil), "MumbleProto.RequestBlob") - proto.RegisterType((*ServerConfig)(nil), "MumbleProto.ServerConfig") - proto.RegisterType((*SuggestConfig)(nil), "MumbleProto.SuggestConfig") - proto.RegisterEnum("MumbleProto.Reject_RejectType", Reject_RejectType_name, Reject_RejectType_value) - proto.RegisterEnum("MumbleProto.PermissionDenied_DenyType", PermissionDenied_DenyType_name, PermissionDenied_DenyType_value) - proto.RegisterEnum("MumbleProto.ContextActionModify_Context", ContextActionModify_Context_name, ContextActionModify_Context_value) - proto.RegisterEnum("MumbleProto.ContextActionModify_Operation", ContextActionModify_Operation_name, ContextActionModify_Operation_value) +// Used to send plugin messages between clients +type PluginDataTransmission struct { + state protoimpl.MessageState `protogen:"open.v1"` + // The session ID of the client this message was sent from + SenderSession *uint32 `protobuf:"varint,1,opt,name=senderSession" json:"senderSession,omitempty"` + // The session IDs of the clients that should receive this message + ReceiverSessions []uint32 `protobuf:"varint,2,rep,packed,name=receiverSessions" json:"receiverSessions,omitempty"` + // The data that is sent + Data []byte `protobuf:"bytes,3,opt,name=data" json:"data,omitempty"` + // The ID of the sent data. This will be used by plugins to check whether they will + // process it or not + DataID *string `protobuf:"bytes,4,opt,name=dataID" json:"dataID,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } -func init() { proto.RegisterFile("Mumble.proto", fileDescriptor0) } - -var fileDescriptor0 = []byte{ - // 2445 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xdc, 0x58, 0xcd, 0x72, 0x2c, 0x37, - 0x15, 0x4e, 0xcf, 0xff, 0x9c, 0x99, 0xb1, 0xdb, 0xba, 0x26, 0x19, 0x9c, 0xdc, 0xc4, 0xe9, 0x0b, - 0x89, 0x03, 0x29, 0x13, 0x5c, 0xd9, 0x24, 0x55, 0x2c, 0x7c, 0x7d, 0x09, 0x76, 0x61, 0xdf, 0x98, - 0xb6, 0x73, 0xb3, 0x60, 0xd1, 0xc8, 0xd3, 0xf2, 0x4c, 0xe3, 0x9e, 0x56, 0xa7, 0xa5, 0xf6, 0xbd, - 0x53, 0xc5, 0x12, 0xd8, 0x92, 0x2a, 0x16, 0xec, 0x78, 0x00, 0x8a, 0x4a, 0x15, 0x0f, 0xc0, 0x86, - 0x27, 0xe0, 0x05, 0xd8, 0xb0, 0x65, 0x47, 0x15, 0x7b, 0xea, 0x1c, 0xa9, 0xff, 0xec, 0xc9, 0x0f, - 0x5b, 0x36, 0x33, 0x3a, 0x9f, 0x3e, 0x49, 0xa7, 0x8f, 0xce, 0x8f, 0x24, 0x18, 0x9f, 0xe5, 0xcb, - 0xab, 0x58, 0xec, 0xa7, 0x99, 0xd4, 0x92, 0x8d, 0x8c, 0x74, 0x8e, 0x82, 0x17, 0x43, 0xff, 0x99, - 0xc8, 0x54, 0x24, 0x13, 0x36, 0x85, 0xfe, 0xad, 0x69, 0x4e, 0x9d, 0x5d, 0x67, 0x6f, 0xe2, 0x17, - 0x22, 0xf6, 0x64, 0x22, 0x16, 0x5c, 0x89, 0x69, 0x6b, 0xd7, 0xd9, 0x1b, 0xfa, 0x85, 0xc8, 0x36, - 0xa0, 0x25, 0xd5, 0xb4, 0x4d, 0x60, 0x4b, 0x2a, 0xf6, 0x10, 0x40, 0xaa, 0xa0, 0x98, 0xa6, 0x43, - 0xf8, 0x50, 0x2a, 0xbb, 0x84, 0xf7, 0x08, 0x86, 0x9f, 0x3c, 0x39, 0xbf, 0xcc, 0x93, 0x44, 0xc4, - 0xec, 0x65, 0xe8, 0xa5, 0x7c, 0x76, 0x23, 0xf4, 0xd4, 0xd9, 0x6d, 0xed, 0x8d, 0x7d, 0x2b, 0x79, - 0x7f, 0x74, 0x60, 0x7c, 0x98, 0xeb, 0x85, 0x48, 0x74, 0x34, 0xe3, 0x5a, 0xb0, 0x1d, 0x18, 0xe4, - 0x4a, 0x64, 0x09, 0x5f, 0x0a, 0xd2, 0x6c, 0xe8, 0x97, 0x32, 0xf6, 0xa5, 0x5c, 0xa9, 0xe7, 0x32, - 0x0b, 0xad, 0x6e, 0xa5, 0x8c, 0x0b, 0x68, 0x79, 0x23, 0x12, 0x54, 0xb0, 0xbd, 0x37, 0xf4, 0xad, - 0xc4, 0x1e, 0xc1, 0x64, 0x26, 0x62, 0x5d, 0xa8, 0xa9, 0xa6, 0x9d, 0xdd, 0xf6, 0x5e, 0xd7, 0x1f, - 0x23, 0x68, 0x35, 0x55, 0xec, 0xdb, 0xd0, 0x91, 0x69, 0xae, 0xa6, 0xdd, 0x5d, 0x67, 0x6f, 0xf0, - 0x61, 0xf7, 0x9a, 0xc7, 0x4a, 0xf8, 0x04, 0x79, 0x7f, 0x6b, 0x41, 0xe7, 0x3c, 0x4a, 0xe6, 0xec, - 0x35, 0x18, 0xea, 0x68, 0x29, 0x94, 0xe6, 0xcb, 0x94, 0x34, 0xeb, 0xf8, 0x15, 0xc0, 0x18, 0x74, - 0xe6, 0x52, 0x1a, 0xb5, 0x26, 0x3e, 0xb5, 0x11, 0x8b, 0xb9, 0x16, 0x64, 0xb1, 0x89, 0x4f, 0x6d, - 0xc2, 0xa4, 0xd2, 0x64, 0x2d, 0xc4, 0xa4, 0xd2, 0xa8, 0x7a, 0x26, 0xd4, 0x2a, 0x99, 0xd1, 0xfa, - 0x13, 0xdf, 0x4a, 0xec, 0x0d, 0x18, 0xe5, 0x61, 0x1a, 0x18, 0x4b, 0xa9, 0x69, 0x8f, 0x3a, 0x21, - 0x0f, 0xd3, 0x73, 0x83, 0x20, 0x41, 0xcf, 0x2a, 0x42, 0xdf, 0x10, 0xf4, 0xac, 0x24, 0xec, 0xc2, - 0x98, 0x66, 0x88, 0x92, 0x79, 0xc0, 0x6f, 0xe7, 0xd3, 0xc1, 0xae, 0xb3, 0xd7, 0x32, 0x53, 0x44, - 0xc9, 0xfc, 0xf0, 0x76, 0xde, 0x60, 0xdc, 0xf2, 0x6c, 0x3a, 0x6c, 0x30, 0x9e, 0xf1, 0x0c, 0x19, - 0xb4, 0x48, 0x31, 0x07, 0x18, 0x06, 0xae, 0x52, 0xcd, 0x51, 0x32, 0x70, 0x8e, 0x51, 0x83, 0xf1, - 0x8c, 0x67, 0xde, 0x6f, 0x5a, 0xd0, 0xf3, 0xc5, 0x2f, 0xc5, 0x4c, 0xb3, 0x03, 0xe8, 0xe8, 0x55, - 0x6a, 0xf6, 0x76, 0xe3, 0xe0, 0xf5, 0xfd, 0x9a, 0x7f, 0xee, 0x1b, 0x8a, 0xfd, 0xbb, 0x5c, 0xa5, - 0xc2, 0x27, 0xae, 0x31, 0x10, 0x57, 0x32, 0xb1, 0xbb, 0x6e, 0x25, 0xef, 0x0b, 0x07, 0xa0, 0x22, - 0xb3, 0x01, 0x74, 0x9e, 0xca, 0x44, 0xb8, 0x2f, 0x31, 0x17, 0xc6, 0x9f, 0x66, 0x32, 0x99, 0xdb, - 0x0d, 0x76, 0x1d, 0xf6, 0x00, 0x36, 0x4f, 0x92, 0x5b, 0x1e, 0x47, 0xe1, 0x27, 0xd6, 0x9b, 0xdc, - 0x16, 0xdb, 0x84, 0x11, 0xd1, 0x10, 0x3a, 0xff, 0xd4, 0x6d, 0xb3, 0x2d, 0x98, 0x10, 0x70, 0x21, - 0xb2, 0x5b, 0x82, 0x3a, 0x08, 0x15, 0x23, 0x4e, 0x92, 0x4f, 0x94, 0x70, 0xbb, 0x6c, 0x03, 0xc0, - 0x10, 0x3e, 0xca, 0xe3, 0xd8, 0xed, 0x21, 0xe5, 0xa9, 0x3c, 0x12, 0x99, 0x8e, 0xae, 0xc9, 0x87, - 0xdd, 0x3e, 0xfb, 0x16, 0x6c, 0xd5, 0xbc, 0x5a, 0x66, 0x1f, 0xf1, 0x28, 0x76, 0x07, 0xde, 0xe7, - 0x4e, 0x31, 0xf4, 0x02, 0x37, 0x78, 0x0a, 0x7d, 0x25, 0x54, 0x3d, 0x08, 0xad, 0x88, 0x5e, 0xbb, - 0xe4, 0x2f, 0x82, 0x2b, 0x9e, 0x84, 0xcf, 0xa3, 0x50, 0x2f, 0xac, 0x5f, 0x8d, 0x97, 0xfc, 0xc5, - 0xe3, 0x02, 0x63, 0x6f, 0xc2, 0xf8, 0xb9, 0x88, 0x67, 0x72, 0x29, 0x02, 0x2d, 0x5e, 0x68, 0x1b, - 0x99, 0x23, 0x8b, 0x5d, 0x8a, 0x17, 0x9a, 0xed, 0xc2, 0x28, 0x15, 0xd9, 0x32, 0x52, 0x85, 0xef, - 0xa3, 0xdb, 0xd6, 0x21, 0x6f, 0x1f, 0x26, 0x47, 0x0b, 0x8e, 0x31, 0xea, 0x8b, 0xa5, 0xbc, 0x15, - 0x18, 0xd5, 0x33, 0x03, 0x04, 0x51, 0x48, 0xd1, 0x3a, 0xf1, 0x87, 0x16, 0x39, 0x09, 0xbd, 0x7f, - 0xb4, 0x60, 0x6c, 0x07, 0x5c, 0x68, 0xf4, 0xe8, 0xbb, 0x7c, 0xa7, 0xc1, 0x37, 0x81, 0x9f, 0x89, - 0x44, 0xdb, 0x4f, 0xb0, 0x12, 0x06, 0x02, 0xc5, 0xb8, 0x51, 0x9a, 0xda, 0x6c, 0x1b, 0xba, 0x71, - 0x94, 0xdc, 0x98, 0x18, 0x9d, 0xf8, 0x46, 0xc0, 0x6f, 0x08, 0x85, 0x9a, 0x65, 0x51, 0xaa, 0xd1, - 0x52, 0x5d, 0xf3, 0x95, 0x35, 0x88, 0xbd, 0x0a, 0x43, 0xa2, 0x06, 0x3c, 0x0c, 0xa7, 0x3d, 0x1a, - 0x3b, 0x20, 0xe0, 0x30, 0x0c, 0xd1, 0x4a, 0xa6, 0x33, 0xa3, 0xef, 0x9b, 0xf6, 0xa9, 0x7f, 0x44, - 0x98, 0xfd, 0xe4, 0x47, 0x30, 0xd4, 0x62, 0x99, 0xca, 0x8c, 0x67, 0x2b, 0x8a, 0x91, 0x32, 0x07, - 0x54, 0x38, 0x7b, 0x08, 0x83, 0x54, 0xaa, 0x88, 0x74, 0xc0, 0x28, 0xe9, 0x7e, 0xe8, 0xbc, 0xe7, - 0x97, 0x10, 0x7b, 0x07, 0xdc, 0x9a, 0x4a, 0xc1, 0x82, 0xab, 0x05, 0x85, 0xca, 0xd8, 0xdf, 0xac, - 0xe1, 0xc7, 0x5c, 0x2d, 0x50, 0x5d, 0xdc, 0x5c, 0x4c, 0x6b, 0x8a, 0x82, 0x65, 0xe2, 0x0f, 0x96, - 0xfc, 0x05, 0xba, 0x99, 0xf2, 0xae, 0x01, 0xb0, 0x61, 0x35, 0x6b, 0x78, 0x48, 0xab, 0xee, 0x21, - 0xdb, 0xd0, 0xe5, 0x33, 0x2d, 0x33, 0x6b, 0x56, 0x23, 0xd4, 0x22, 0xa5, 0x5d, 0x8f, 0x14, 0xe6, - 0x42, 0xfb, 0x8a, 0x9b, 0x1c, 0x3d, 0xf0, 0xb1, 0xe9, 0xfd, 0xb9, 0x03, 0x43, 0x5c, 0xc8, 0x6c, - 0xe2, 0x97, 0x7b, 0xe2, 0xfa, 0x75, 0xd6, 0xed, 0xde, 0x2b, 0xd0, 0xc7, 0x4f, 0x42, 0x2f, 0x30, - 0xd9, 0xad, 0x87, 0xe2, 0x49, 0x78, 0xc7, 0x43, 0xba, 0x77, 0x3d, 0x84, 0x41, 0x67, 0x99, 0x6b, - 0x41, 0xf9, 0x6d, 0xe0, 0x53, 0x1b, 0xb1, 0x50, 0xf0, 0x6b, 0x4a, 0x69, 0x03, 0x9f, 0xda, 0x98, - 0xfd, 0x55, 0x9e, 0xa6, 0x99, 0x50, 0xca, 0x6c, 0x92, 0x5f, 0xca, 0x68, 0x52, 0x25, 0xe2, 0xeb, - 0x80, 0x26, 0x1a, 0xda, 0x4e, 0x11, 0x5f, 0x9f, 0xe1, 0x64, 0x45, 0x27, 0xcd, 0x08, 0x55, 0xe7, - 0x13, 0x9c, 0x75, 0x0a, 0x7d, 0x0c, 0x9e, 0x3c, 0x13, 0xb4, 0x15, 0x63, 0xbf, 0x10, 0xd9, 0x77, - 0x61, 0x23, 0x8d, 0xf3, 0x79, 0x94, 0x04, 0x33, 0x99, 0x50, 0x80, 0x8d, 0x89, 0x30, 0x31, 0xe8, - 0x91, 0x01, 0xd9, 0xdb, 0xb0, 0x69, 0x69, 0x51, 0x88, 0xf1, 0xae, 0x57, 0xd3, 0x09, 0x59, 0xc5, - 0x8e, 0x3e, 0xb1, 0x28, 0xae, 0x34, 0x93, 0xcb, 0x25, 0x86, 0xc2, 0x86, 0x29, 0xac, 0x56, 0xc4, - 0xaf, 0x25, 0x7f, 0xd9, 0x34, 0xd6, 0xc4, 0x36, 0xba, 0xad, 0xed, 0x36, 0xbe, 0xe4, 0xd2, 0xda, - 0x23, 0x8b, 0x1d, 0x5b, 0x8a, 0xd5, 0xd5, 0x50, 0xb6, 0x0c, 0xc5, 0x62, 0x44, 0x79, 0x07, 0xdc, - 0x34, 0x8b, 0x64, 0x16, 0xe9, 0x55, 0xa0, 0x52, 0xc1, 0x6f, 0x44, 0x36, 0x65, 0x64, 0x81, 0xcd, - 0x02, 0xbf, 0x30, 0x30, 0xd6, 0xb7, 0x4c, 0xcc, 0x64, 0x16, 0x46, 0xc9, 0x7c, 0xfa, 0x80, 0x38, - 0x15, 0xe0, 0xfd, 0xb6, 0x05, 0xfd, 0xc7, 0x3c, 0x39, 0x8d, 0x94, 0x66, 0x3f, 0x84, 0xce, 0x15, - 0x4f, 0xd4, 0xd4, 0xd9, 0x6d, 0xef, 0x8d, 0x0e, 0x1e, 0x36, 0x52, 0xb8, 0xe5, 0xe0, 0xff, 0x8f, - 0x13, 0x9d, 0xad, 0x7c, 0xa2, 0xb2, 0x57, 0xa1, 0xfb, 0x59, 0x2e, 0xb2, 0x15, 0x79, 0x51, 0x19, - 0x5d, 0x06, 0xdb, 0xf9, 0x93, 0x03, 0x83, 0x82, 0x8f, 0x56, 0xe2, 0x61, 0x48, 0x9b, 0x6c, 0x4e, - 0x0a, 0x85, 0x48, 0x7e, 0xc2, 0xd5, 0xcd, 0xb4, 0x45, 0x81, 0x40, 0xed, 0xb5, 0x7e, 0x58, 0x58, - 0xb3, 0x53, 0xb3, 0x66, 0x15, 0x17, 0xdd, 0x46, 0x5c, 0x6c, 0x43, 0x57, 0x69, 0x9e, 0x69, 0x72, - 0xbe, 0xa1, 0x6f, 0x04, 0xf4, 0xb4, 0x30, 0xcf, 0x38, 0x85, 0xba, 0x29, 0xaa, 0xa5, 0xec, 0xfd, - 0xce, 0x81, 0x11, 0xa6, 0xd6, 0x33, 0xa1, 0x14, 0x9f, 0x8b, 0x2a, 0x3e, 0x9c, 0x7a, 0x7c, 0xd4, - 0xe2, 0xa9, 0x45, 0xf9, 0xa6, 0x8c, 0xa7, 0x66, 0x30, 0xb4, 0xa9, 0xb3, 0x16, 0x0c, 0xaf, 0x40, - 0x5f, 0x67, 0x42, 0x98, 0x20, 0xc2, 0xbe, 0x1e, 0x8a, 0x27, 0x21, 0xce, 0xb8, 0x34, 0x4b, 0x4e, - 0xbb, 0xbb, 0x2d, 0xf4, 0x1e, 0x2b, 0x7a, 0xbf, 0x6f, 0x83, 0x7b, 0x5e, 0x66, 0xf4, 0x27, 0x22, - 0x89, 0x44, 0xc8, 0x5e, 0x07, 0xa8, 0xb2, 0xbc, 0xd5, 0xad, 0x86, 0xdc, 0x51, 0xa3, 0x75, 0x37, - 0x26, 0x6b, 0xfa, 0xb7, 0x9b, 0xf9, 0xa0, 0xb2, 0x64, 0xa7, 0x61, 0xc9, 0x0f, 0x6d, 0x5d, 0xef, - 0x52, 0x5d, 0x7f, 0xab, 0xe1, 0x14, 0x77, 0xb5, 0xdb, 0x7f, 0x22, 0x92, 0x55, 0xad, 0xbe, 0x17, - 0xbb, 0xd8, 0xab, 0x76, 0xd1, 0xfb, 0xab, 0x03, 0x83, 0x82, 0x86, 0x95, 0x1d, 0x6d, 0xee, 0xbe, - 0x84, 0xb5, 0xb7, 0x9a, 0xcd, 0x75, 0xd8, 0x04, 0x86, 0x17, 0x79, 0x2a, 0x32, 0x4c, 0x65, 0xa6, - 0xa2, 0xdb, 0xe2, 0xf4, 0x14, 0x4b, 0x7c, 0x1b, 0x01, 0x1c, 0x79, 0x29, 0xe5, 0xa9, 0x4c, 0xe6, - 0x6e, 0x87, 0xf5, 0xa1, 0x7d, 0xfc, 0xc1, 0x4f, 0xdd, 0x2e, 0xdb, 0x06, 0xf7, 0xb2, 0x48, 0xee, - 0x76, 0x8c, 0xdb, 0x63, 0x2f, 0x03, 0x3b, 0xc3, 0xc9, 0x93, 0x79, 0xb3, 0xa0, 0x8f, 0x61, 0x80, - 0x4b, 0xd0, 0xac, 0x83, 0xda, 0x32, 0x74, 0x04, 0x18, 0xe2, 0x81, 0xe3, 0xa9, 0x50, 0x3a, 0x4a, - 0xe6, 0xa7, 0xd1, 0x32, 0xd2, 0x2e, 0x78, 0xbf, 0xee, 0x42, 0xfb, 0xf0, 0xe8, 0xf4, 0x6b, 0xca, - 0x29, 0x7b, 0x1b, 0xc6, 0x51, 0xb2, 0x10, 0x59, 0xa4, 0x03, 0x3e, 0x8b, 0x95, 0x8d, 0x8f, 0x8e, - 0xce, 0x72, 0xe1, 0x8f, 0x6c, 0xcf, 0xe1, 0x2c, 0x56, 0xec, 0x00, 0x7a, 0xf3, 0x4c, 0xe6, 0xa9, - 0x39, 0xdf, 0x8e, 0x0e, 0x76, 0x1a, 0x16, 0x3e, 0x3c, 0x3a, 0xdd, 0x47, 0x8d, 0x7e, 0x82, 0x14, - 0xdf, 0x32, 0xd9, 0xbb, 0xd0, 0xa1, 0x49, 0x3b, 0x34, 0x62, 0xba, 0x76, 0xc4, 0xe1, 0xd1, 0xa9, - 0x4f, 0xac, 0x2a, 0x46, 0xbb, 0x6b, 0x62, 0xf4, 0x9f, 0x0e, 0x0c, 0xcb, 0x05, 0xca, 0x0d, 0x73, - 0xc8, 0x13, 0x4d, 0xd8, 0x79, 0x30, 0xb4, 0xfa, 0x8a, 0xb0, 0xf1, 0x19, 0x15, 0xcc, 0x5e, 0x87, - 0xbe, 0x15, 0xc8, 0xad, 0x0a, 0x46, 0x01, 0xb2, 0xb7, 0xa0, 0xf8, 0x66, 0x7e, 0x15, 0x0b, 0x53, - 0xae, 0xee, 0x18, 0x03, 0x3b, 0xb0, 0x9c, 0x61, 0xa9, 0xef, 0x52, 0x84, 0x60, 0xd3, 0xb8, 0x25, - 0xd5, 0x77, 0x53, 0xff, 0xad, 0xc4, 0xbe, 0x0f, 0x5b, 0xe5, 0xf2, 0xc1, 0x52, 0x2c, 0xaf, 0xb0, - 0xe6, 0x9a, 0x23, 0x80, 0x5b, 0x76, 0x9c, 0x19, 0x7c, 0xe7, 0xef, 0x0e, 0xf4, 0xad, 0x4d, 0xd8, - 0x23, 0x00, 0x9e, 0xa6, 0xf1, 0x2a, 0x58, 0x88, 0xcc, 0x9c, 0x56, 0xcb, 0xef, 0x21, 0xfc, 0x58, - 0x64, 0xa2, 0x22, 0xa9, 0xfc, 0xaa, 0xb9, 0x77, 0x86, 0x74, 0x91, 0x5f, 0xa9, 0xa6, 0x61, 0xda, - 0xeb, 0x0d, 0xf3, 0xa5, 0xb5, 0x73, 0x1b, 0xba, 0xb4, 0x99, 0x36, 0x6f, 0x19, 0xc1, 0xa0, 0x3c, - 0xd1, 0xf6, 0x4e, 0x60, 0x04, 0x53, 0x34, 0x93, 0x95, 0x4d, 0x59, 0xd4, 0xf6, 0xde, 0x07, 0xf8, - 0x19, 0x6e, 0x20, 0x1d, 0x2e, 0xd0, 0x6e, 0x51, 0x68, 0x12, 0xf7, 0xc4, 0xc7, 0x26, 0xce, 0x84, - 0xbb, 0xa7, 0x28, 0x4d, 0x0d, 0x7d, 0x23, 0x78, 0x21, 0xc0, 0x51, 0xb6, 0x4a, 0xf5, 0x85, 0xd0, - 0x79, 0x8a, 0xa3, 0x6e, 0xc4, 0x8a, 0x6c, 0x30, 0xf6, 0xb1, 0x49, 0xc5, 0x29, 0x8e, 0xb0, 0x36, - 0x25, 0x32, 0x99, 0x99, 0x8b, 0x22, 0x16, 0x27, 0xc2, 0x9e, 0x22, 0x84, 0x14, 0x45, 0x27, 0x5d, - 0x4b, 0x69, 0x1b, 0x8a, 0xc1, 0x88, 0xe2, 0xfd, 0xc7, 0x81, 0x07, 0xb6, 0x8a, 0x1e, 0xce, 0x30, - 0xb9, 0x9e, 0xc9, 0x30, 0xba, 0x5e, 0xe1, 0x5e, 0x72, 0x92, 0xad, 0x7f, 0x59, 0x09, 0xbf, 0x8f, - 0xca, 0xb0, 0xb9, 0x04, 0x50, 0xdb, 0x14, 0xd5, 0xa4, 0x3c, 0xfe, 0x4e, 0xfc, 0x42, 0x64, 0xc7, - 0x30, 0x94, 0xa9, 0xb0, 0x59, 0xbc, 0x43, 0x59, 0xe9, 0x7b, 0x8d, 0x08, 0x58, 0xb3, 0xf4, 0xfe, - 0xc7, 0xc5, 0x08, 0xbf, 0x1a, 0xec, 0xbd, 0x0b, 0xfd, 0xa2, 0xd8, 0x03, 0xf4, 0xcc, 0xf9, 0xdd, - 0x75, 0xd8, 0xc8, 0x38, 0x0b, 0xe6, 0x8d, 0x16, 0x66, 0x28, 0x4a, 0x41, 0x1d, 0x6f, 0x17, 0x86, - 0xe5, 0x2c, 0x98, 0x6d, 0x0e, 0xc3, 0xd0, 0x7d, 0x09, 0x07, 0x9a, 0x23, 0x9d, 0xeb, 0x78, 0xbf, - 0x80, 0x49, 0x63, 0xed, 0xaf, 0x38, 0x7d, 0x7d, 0x4d, 0x9a, 0xae, 0x2c, 0xd5, 0xae, 0x5b, 0xca, - 0xfb, 0x8b, 0x63, 0xd2, 0x15, 0x95, 0xeb, 0xf7, 0xa0, 0x6b, 0x8e, 0x9a, 0xce, 0x9a, 0xc4, 0x51, - 0xb0, 0xa8, 0xe1, 0x1b, 0xe2, 0x8e, 0x32, 0x1f, 0x53, 0xf7, 0x4a, 0x93, 0xb8, 0x0a, 0xaf, 0x2c, - 0xe2, 0xbf, 0x55, 0x2b, 0xbb, 0x78, 0x08, 0xe7, 0x4a, 0x07, 0x4a, 0x88, 0xe2, 0xf4, 0x39, 0x40, - 0xe0, 0x42, 0x88, 0x84, 0x0e, 0xe1, 0xd8, 0x69, 0x55, 0xb7, 0x4e, 0x3e, 0x42, 0xcc, 0xda, 0xd0, - 0xfb, 0xb7, 0x03, 0xa3, 0x67, 0x32, 0x9a, 0x89, 0x4b, 0x9e, 0xcd, 0x85, 0x66, 0x1b, 0xd0, 0x2a, - 0xef, 0x13, 0xad, 0x28, 0x64, 0x1f, 0x40, 0x5f, 0x53, 0x8f, 0xf1, 0xd5, 0xd1, 0xc1, 0x1b, 0x8d, - 0x0f, 0xa9, 0x0d, 0xdd, 0x37, 0x7f, 0x7e, 0xc1, 0xdf, 0xf9, 0x83, 0x03, 0x3d, 0x3b, 0x6b, 0xc3, - 0xd4, 0xed, 0xff, 0xc1, 0xd4, 0x65, 0x20, 0xb6, 0xeb, 0x81, 0xf8, 0x6a, 0x75, 0x63, 0xa9, 0xe7, - 0x4c, 0x73, 0x71, 0x79, 0x13, 0x06, 0xb3, 0x45, 0x14, 0x87, 0x99, 0x48, 0x9a, 0x39, 0xb5, 0x84, - 0x3d, 0x09, 0x9b, 0x55, 0x39, 0xa3, 0x40, 0xfd, 0xba, 0xfb, 0xd4, 0x9d, 0x1b, 0x9d, 0xd1, 0xb3, - 0x0e, 0xa1, 0x4e, 0xd7, 0x71, 0xae, 0x16, 0x36, 0xd7, 0x14, 0x3a, 0x11, 0xe6, 0xfd, 0x0a, 0xc6, - 0x47, 0x32, 0x14, 0xb3, 0xe2, 0x1d, 0x08, 0x8f, 0x2f, 0x71, 0xba, 0xe0, 0xb4, 0xc1, 0x5d, 0xdf, - 0x08, 0xb8, 0xbf, 0x57, 0x42, 0x73, 0x3a, 0x6a, 0x75, 0x7d, 0x6a, 0x63, 0xa5, 0x4a, 0x33, 0x71, - 0x2d, 0xb2, 0xc0, 0x0c, 0x40, 0x8f, 0x2b, 0x93, 0xb3, 0xe9, 0x39, 0xa4, 0xc1, 0xc5, 0x63, 0x4a, - 0xe7, 0xfe, 0x63, 0xca, 0x17, 0xbd, 0xea, 0xd2, 0xa1, 0xbe, 0xc2, 0xed, 0xbf, 0x03, 0xa0, 0x90, - 0x12, 0xc8, 0x24, 0xbe, 0x73, 0x66, 0x1c, 0x52, 0xc7, 0xc7, 0x49, 0xbc, 0x62, 0x1e, 0x8c, 0x67, - 0x55, 0x91, 0x36, 0x85, 0x71, 0xec, 0x37, 0x30, 0xf6, 0x23, 0x18, 0x5d, 0x67, 0x72, 0x19, 0x98, - 0xd4, 0x44, 0x3a, 0x8d, 0x0e, 0x5e, 0xbb, 0x17, 0x02, 0xa4, 0xd0, 0x3e, 0xfd, 0xfa, 0x80, 0x03, - 0x8e, 0x88, 0x5f, 0x0e, 0x37, 0x69, 0x8b, 0x76, 0xf1, 0x1b, 0x0d, 0x37, 0x49, 0xe2, 0xff, 0xe7, - 0x05, 0x87, 0xed, 0x57, 0xef, 0x85, 0x63, 0x32, 0xc2, 0x76, 0x33, 0xfa, 0x4c, 0x5f, 0xf5, 0x8a, - 0x78, 0xef, 0xd9, 0x6d, 0xb2, 0xe6, 0xd9, 0xad, 0x76, 0xd6, 0xdf, 0x30, 0x77, 0xaf, 0xe2, 0xac, - 0xff, 0x1a, 0x0c, 0xab, 0xb7, 0x8f, 0x4d, 0x13, 0x03, 0x25, 0x80, 0x87, 0x5b, 0x99, 0xc4, 0x51, - 0x22, 0x94, 0x98, 0x29, 0xba, 0x19, 0x4d, 0xfc, 0x1a, 0x82, 0xe7, 0xf7, 0x28, 0x8c, 0x4d, 0xef, - 0x96, 0x39, 0xbf, 0x17, 0x32, 0x7b, 0x1f, 0x98, 0xd2, 0x99, 0x4c, 0xe6, 0x41, 0xcd, 0x4f, 0xcc, - 0x9d, 0xa8, 0x70, 0xb1, 0x2d, 0x43, 0xa8, 0x1d, 0x00, 0x4b, 0x9f, 0x7e, 0x70, 0xcf, 0xa7, 0x77, - 0x7e, 0x0e, 0x5d, 0xe3, 0xce, 0xc5, 0x13, 0xa0, 0xb3, 0xe6, 0x09, 0xb0, 0xb5, 0xe6, 0x09, 0xb0, - 0xbd, 0xf6, 0x09, 0xb0, 0x53, 0x7f, 0x02, 0xf4, 0x3e, 0x77, 0x60, 0xe4, 0x8b, 0xcf, 0x72, 0xa1, - 0xf4, 0xe3, 0x58, 0x5e, 0xe1, 0x65, 0xd3, 0xc6, 0x48, 0x50, 0xdc, 0x5a, 0x4d, 0x1a, 0xdb, 0xb0, - 0xf0, 0xa5, 0xbd, 0xbc, 0xd6, 0x88, 0xc5, 0xa5, 0xb3, 0xd5, 0x20, 0x1e, 0xd9, 0xbb, 0xe7, 0x0f, - 0xe0, 0x41, 0x91, 0x6e, 0xea, 0xaf, 0x2c, 0xe6, 0x62, 0xc2, 0x6c, 0xd7, 0x93, 0xaa, 0xc7, 0xfb, - 0x97, 0x03, 0x63, 0xe3, 0xde, 0x47, 0x32, 0xb9, 0x8e, 0xe6, 0xf7, 0xdf, 0xaa, 0x9c, 0x6f, 0xf0, - 0x56, 0xd5, 0xba, 0xff, 0x56, 0xf5, 0x10, 0x80, 0xc7, 0xb1, 0x7c, 0x1e, 0x2c, 0xf4, 0x32, 0x36, - 0xc9, 0xcb, 0x1f, 0x12, 0x72, 0xac, 0x97, 0x31, 0x5e, 0xc7, 0xed, 0x8d, 0x27, 0x88, 0x45, 0x32, - 0xd7, 0x0b, 0x6b, 0xaa, 0x89, 0x45, 0x4f, 0x09, 0x64, 0xef, 0xc1, 0x76, 0xb4, 0x44, 0xd2, 0x1d, - 0xb2, 0x79, 0x76, 0x60, 0xd4, 0x77, 0xd6, 0x18, 0xd1, 0x78, 0x8e, 0xe9, 0xdd, 0x79, 0x8e, 0xb9, - 0x81, 0xc9, 0x45, 0x3e, 0x9f, 0x0b, 0xa5, 0xed, 0xd7, 0x7e, 0xf9, 0xc3, 0x39, 0x5e, 0xb9, 0xec, - 0x6b, 0x10, 0x8f, 0x4d, 0xd2, 0xf2, 0x6b, 0x08, 0x06, 0x59, 0x9a, 0xab, 0x45, 0xa0, 0x65, 0xa0, - 0x79, 0x7c, 0x63, 0xbf, 0x10, 0x10, 0xbb, 0x94, 0x97, 0x3c, 0xbe, 0x79, 0xdc, 0x3a, 0x76, 0xfe, - 0x1b, 0x00, 0x00, 0xff, 0xff, 0x85, 0xe0, 0xf0, 0x3c, 0xbf, 0x17, 0x00, 0x00, +func (x *PluginDataTransmission) Reset() { + *x = PluginDataTransmission{} + mi := &file_Mumble_proto_msgTypes[26] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *PluginDataTransmission) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PluginDataTransmission) ProtoMessage() {} + +func (x *PluginDataTransmission) ProtoReflect() protoreflect.Message { + mi := &file_Mumble_proto_msgTypes[26] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PluginDataTransmission.ProtoReflect.Descriptor instead. +func (*PluginDataTransmission) Descriptor() ([]byte, []int) { + return file_Mumble_proto_rawDescGZIP(), []int{26} +} + +func (x *PluginDataTransmission) GetSenderSession() uint32 { + if x != nil && x.SenderSession != nil { + return *x.SenderSession + } + return 0 +} + +func (x *PluginDataTransmission) GetReceiverSessions() []uint32 { + if x != nil { + return x.ReceiverSessions + } + return nil +} + +func (x *PluginDataTransmission) GetData() []byte { + if x != nil { + return x.Data + } + return nil +} + +func (x *PluginDataTransmission) GetDataID() string { + if x != nil && x.DataID != nil { + return *x.DataID + } + return "" +} + +type UserState_VolumeAdjustment struct { + state protoimpl.MessageState `protogen:"open.v1"` + ListeningChannel *uint32 `protobuf:"varint,1,opt,name=listening_channel,json=listeningChannel" json:"listening_channel,omitempty"` + VolumeAdjustment *float32 `protobuf:"fixed32,2,opt,name=volume_adjustment,json=volumeAdjustment" json:"volume_adjustment,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *UserState_VolumeAdjustment) Reset() { + *x = UserState_VolumeAdjustment{} + mi := &file_Mumble_proto_msgTypes[27] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *UserState_VolumeAdjustment) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UserState_VolumeAdjustment) ProtoMessage() {} + +func (x *UserState_VolumeAdjustment) ProtoReflect() protoreflect.Message { + mi := &file_Mumble_proto_msgTypes[27] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UserState_VolumeAdjustment.ProtoReflect.Descriptor instead. +func (*UserState_VolumeAdjustment) Descriptor() ([]byte, []int) { + return file_Mumble_proto_rawDescGZIP(), []int{9, 0} +} + +func (x *UserState_VolumeAdjustment) GetListeningChannel() uint32 { + if x != nil && x.ListeningChannel != nil { + return *x.ListeningChannel + } + return 0 +} + +func (x *UserState_VolumeAdjustment) GetVolumeAdjustment() float32 { + if x != nil && x.VolumeAdjustment != nil { + return *x.VolumeAdjustment + } + return 0 +} + +type BanList_BanEntry struct { + state protoimpl.MessageState `protogen:"open.v1"` + // Banned IP address. + Address []byte `protobuf:"bytes,1,req,name=address" json:"address,omitempty"` + // The length of the subnet mask for the ban. + Mask *uint32 `protobuf:"varint,2,req,name=mask" json:"mask,omitempty"` + // User name for identification purposes (does not affect the ban). + Name *string `protobuf:"bytes,3,opt,name=name" json:"name,omitempty"` + // The certificate hash of the banned user. + Hash *string `protobuf:"bytes,4,opt,name=hash" json:"hash,omitempty"` + // Reason for the ban (does not affect the ban). + Reason *string `protobuf:"bytes,5,opt,name=reason" json:"reason,omitempty"` + // Ban start time. + Start *string `protobuf:"bytes,6,opt,name=start" json:"start,omitempty"` + // Ban duration in seconds. + Duration *uint32 `protobuf:"varint,7,opt,name=duration" json:"duration,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *BanList_BanEntry) Reset() { + *x = BanList_BanEntry{} + mi := &file_Mumble_proto_msgTypes[28] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *BanList_BanEntry) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*BanList_BanEntry) ProtoMessage() {} + +func (x *BanList_BanEntry) ProtoReflect() protoreflect.Message { + mi := &file_Mumble_proto_msgTypes[28] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use BanList_BanEntry.ProtoReflect.Descriptor instead. +func (*BanList_BanEntry) Descriptor() ([]byte, []int) { + return file_Mumble_proto_rawDescGZIP(), []int{10, 0} +} + +func (x *BanList_BanEntry) GetAddress() []byte { + if x != nil { + return x.Address + } + return nil +} + +func (x *BanList_BanEntry) GetMask() uint32 { + if x != nil && x.Mask != nil { + return *x.Mask + } + return 0 +} + +func (x *BanList_BanEntry) GetName() string { + if x != nil && x.Name != nil { + return *x.Name + } + return "" +} + +func (x *BanList_BanEntry) GetHash() string { + if x != nil && x.Hash != nil { + return *x.Hash + } + return "" +} + +func (x *BanList_BanEntry) GetReason() string { + if x != nil && x.Reason != nil { + return *x.Reason + } + return "" +} + +func (x *BanList_BanEntry) GetStart() string { + if x != nil && x.Start != nil { + return *x.Start + } + return "" +} + +func (x *BanList_BanEntry) GetDuration() uint32 { + if x != nil && x.Duration != nil { + return *x.Duration + } + return 0 +} + +type ACL_ChanGroup struct { + state protoimpl.MessageState `protogen:"open.v1"` + // Name of the channel group, UTF-8 encoded. + Name *string `protobuf:"bytes,1,req,name=name" json:"name,omitempty"` + // True if the group has been inherited from the parent (Read only). + Inherited *bool `protobuf:"varint,2,opt,name=inherited,def=1" json:"inherited,omitempty"` + // True if the group members are inherited. + Inherit *bool `protobuf:"varint,3,opt,name=inherit,def=1" json:"inherit,omitempty"` + // True if the group can be inherited by sub channels. + Inheritable *bool `protobuf:"varint,4,opt,name=inheritable,def=1" json:"inheritable,omitempty"` + // Users explicitly included in this group, identified by user_id. + Add []uint32 `protobuf:"varint,5,rep,name=add" json:"add,omitempty"` + // Users explicitly removed from this group in this channel if the group + // has been inherited, identified by user_id. + Remove []uint32 `protobuf:"varint,6,rep,name=remove" json:"remove,omitempty"` + // Users inherited, identified by user_id. + InheritedMembers []uint32 `protobuf:"varint,7,rep,name=inherited_members,json=inheritedMembers" json:"inherited_members,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +// Default values for ACL_ChanGroup fields. +const ( + Default_ACL_ChanGroup_Inherited = bool(true) + Default_ACL_ChanGroup_Inherit = bool(true) + Default_ACL_ChanGroup_Inheritable = bool(true) +) + +func (x *ACL_ChanGroup) Reset() { + *x = ACL_ChanGroup{} + mi := &file_Mumble_proto_msgTypes[29] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ACL_ChanGroup) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ACL_ChanGroup) ProtoMessage() {} + +func (x *ACL_ChanGroup) ProtoReflect() protoreflect.Message { + mi := &file_Mumble_proto_msgTypes[29] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ACL_ChanGroup.ProtoReflect.Descriptor instead. +func (*ACL_ChanGroup) Descriptor() ([]byte, []int) { + return file_Mumble_proto_rawDescGZIP(), []int{13, 0} +} + +func (x *ACL_ChanGroup) GetName() string { + if x != nil && x.Name != nil { + return *x.Name + } + return "" +} + +func (x *ACL_ChanGroup) GetInherited() bool { + if x != nil && x.Inherited != nil { + return *x.Inherited + } + return Default_ACL_ChanGroup_Inherited +} + +func (x *ACL_ChanGroup) GetInherit() bool { + if x != nil && x.Inherit != nil { + return *x.Inherit + } + return Default_ACL_ChanGroup_Inherit +} + +func (x *ACL_ChanGroup) GetInheritable() bool { + if x != nil && x.Inheritable != nil { + return *x.Inheritable + } + return Default_ACL_ChanGroup_Inheritable +} + +func (x *ACL_ChanGroup) GetAdd() []uint32 { + if x != nil { + return x.Add + } + return nil +} + +func (x *ACL_ChanGroup) GetRemove() []uint32 { + if x != nil { + return x.Remove + } + return nil +} + +func (x *ACL_ChanGroup) GetInheritedMembers() []uint32 { + if x != nil { + return x.InheritedMembers + } + return nil +} + +type ACL_ChanACL struct { + state protoimpl.MessageState `protogen:"open.v1"` + // True if this ACL applies to the current channel. + ApplyHere *bool `protobuf:"varint,1,opt,name=apply_here,json=applyHere,def=1" json:"apply_here,omitempty"` + // True if this ACL applies to the sub channels. + ApplySubs *bool `protobuf:"varint,2,opt,name=apply_subs,json=applySubs,def=1" json:"apply_subs,omitempty"` + // True if the ACL has been inherited from the parent. + Inherited *bool `protobuf:"varint,3,opt,name=inherited,def=1" json:"inherited,omitempty"` + // ID of the user that is affected by this ACL. + UserId *uint32 `protobuf:"varint,4,opt,name=user_id,json=userId" json:"user_id,omitempty"` + // ID of the group that is affected by this ACL. + Group *string `protobuf:"bytes,5,opt,name=group" json:"group,omitempty"` + // Bit flag field of the permissions granted by this ACL. + Grant *uint32 `protobuf:"varint,6,opt,name=grant" json:"grant,omitempty"` + // Bit flag field of the permissions denied by this ACL. + Deny *uint32 `protobuf:"varint,7,opt,name=deny" json:"deny,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +// Default values for ACL_ChanACL fields. +const ( + Default_ACL_ChanACL_ApplyHere = bool(true) + Default_ACL_ChanACL_ApplySubs = bool(true) + Default_ACL_ChanACL_Inherited = bool(true) +) + +func (x *ACL_ChanACL) Reset() { + *x = ACL_ChanACL{} + mi := &file_Mumble_proto_msgTypes[30] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ACL_ChanACL) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ACL_ChanACL) ProtoMessage() {} + +func (x *ACL_ChanACL) ProtoReflect() protoreflect.Message { + mi := &file_Mumble_proto_msgTypes[30] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ACL_ChanACL.ProtoReflect.Descriptor instead. +func (*ACL_ChanACL) Descriptor() ([]byte, []int) { + return file_Mumble_proto_rawDescGZIP(), []int{13, 1} +} + +func (x *ACL_ChanACL) GetApplyHere() bool { + if x != nil && x.ApplyHere != nil { + return *x.ApplyHere + } + return Default_ACL_ChanACL_ApplyHere +} + +func (x *ACL_ChanACL) GetApplySubs() bool { + if x != nil && x.ApplySubs != nil { + return *x.ApplySubs + } + return Default_ACL_ChanACL_ApplySubs +} + +func (x *ACL_ChanACL) GetInherited() bool { + if x != nil && x.Inherited != nil { + return *x.Inherited + } + return Default_ACL_ChanACL_Inherited +} + +func (x *ACL_ChanACL) GetUserId() uint32 { + if x != nil && x.UserId != nil { + return *x.UserId + } + return 0 +} + +func (x *ACL_ChanACL) GetGroup() string { + if x != nil && x.Group != nil { + return *x.Group + } + return "" +} + +func (x *ACL_ChanACL) GetGrant() uint32 { + if x != nil && x.Grant != nil { + return *x.Grant + } + return 0 +} + +func (x *ACL_ChanACL) GetDeny() uint32 { + if x != nil && x.Deny != nil { + return *x.Deny + } + return 0 +} + +type UserList_User struct { + state protoimpl.MessageState `protogen:"open.v1"` + // Registered user ID. + UserId *uint32 `protobuf:"varint,1,req,name=user_id,json=userId" json:"user_id,omitempty"` + // Registered user name. + Name *string `protobuf:"bytes,2,opt,name=name" json:"name,omitempty"` + LastSeen *string `protobuf:"bytes,3,opt,name=last_seen,json=lastSeen" json:"last_seen,omitempty"` + LastChannel *uint32 `protobuf:"varint,4,opt,name=last_channel,json=lastChannel" json:"last_channel,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *UserList_User) Reset() { + *x = UserList_User{} + mi := &file_Mumble_proto_msgTypes[31] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *UserList_User) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UserList_User) ProtoMessage() {} + +func (x *UserList_User) ProtoReflect() protoreflect.Message { + mi := &file_Mumble_proto_msgTypes[31] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UserList_User.ProtoReflect.Descriptor instead. +func (*UserList_User) Descriptor() ([]byte, []int) { + return file_Mumble_proto_rawDescGZIP(), []int{18, 0} +} + +func (x *UserList_User) GetUserId() uint32 { + if x != nil && x.UserId != nil { + return *x.UserId + } + return 0 +} + +func (x *UserList_User) GetName() string { + if x != nil && x.Name != nil { + return *x.Name + } + return "" +} + +func (x *UserList_User) GetLastSeen() string { + if x != nil && x.LastSeen != nil { + return *x.LastSeen + } + return "" +} + +func (x *UserList_User) GetLastChannel() uint32 { + if x != nil && x.LastChannel != nil { + return *x.LastChannel + } + return 0 +} + +type VoiceTarget_Target struct { + state protoimpl.MessageState `protogen:"open.v1"` + // Users that are included as targets. + Session []uint32 `protobuf:"varint,1,rep,name=session" json:"session,omitempty"` + // Channel that is included as a target. + ChannelId *uint32 `protobuf:"varint,2,opt,name=channel_id,json=channelId" json:"channel_id,omitempty"` + // ACL group that is included as a target. + Group *string `protobuf:"bytes,3,opt,name=group" json:"group,omitempty"` + // True if the voice should follow links from the specified channel. + Links *bool `protobuf:"varint,4,opt,name=links,def=0" json:"links,omitempty"` + // True if the voice should also be sent to children of the specific + // channel. + Children *bool `protobuf:"varint,5,opt,name=children,def=0" json:"children,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +// Default values for VoiceTarget_Target fields. +const ( + Default_VoiceTarget_Target_Links = bool(false) + Default_VoiceTarget_Target_Children = bool(false) +) + +func (x *VoiceTarget_Target) Reset() { + *x = VoiceTarget_Target{} + mi := &file_Mumble_proto_msgTypes[32] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *VoiceTarget_Target) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*VoiceTarget_Target) ProtoMessage() {} + +func (x *VoiceTarget_Target) ProtoReflect() protoreflect.Message { + mi := &file_Mumble_proto_msgTypes[32] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use VoiceTarget_Target.ProtoReflect.Descriptor instead. +func (*VoiceTarget_Target) Descriptor() ([]byte, []int) { + return file_Mumble_proto_rawDescGZIP(), []int{19, 0} +} + +func (x *VoiceTarget_Target) GetSession() []uint32 { + if x != nil { + return x.Session + } + return nil +} + +func (x *VoiceTarget_Target) GetChannelId() uint32 { + if x != nil && x.ChannelId != nil { + return *x.ChannelId + } + return 0 +} + +func (x *VoiceTarget_Target) GetGroup() string { + if x != nil && x.Group != nil { + return *x.Group + } + return "" +} + +func (x *VoiceTarget_Target) GetLinks() bool { + if x != nil && x.Links != nil { + return *x.Links + } + return Default_VoiceTarget_Target_Links +} + +func (x *VoiceTarget_Target) GetChildren() bool { + if x != nil && x.Children != nil { + return *x.Children + } + return Default_VoiceTarget_Target_Children +} + +type UserStats_Stats struct { + state protoimpl.MessageState `protogen:"open.v1"` + // The amount of good packets received. + Good *uint32 `protobuf:"varint,1,opt,name=good" json:"good,omitempty"` + // The amount of late packets received. + Late *uint32 `protobuf:"varint,2,opt,name=late" json:"late,omitempty"` + // The amount of packets never received. + Lost *uint32 `protobuf:"varint,3,opt,name=lost" json:"lost,omitempty"` + // The amount of nonce resyncs. + Resync *uint32 `protobuf:"varint,4,opt,name=resync" json:"resync,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *UserStats_Stats) Reset() { + *x = UserStats_Stats{} + mi := &file_Mumble_proto_msgTypes[33] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *UserStats_Stats) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UserStats_Stats) ProtoMessage() {} + +func (x *UserStats_Stats) ProtoReflect() protoreflect.Message { + mi := &file_Mumble_proto_msgTypes[33] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UserStats_Stats.ProtoReflect.Descriptor instead. +func (*UserStats_Stats) Descriptor() ([]byte, []int) { + return file_Mumble_proto_rawDescGZIP(), []int{22, 0} +} + +func (x *UserStats_Stats) GetGood() uint32 { + if x != nil && x.Good != nil { + return *x.Good + } + return 0 +} + +func (x *UserStats_Stats) GetLate() uint32 { + if x != nil && x.Late != nil { + return *x.Late + } + return 0 +} + +func (x *UserStats_Stats) GetLost() uint32 { + if x != nil && x.Lost != nil { + return *x.Lost + } + return 0 +} + +func (x *UserStats_Stats) GetResync() uint32 { + if x != nil && x.Resync != nil { + return *x.Resync + } + return 0 +} + +type UserStats_RollingStats struct { + state protoimpl.MessageState `protogen:"open.v1"` + // Rolling packet statistics time window as defined on the server. + TimeWindow *uint32 `protobuf:"varint,1,opt,name=time_window,json=timeWindow" json:"time_window,omitempty"` + // Rolling packet statistics for packets received from the client. + FromClient *UserStats_Stats `protobuf:"bytes,2,opt,name=from_client,json=fromClient" json:"from_client,omitempty"` + // Rolling packet statistics for packets sent by the server. + FromServer *UserStats_Stats `protobuf:"bytes,3,opt,name=from_server,json=fromServer" json:"from_server,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *UserStats_RollingStats) Reset() { + *x = UserStats_RollingStats{} + mi := &file_Mumble_proto_msgTypes[34] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *UserStats_RollingStats) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UserStats_RollingStats) ProtoMessage() {} + +func (x *UserStats_RollingStats) ProtoReflect() protoreflect.Message { + mi := &file_Mumble_proto_msgTypes[34] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UserStats_RollingStats.ProtoReflect.Descriptor instead. +func (*UserStats_RollingStats) Descriptor() ([]byte, []int) { + return file_Mumble_proto_rawDescGZIP(), []int{22, 1} +} + +func (x *UserStats_RollingStats) GetTimeWindow() uint32 { + if x != nil && x.TimeWindow != nil { + return *x.TimeWindow + } + return 0 +} + +func (x *UserStats_RollingStats) GetFromClient() *UserStats_Stats { + if x != nil { + return x.FromClient + } + return nil +} + +func (x *UserStats_RollingStats) GetFromServer() *UserStats_Stats { + if x != nil { + return x.FromServer + } + return nil +} + +var File_Mumble_proto protoreflect.FileDescriptor + +const file_Mumble_proto_rawDesc = "" + + "\n" + + "\fMumble.proto\x12\vMumbleProto\"\x90\x01\n" + + "\aVersion\x12\x1d\n" + + "\n" + + "version_v1\x18\x01 \x01(\rR\tversionV1\x12\x1d\n" + + "\n" + + "version_v2\x18\x05 \x01(\x04R\tversionV2\x12\x18\n" + + "\arelease\x18\x02 \x01(\tR\arelease\x12\x0e\n" + + "\x02os\x18\x03 \x01(\tR\x02os\x12\x1d\n" + + "\n" + + "os_version\x18\x04 \x01(\tR\tosVersion\"#\n" + + "\tUDPTunnel\x12\x16\n" + + "\x06packet\x18\x01 \x02(\fR\x06packet\"\xc2\x01\n" + + "\fAuthenticate\x12\x1a\n" + + "\busername\x18\x01 \x01(\tR\busername\x12\x1a\n" + + "\bpassword\x18\x02 \x01(\tR\bpassword\x12\x16\n" + + "\x06tokens\x18\x03 \x03(\tR\x06tokens\x12#\n" + + "\rcelt_versions\x18\x04 \x03(\x05R\fceltVersions\x12\x19\n" + + "\x04opus\x18\x05 \x01(\b:\x05falseR\x04opus\x12\"\n" + + "\vclient_type\x18\x06 \x01(\x05:\x010R\n" + + "clientType\"\xc2\x02\n" + + "\x04Ping\x12\x1c\n" + + "\ttimestamp\x18\x01 \x01(\x04R\ttimestamp\x12\x12\n" + + "\x04good\x18\x02 \x01(\rR\x04good\x12\x12\n" + + "\x04late\x18\x03 \x01(\rR\x04late\x12\x12\n" + + "\x04lost\x18\x04 \x01(\rR\x04lost\x12\x16\n" + + "\x06resync\x18\x05 \x01(\rR\x06resync\x12\x1f\n" + + "\vudp_packets\x18\x06 \x01(\rR\n" + + "udpPackets\x12\x1f\n" + + "\vtcp_packets\x18\a \x01(\rR\n" + + "tcpPackets\x12 \n" + + "\fudp_ping_avg\x18\b \x01(\x02R\n" + + "udpPingAvg\x12 \n" + + "\fudp_ping_var\x18\t \x01(\x02R\n" + + "udpPingVar\x12 \n" + + "\ftcp_ping_avg\x18\n" + + " \x01(\x02R\n" + + "tcpPingAvg\x12 \n" + + "\ftcp_ping_var\x18\v \x01(\x02R\n" + + "tcpPingVar\"\x9b\x02\n" + + "\x06Reject\x122\n" + + "\x04type\x18\x01 \x01(\x0e2\x1e.MumbleProto.Reject.RejectTypeR\x04type\x12\x16\n" + + "\x06reason\x18\x02 \x01(\tR\x06reason\"\xc4\x01\n" + + "\n" + + "RejectType\x12\b\n" + + "\x04None\x10\x00\x12\x10\n" + + "\fWrongVersion\x10\x01\x12\x13\n" + + "\x0fInvalidUsername\x10\x02\x12\x0f\n" + + "\vWrongUserPW\x10\x03\x12\x11\n" + + "\rWrongServerPW\x10\x04\x12\x11\n" + + "\rUsernameInUse\x10\x05\x12\x0e\n" + + "\n" + + "ServerFull\x10\x06\x12\x11\n" + + "\rNoCertificate\x10\a\x12\x15\n" + + "\x11AuthenticatorFail\x10\b\x12\x14\n" + + "\x10NoNewConnections\x10\t\"\x90\x01\n" + + "\n" + + "ServerSync\x12\x18\n" + + "\asession\x18\x01 \x01(\rR\asession\x12#\n" + + "\rmax_bandwidth\x18\x02 \x01(\rR\fmaxBandwidth\x12!\n" + + "\fwelcome_text\x18\x03 \x01(\tR\vwelcomeText\x12 \n" + + "\vpermissions\x18\x04 \x01(\x04R\vpermissions\".\n" + + "\rChannelRemove\x12\x1d\n" + + "\n" + + "channel_id\x18\x01 \x02(\rR\tchannelId\"\xaa\x03\n" + + "\fChannelState\x12\x1d\n" + + "\n" + + "channel_id\x18\x01 \x01(\rR\tchannelId\x12\x16\n" + + "\x06parent\x18\x02 \x01(\rR\x06parent\x12\x12\n" + + "\x04name\x18\x03 \x01(\tR\x04name\x12\x14\n" + + "\x05links\x18\x04 \x03(\rR\x05links\x12 \n" + + "\vdescription\x18\x05 \x01(\tR\vdescription\x12\x1b\n" + + "\tlinks_add\x18\x06 \x03(\rR\blinksAdd\x12!\n" + + "\flinks_remove\x18\a \x03(\rR\vlinksRemove\x12#\n" + + "\ttemporary\x18\b \x01(\b:\x05falseR\ttemporary\x12\x1d\n" + + "\bposition\x18\t \x01(\x05:\x010R\bposition\x12)\n" + + "\x10description_hash\x18\n" + + " \x01(\fR\x0fdescriptionHash\x12\x1b\n" + + "\tmax_users\x18\v \x01(\rR\bmaxUsers\x12.\n" + + "\x13is_enter_restricted\x18\f \x01(\bR\x11isEnterRestricted\x12\x1b\n" + + "\tcan_enter\x18\r \x01(\bR\bcanEnter\"\xa6\x01\n" + + "\n" + + "UserRemove\x12\x18\n" + + "\asession\x18\x01 \x02(\rR\asession\x12\x14\n" + + "\x05actor\x18\x02 \x01(\rR\x05actor\x12\x16\n" + + "\x06reason\x18\x03 \x01(\tR\x06reason\x12\x10\n" + + "\x03ban\x18\x04 \x01(\bR\x03ban\x12'\n" + + "\x0fban_certificate\x18\x05 \x01(\bR\x0ebanCertificate\x12\x15\n" + + "\x06ban_ip\x18\x06 \x01(\bR\x05banIp\"\xa9\a\n" + + "\tUserState\x12\x18\n" + + "\asession\x18\x01 \x01(\rR\asession\x12\x14\n" + + "\x05actor\x18\x02 \x01(\rR\x05actor\x12\x12\n" + + "\x04name\x18\x03 \x01(\tR\x04name\x12\x17\n" + + "\auser_id\x18\x04 \x01(\rR\x06userId\x12\x1d\n" + + "\n" + + "channel_id\x18\x05 \x01(\rR\tchannelId\x12\x12\n" + + "\x04mute\x18\x06 \x01(\bR\x04mute\x12\x12\n" + + "\x04deaf\x18\a \x01(\bR\x04deaf\x12\x1a\n" + + "\bsuppress\x18\b \x01(\bR\bsuppress\x12\x1b\n" + + "\tself_mute\x18\t \x01(\bR\bselfMute\x12\x1b\n" + + "\tself_deaf\x18\n" + + " \x01(\bR\bselfDeaf\x12\x18\n" + + "\atexture\x18\v \x01(\fR\atexture\x12%\n" + + "\x0eplugin_context\x18\f \x01(\fR\rpluginContext\x12'\n" + + "\x0fplugin_identity\x18\r \x01(\tR\x0epluginIdentity\x12\x18\n" + + "\acomment\x18\x0e \x01(\tR\acomment\x12\x12\n" + + "\x04hash\x18\x0f \x01(\tR\x04hash\x12!\n" + + "\fcomment_hash\x18\x10 \x01(\fR\vcommentHash\x12!\n" + + "\ftexture_hash\x18\x11 \x01(\fR\vtextureHash\x12)\n" + + "\x10priority_speaker\x18\x12 \x01(\bR\x0fprioritySpeaker\x12\x1c\n" + + "\trecording\x18\x13 \x01(\bR\trecording\x126\n" + + "\x17temporary_access_tokens\x18\x14 \x03(\tR\x15temporaryAccessTokens\x122\n" + + "\x15listening_channel_add\x18\x15 \x03(\rR\x13listeningChannelAdd\x128\n" + + "\x18listening_channel_remove\x18\x16 \x03(\rR\x16listeningChannelRemove\x12g\n" + + "\x1blistening_volume_adjustment\x18\x17 \x03(\v2'.MumbleProto.UserState.VolumeAdjustmentR\x19listeningVolumeAdjustment\x1al\n" + + "\x10VolumeAdjustment\x12+\n" + + "\x11listening_channel\x18\x01 \x01(\rR\x10listeningChannel\x12+\n" + + "\x11volume_adjustment\x18\x02 \x01(\x02R\x10volumeAdjustment\"\x86\x02\n" + + "\aBanList\x121\n" + + "\x04bans\x18\x01 \x03(\v2\x1d.MumbleProto.BanList.BanEntryR\x04bans\x12\x1b\n" + + "\x05query\x18\x02 \x01(\b:\x05falseR\x05query\x1a\xaa\x01\n" + + "\bBanEntry\x12\x18\n" + + "\aaddress\x18\x01 \x02(\fR\aaddress\x12\x12\n" + + "\x04mask\x18\x02 \x02(\rR\x04mask\x12\x12\n" + + "\x04name\x18\x03 \x01(\tR\x04name\x12\x12\n" + + "\x04hash\x18\x04 \x01(\tR\x04hash\x12\x16\n" + + "\x06reason\x18\x05 \x01(\tR\x06reason\x12\x14\n" + + "\x05start\x18\x06 \x01(\tR\x05start\x12\x1a\n" + + "\bduration\x18\a \x01(\rR\bduration\"\x8f\x01\n" + + "\vTextMessage\x12\x14\n" + + "\x05actor\x18\x01 \x01(\rR\x05actor\x12\x18\n" + + "\asession\x18\x02 \x03(\rR\asession\x12\x1d\n" + + "\n" + + "channel_id\x18\x03 \x03(\rR\tchannelId\x12\x17\n" + + "\atree_id\x18\x04 \x03(\rR\x06treeId\x12\x18\n" + + "\amessage\x18\x05 \x02(\tR\amessage\"\xdb\x03\n" + + "\x10PermissionDenied\x12\x1e\n" + + "\n" + + "permission\x18\x01 \x01(\rR\n" + + "permission\x12\x1d\n" + + "\n" + + "channel_id\x18\x02 \x01(\rR\tchannelId\x12\x18\n" + + "\asession\x18\x03 \x01(\rR\asession\x12\x16\n" + + "\x06reason\x18\x04 \x01(\tR\x06reason\x12:\n" + + "\x04type\x18\x05 \x01(\x0e2&.MumbleProto.PermissionDenied.DenyTypeR\x04type\x12\x12\n" + + "\x04name\x18\x06 \x01(\tR\x04name\"\x85\x02\n" + + "\bDenyType\x12\b\n" + + "\x04Text\x10\x00\x12\x0e\n" + + "\n" + + "Permission\x10\x01\x12\r\n" + + "\tSuperUser\x10\x02\x12\x0f\n" + + "\vChannelName\x10\x03\x12\x0f\n" + + "\vTextTooLong\x10\x04\x12\a\n" + + "\x03H9K\x10\x05\x12\x14\n" + + "\x10TemporaryChannel\x10\x06\x12\x16\n" + + "\x12MissingCertificate\x10\a\x12\f\n" + + "\bUserName\x10\b\x12\x0f\n" + + "\vChannelFull\x10\t\x12\x10\n" + + "\fNestingLimit\x10\n" + + "\x12\x15\n" + + "\x11ChannelCountLimit\x10\v\x12\x18\n" + + "\x14ChannelListenerLimit\x10\f\x12\x15\n" + + "\x11UserListenerLimit\x10\r\"\x84\x05\n" + + "\x03ACL\x12\x1d\n" + + "\n" + + "channel_id\x18\x01 \x02(\rR\tchannelId\x12'\n" + + "\finherit_acls\x18\x02 \x01(\b:\x04trueR\vinheritAcls\x122\n" + + "\x06groups\x18\x03 \x03(\v2\x1a.MumbleProto.ACL.ChanGroupR\x06groups\x12,\n" + + "\x04acls\x18\x04 \x03(\v2\x18.MumbleProto.ACL.ChanACLR\x04acls\x12\x1b\n" + + "\x05query\x18\x05 \x01(\b:\x05falseR\x05query\x1a\xe2\x01\n" + + "\tChanGroup\x12\x12\n" + + "\x04name\x18\x01 \x02(\tR\x04name\x12\"\n" + + "\tinherited\x18\x02 \x01(\b:\x04trueR\tinherited\x12\x1e\n" + + "\ainherit\x18\x03 \x01(\b:\x04trueR\ainherit\x12&\n" + + "\vinheritable\x18\x04 \x01(\b:\x04trueR\vinheritable\x12\x10\n" + + "\x03add\x18\x05 \x03(\rR\x03add\x12\x16\n" + + "\x06remove\x18\x06 \x03(\rR\x06remove\x12+\n" + + "\x11inherited_members\x18\a \x03(\rR\x10inheritedMembers\x1a\xd0\x01\n" + + "\aChanACL\x12#\n" + + "\n" + + "apply_here\x18\x01 \x01(\b:\x04trueR\tapplyHere\x12#\n" + + "\n" + + "apply_subs\x18\x02 \x01(\b:\x04trueR\tapplySubs\x12\"\n" + + "\tinherited\x18\x03 \x01(\b:\x04trueR\tinherited\x12\x17\n" + + "\auser_id\x18\x04 \x01(\rR\x06userId\x12\x14\n" + + "\x05group\x18\x05 \x01(\tR\x05group\x12\x14\n" + + "\x05grant\x18\x06 \x01(\rR\x05grant\x12\x12\n" + + "\x04deny\x18\a \x01(\rR\x04deny\"4\n" + + "\n" + + "QueryUsers\x12\x10\n" + + "\x03ids\x18\x01 \x03(\rR\x03ids\x12\x14\n" + + "\x05names\x18\x02 \x03(\tR\x05names\"d\n" + + "\n" + + "CryptSetup\x12\x10\n" + + "\x03key\x18\x01 \x01(\fR\x03key\x12!\n" + + "\fclient_nonce\x18\x02 \x01(\fR\vclientNonce\x12!\n" + + "\fserver_nonce\x18\x03 \x01(\fR\vserverNonce\"\xf5\x01\n" + + "\x13ContextActionModify\x12\x16\n" + + "\x06action\x18\x01 \x02(\tR\x06action\x12\x12\n" + + "\x04text\x18\x02 \x01(\tR\x04text\x12\x18\n" + + "\acontext\x18\x03 \x01(\rR\acontext\x12H\n" + + "\toperation\x18\x04 \x01(\x0e2*.MumbleProto.ContextActionModify.OperationR\toperation\",\n" + + "\aContext\x12\n" + + "\n" + + "\x06Server\x10\x01\x12\v\n" + + "\aChannel\x10\x02\x12\b\n" + + "\x04User\x10\x04\" \n" + + "\tOperation\x12\a\n" + + "\x03Add\x10\x00\x12\n" + + "\n" + + "\x06Remove\x10\x01\"`\n" + + "\rContextAction\x12\x18\n" + + "\asession\x18\x01 \x01(\rR\asession\x12\x1d\n" + + "\n" + + "channel_id\x18\x02 \x01(\rR\tchannelId\x12\x16\n" + + "\x06action\x18\x03 \x02(\tR\x06action\"\xb1\x01\n" + + "\bUserList\x120\n" + + "\x05users\x18\x01 \x03(\v2\x1a.MumbleProto.UserList.UserR\x05users\x1as\n" + + "\x04User\x12\x17\n" + + "\auser_id\x18\x01 \x02(\rR\x06userId\x12\x12\n" + + "\x04name\x18\x02 \x01(\tR\x04name\x12\x1b\n" + + "\tlast_seen\x18\x03 \x01(\tR\blastSeen\x12!\n" + + "\flast_channel\x18\x04 \x01(\rR\vlastChannel\"\xf2\x01\n" + + "\vVoiceTarget\x12\x0e\n" + + "\x02id\x18\x01 \x01(\rR\x02id\x129\n" + + "\atargets\x18\x02 \x03(\v2\x1f.MumbleProto.VoiceTarget.TargetR\atargets\x1a\x97\x01\n" + + "\x06Target\x12\x18\n" + + "\asession\x18\x01 \x03(\rR\asession\x12\x1d\n" + + "\n" + + "channel_id\x18\x02 \x01(\rR\tchannelId\x12\x14\n" + + "\x05group\x18\x03 \x01(\tR\x05group\x12\x1b\n" + + "\x05links\x18\x04 \x01(\b:\x05falseR\x05links\x12!\n" + + "\bchildren\x18\x05 \x01(\b:\x05falseR\bchildren\"o\n" + + "\x0fPermissionQuery\x12\x1d\n" + + "\n" + + "channel_id\x18\x01 \x01(\rR\tchannelId\x12 \n" + + "\vpermissions\x18\x02 \x01(\rR\vpermissions\x12\x1b\n" + + "\x05flush\x18\x03 \x01(\b:\x05falseR\x05flush\"|\n" + + "\fCodecVersion\x12\x14\n" + + "\x05alpha\x18\x01 \x02(\x05R\x05alpha\x12\x12\n" + + "\x04beta\x18\x02 \x02(\x05R\x04beta\x12'\n" + + "\fprefer_alpha\x18\x03 \x02(\b:\x04trueR\vpreferAlpha\x12\x19\n" + + "\x04opus\x18\x04 \x01(\b:\x05falseR\x04opus\"\xa8\b\n" + + "\tUserStats\x12\x18\n" + + "\asession\x18\x01 \x01(\rR\asession\x12$\n" + + "\n" + + "stats_only\x18\x02 \x01(\b:\x05falseR\tstatsOnly\x12\"\n" + + "\fcertificates\x18\x03 \x03(\fR\fcertificates\x12=\n" + + "\vfrom_client\x18\x04 \x01(\v2\x1c.MumbleProto.UserStats.StatsR\n" + + "fromClient\x12=\n" + + "\vfrom_server\x18\x05 \x01(\v2\x1c.MumbleProto.UserStats.StatsR\n" + + "fromServer\x12\x1f\n" + + "\vudp_packets\x18\x06 \x01(\rR\n" + + "udpPackets\x12\x1f\n" + + "\vtcp_packets\x18\a \x01(\rR\n" + + "tcpPackets\x12 \n" + + "\fudp_ping_avg\x18\b \x01(\x02R\n" + + "udpPingAvg\x12 \n" + + "\fudp_ping_var\x18\t \x01(\x02R\n" + + "udpPingVar\x12 \n" + + "\ftcp_ping_avg\x18\n" + + " \x01(\x02R\n" + + "tcpPingAvg\x12 \n" + + "\ftcp_ping_var\x18\v \x01(\x02R\n" + + "tcpPingVar\x12.\n" + + "\aversion\x18\f \x01(\v2\x14.MumbleProto.VersionR\aversion\x12#\n" + + "\rcelt_versions\x18\r \x03(\x05R\fceltVersions\x12\x18\n" + + "\aaddress\x18\x0e \x01(\fR\aaddress\x12\x1c\n" + + "\tbandwidth\x18\x0f \x01(\rR\tbandwidth\x12\x1e\n" + + "\n" + + "onlinesecs\x18\x10 \x01(\rR\n" + + "onlinesecs\x12\x1a\n" + + "\bidlesecs\x18\x11 \x01(\rR\bidlesecs\x124\n" + + "\x12strong_certificate\x18\x12 \x01(\b:\x05falseR\x11strongCertificate\x12\x19\n" + + "\x04opus\x18\x13 \x01(\b:\x05falseR\x04opus\x12H\n" + + "\rrolling_stats\x18\x14 \x01(\v2#.MumbleProto.UserStats.RollingStatsR\frollingStats\x1a[\n" + + "\x05Stats\x12\x12\n" + + "\x04good\x18\x01 \x01(\rR\x04good\x12\x12\n" + + "\x04late\x18\x02 \x01(\rR\x04late\x12\x12\n" + + "\x04lost\x18\x03 \x01(\rR\x04lost\x12\x16\n" + + "\x06resync\x18\x04 \x01(\rR\x06resync\x1a\xad\x01\n" + + "\fRollingStats\x12\x1f\n" + + "\vtime_window\x18\x01 \x01(\rR\n" + + "timeWindow\x12=\n" + + "\vfrom_client\x18\x02 \x01(\v2\x1c.MumbleProto.UserStats.StatsR\n" + + "fromClient\x12=\n" + + "\vfrom_server\x18\x03 \x01(\v2\x1c.MumbleProto.UserStats.StatsR\n" + + "fromServer\"\x90\x01\n" + + "\vRequestBlob\x12'\n" + + "\x0fsession_texture\x18\x01 \x03(\rR\x0esessionTexture\x12'\n" + + "\x0fsession_comment\x18\x02 \x03(\rR\x0esessionComment\x12/\n" + + "\x13channel_description\x18\x03 \x03(\rR\x12channelDescription\"\x98\x02\n" + + "\fServerConfig\x12#\n" + + "\rmax_bandwidth\x18\x01 \x01(\rR\fmaxBandwidth\x12!\n" + + "\fwelcome_text\x18\x02 \x01(\tR\vwelcomeText\x12\x1d\n" + + "\n" + + "allow_html\x18\x03 \x01(\bR\tallowHtml\x12%\n" + + "\x0emessage_length\x18\x04 \x01(\rR\rmessageLength\x120\n" + + "\x14image_message_length\x18\x05 \x01(\rR\x12imageMessageLength\x12\x1b\n" + + "\tmax_users\x18\x06 \x01(\rR\bmaxUsers\x12+\n" + + "\x11recording_allowed\x18\a \x01(\bR\x10recordingAllowed\"\x8f\x01\n" + + "\rSuggestConfig\x12\x1d\n" + + "\n" + + "version_v1\x18\x01 \x01(\rR\tversionV1\x12\x1d\n" + + "\n" + + "version_v2\x18\x04 \x01(\x04R\tversionV2\x12\x1e\n" + + "\n" + + "positional\x18\x02 \x01(\bR\n" + + "positional\x12 \n" + + "\fpush_to_talk\x18\x03 \x01(\bR\n" + + "pushToTalk\"\x9a\x01\n" + + "\x16PluginDataTransmission\x12$\n" + + "\rsenderSession\x18\x01 \x01(\rR\rsenderSession\x12.\n" + + "\x10receiverSessions\x18\x02 \x03(\rB\x02\x10\x01R\x10receiverSessions\x12\x12\n" + + "\x04data\x18\x03 \x01(\fR\x04data\x12\x16\n" + + "\x06dataID\x18\x04 \x01(\tR\x06dataIDB\x02H\x01" + +var ( + file_Mumble_proto_rawDescOnce sync.Once + file_Mumble_proto_rawDescData []byte +) + +func file_Mumble_proto_rawDescGZIP() []byte { + file_Mumble_proto_rawDescOnce.Do(func() { + file_Mumble_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_Mumble_proto_rawDesc), len(file_Mumble_proto_rawDesc))) + }) + return file_Mumble_proto_rawDescData +} + +var file_Mumble_proto_enumTypes = make([]protoimpl.EnumInfo, 4) +var file_Mumble_proto_msgTypes = make([]protoimpl.MessageInfo, 35) +var file_Mumble_proto_goTypes = []any{ + (Reject_RejectType)(0), // 0: MumbleProto.Reject.RejectType + (PermissionDenied_DenyType)(0), // 1: MumbleProto.PermissionDenied.DenyType + (ContextActionModify_Context)(0), // 2: MumbleProto.ContextActionModify.Context + (ContextActionModify_Operation)(0), // 3: MumbleProto.ContextActionModify.Operation + (*Version)(nil), // 4: MumbleProto.Version + (*UDPTunnel)(nil), // 5: MumbleProto.UDPTunnel + (*Authenticate)(nil), // 6: MumbleProto.Authenticate + (*Ping)(nil), // 7: MumbleProto.Ping + (*Reject)(nil), // 8: MumbleProto.Reject + (*ServerSync)(nil), // 9: MumbleProto.ServerSync + (*ChannelRemove)(nil), // 10: MumbleProto.ChannelRemove + (*ChannelState)(nil), // 11: MumbleProto.ChannelState + (*UserRemove)(nil), // 12: MumbleProto.UserRemove + (*UserState)(nil), // 13: MumbleProto.UserState + (*BanList)(nil), // 14: MumbleProto.BanList + (*TextMessage)(nil), // 15: MumbleProto.TextMessage + (*PermissionDenied)(nil), // 16: MumbleProto.PermissionDenied + (*ACL)(nil), // 17: MumbleProto.ACL + (*QueryUsers)(nil), // 18: MumbleProto.QueryUsers + (*CryptSetup)(nil), // 19: MumbleProto.CryptSetup + (*ContextActionModify)(nil), // 20: MumbleProto.ContextActionModify + (*ContextAction)(nil), // 21: MumbleProto.ContextAction + (*UserList)(nil), // 22: MumbleProto.UserList + (*VoiceTarget)(nil), // 23: MumbleProto.VoiceTarget + (*PermissionQuery)(nil), // 24: MumbleProto.PermissionQuery + (*CodecVersion)(nil), // 25: MumbleProto.CodecVersion + (*UserStats)(nil), // 26: MumbleProto.UserStats + (*RequestBlob)(nil), // 27: MumbleProto.RequestBlob + (*ServerConfig)(nil), // 28: MumbleProto.ServerConfig + (*SuggestConfig)(nil), // 29: MumbleProto.SuggestConfig + (*PluginDataTransmission)(nil), // 30: MumbleProto.PluginDataTransmission + (*UserState_VolumeAdjustment)(nil), // 31: MumbleProto.UserState.VolumeAdjustment + (*BanList_BanEntry)(nil), // 32: MumbleProto.BanList.BanEntry + (*ACL_ChanGroup)(nil), // 33: MumbleProto.ACL.ChanGroup + (*ACL_ChanACL)(nil), // 34: MumbleProto.ACL.ChanACL + (*UserList_User)(nil), // 35: MumbleProto.UserList.User + (*VoiceTarget_Target)(nil), // 36: MumbleProto.VoiceTarget.Target + (*UserStats_Stats)(nil), // 37: MumbleProto.UserStats.Stats + (*UserStats_RollingStats)(nil), // 38: MumbleProto.UserStats.RollingStats +} +var file_Mumble_proto_depIdxs = []int32{ + 0, // 0: MumbleProto.Reject.type:type_name -> MumbleProto.Reject.RejectType + 31, // 1: MumbleProto.UserState.listening_volume_adjustment:type_name -> MumbleProto.UserState.VolumeAdjustment + 32, // 2: MumbleProto.BanList.bans:type_name -> MumbleProto.BanList.BanEntry + 1, // 3: MumbleProto.PermissionDenied.type:type_name -> MumbleProto.PermissionDenied.DenyType + 33, // 4: MumbleProto.ACL.groups:type_name -> MumbleProto.ACL.ChanGroup + 34, // 5: MumbleProto.ACL.acls:type_name -> MumbleProto.ACL.ChanACL + 3, // 6: MumbleProto.ContextActionModify.operation:type_name -> MumbleProto.ContextActionModify.Operation + 35, // 7: MumbleProto.UserList.users:type_name -> MumbleProto.UserList.User + 36, // 8: MumbleProto.VoiceTarget.targets:type_name -> MumbleProto.VoiceTarget.Target + 37, // 9: MumbleProto.UserStats.from_client:type_name -> MumbleProto.UserStats.Stats + 37, // 10: MumbleProto.UserStats.from_server:type_name -> MumbleProto.UserStats.Stats + 4, // 11: MumbleProto.UserStats.version:type_name -> MumbleProto.Version + 38, // 12: MumbleProto.UserStats.rolling_stats:type_name -> MumbleProto.UserStats.RollingStats + 37, // 13: MumbleProto.UserStats.RollingStats.from_client:type_name -> MumbleProto.UserStats.Stats + 37, // 14: MumbleProto.UserStats.RollingStats.from_server:type_name -> MumbleProto.UserStats.Stats + 15, // [15:15] is the sub-list for method output_type + 15, // [15:15] is the sub-list for method input_type + 15, // [15:15] is the sub-list for extension type_name + 15, // [15:15] is the sub-list for extension extendee + 0, // [0:15] is the sub-list for field type_name +} + +func init() { file_Mumble_proto_init() } +func file_Mumble_proto_init() { + if File_Mumble_proto != nil { + return + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: unsafe.Slice(unsafe.StringData(file_Mumble_proto_rawDesc), len(file_Mumble_proto_rawDesc)), + NumEnums: 4, + NumMessages: 35, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_Mumble_proto_goTypes, + DependencyIndexes: file_Mumble_proto_depIdxs, + EnumInfos: file_Mumble_proto_enumTypes, + MessageInfos: file_Mumble_proto_msgTypes, + }.Build() + File_Mumble_proto = out.File + file_Mumble_proto_goTypes = nil + file_Mumble_proto_depIdxs = nil } diff --git a/gumble/gumble/MumbleProto/generate.go b/gumble/gumble/MumbleProto/generate.go index d14460a..2560d16 100644 --- a/gumble/gumble/MumbleProto/generate.go +++ b/gumble/gumble/MumbleProto/generate.go @@ -1,5 +1,2 @@ -//go:generate wget -O Mumble.proto https://raw.githubusercontent.com/mumble-voip/mumble/master/src/Mumble.proto -//go:generate protoc --go_out=. Mumble.proto -//go:generate rm -f Mumble.proto -//go:generate sed -i "s/^\\(package MumbleProto\\)$/\\1 \\/\\/ import \"layeh.com\\/gumble\\/gumble\\/MumbleProto\"/" Mumble.pb.go +//go:generate sh -c "curl -L -sS -o Mumble.proto https://raw.githubusercontent.com/mumble-voip/mumble/master/src/Mumble.proto && protoc --go_out=. --go_opt=paths=source_relative --go_opt=MMumble.proto=git.stormux.org/storm/barnard/gumble/gumble/MumbleProto Mumble.proto && rm -f Mumble.proto" package MumbleProto diff --git a/gumble/gumble/acl.go b/gumble/gumble/acl.go index 55380a3..c508c7e 100644 --- a/gumble/gumble/acl.go +++ b/gumble/gumble/acl.go @@ -2,7 +2,7 @@ package gumble import ( "git.stormux.org/storm/barnard/gumble/gumble/MumbleProto" - "github.com/golang/protobuf/proto" + "google.golang.org/protobuf/proto" ) // ACL contains a list of ACLGroups and ACLRules linked to a channel. diff --git a/gumble/gumble/bans.go b/gumble/gumble/bans.go index 0982cb3..01427f6 100644 --- a/gumble/gumble/bans.go +++ b/gumble/gumble/bans.go @@ -5,7 +5,7 @@ import ( "time" "git.stormux.org/storm/barnard/gumble/gumble/MumbleProto" - "github.com/golang/protobuf/proto" + "google.golang.org/protobuf/proto" ) // BanList is a list of server ban entries. diff --git a/gumble/gumble/channel.go b/gumble/gumble/channel.go index c9440cd..b9bf16e 100644 --- a/gumble/gumble/channel.go +++ b/gumble/gumble/channel.go @@ -2,7 +2,7 @@ package gumble import ( "git.stormux.org/storm/barnard/gumble/gumble/MumbleProto" - "github.com/golang/protobuf/proto" + "google.golang.org/protobuf/proto" ) // Channel represents a channel in the server's channel tree. @@ -102,15 +102,18 @@ func (c *Channel) SetMaxUsers(maxUsers uint32) { // is equal to the arguments passed. // // For example, given the following server channel tree: -// Root -// Child 1 -// Child 2 -// Child 2.1 -// Child 2.2 -// Child 2.2.1 -// Child 3 +// +// Root +// Child 1 +// Child 2 +// Child 2.1 +// Child 2.2 +// Child 2.2.1 +// Child 3 +// // To get the "Child 2.2.1" channel: -// root.Find("Child 2", "Child 2.2", "Child 2.2.1") +// +// root.Find("Child 2", "Child 2.2", "Child 2.2.1") func (c *Channel) Find(names ...string) *Channel { if len(names) == 0 { return c diff --git a/gumble/gumble/client.go b/gumble/gumble/client.go index 7fcdbb2..e77395b 100644 --- a/gumble/gumble/client.go +++ b/gumble/gumble/client.go @@ -10,7 +10,7 @@ import ( "time" "git.stormux.org/storm/barnard/gumble/gumble/MumbleProto" - "github.com/golang/protobuf/proto" + "google.golang.org/protobuf/proto" ) // State is the current state of the client's connection to the server. @@ -119,7 +119,7 @@ func DialWithDialer(dialer *net.Dialer, config *Config, tlsConfig *tls.Config) ( // Initial packets versionPacket := MumbleProto.Version{ - Version: proto.Uint32(ClientVersion), + VersionV1: proto.Uint32(ClientVersion), Release: proto.String("gumble"), Os: proto.String(runtime.GOOS), OsVersion: proto.String(runtime.GOARCH), diff --git a/gumble/gumble/conn.go b/gumble/gumble/conn.go index eaace59..61572f4 100644 --- a/gumble/gumble/conn.go +++ b/gumble/gumble/conn.go @@ -10,7 +10,7 @@ import ( "git.stormux.org/storm/barnard/gumble/gumble/MumbleProto" "git.stormux.org/storm/barnard/gumble/gumble/varint" - "github.com/golang/protobuf/proto" + "google.golang.org/protobuf/proto" ) // DefaultPort is the default port on which Mumble servers listen. diff --git a/gumble/gumble/doc.go b/gumble/gumble/doc.go index e6358fe..6a53c53 100644 --- a/gumble/gumble/doc.go +++ b/gumble/gumble/doc.go @@ -1,42 +1,43 @@ // Package gumble is a client for the Mumble voice chat software. // -// Getting started +// # Getting started // // 1. Create a new Config to hold your connection settings: // -// config := gumble.NewConfig() -// config.Username = "gumble-test" +// config := gumble.NewConfig() +// config.Username = "gumble-test" // // 2. Attach event listeners to the configuration: // -// config.Attach(gumbleutil.Listener{ -// TextMessage: func(e *gumble.TextMessageEvent) { -// fmt.Printf("Received text message: %s\n", e.Message) -// }, -// }) +// config.Attach(gumbleutil.Listener{ +// TextMessage: func(e *gumble.TextMessageEvent) { +// fmt.Printf("Received text message: %s\n", e.Message) +// }, +// }) // // 3. Connect to the server: // -// client, err := gumble.Dial("example.com:64738", config) -// if err != nil { -// panic(err) -// } +// client, err := gumble.Dial("example.com:64738", config) +// if err != nil { +// panic(err) +// } // -// Audio codecs +// # Audio codecs // // Currently, only the Opus codec (https://www.opus-codec.org/) is supported // for transmitting and receiving audio. It can be enabled by importing the // following package for its side effect: -// import ( -// _ "git.stormux.org/storm/barnard/gumble/opus" -// ) +// +// import ( +// _ "git.stormux.org/storm/barnard/gumble/opus" +// ) // // To ensure that gumble clients can always transmit and receive audio to and // from your server, add the following line to your murmur configuration file: // -// opusthreshold=0 +// opusthreshold=0 // -// Thread safety +// # Thread safety // // As a general rule, a Client everything that is associated with it // (Users, Channels, Config, etc.), is thread-unsafe. Accessing or modifying diff --git a/gumble/gumble/handlers.go b/gumble/gumble/handlers.go index f53cb35..a0278da 100644 --- a/gumble/gumble/handlers.go +++ b/gumble/gumble/handlers.go @@ -11,7 +11,7 @@ import ( "git.stormux.org/storm/barnard/gumble/gumble/MumbleProto" "git.stormux.org/storm/barnard/gumble/gumble/varint" - "github.com/golang/protobuf/proto" + "google.golang.org/protobuf/proto" ) var ( @@ -53,8 +53,8 @@ var handlers = [...]func(*Client, []byte) error{ func parseVersion(packet *MumbleProto.Version) Version { var version Version - if packet.Version != nil { - version.Version = *packet.Version + if packet.VersionV1 != nil { + version.Version = *packet.VersionV1 } if packet.Release != nil { version.Release = *packet.Release @@ -1296,9 +1296,9 @@ func (c *Client) handleSuggestConfig(buffer []byte) error { event := ServerConfigEvent{ Client: c, } - if packet.Version != nil { + if packet.VersionV1 != nil { event.SuggestVersion = &Version{ - Version: packet.GetVersion(), + Version: packet.GetVersionV1(), } } if packet.Positional != nil { diff --git a/gumble/gumble/message.go b/gumble/gumble/message.go index a230966..83819f5 100644 --- a/gumble/gumble/message.go +++ b/gumble/gumble/message.go @@ -2,12 +2,13 @@ package gumble // Message is data that be encoded and sent to the server. The following // types implement this interface: -// AccessTokens -// ACL -// BanList -// RegisteredUsers -// TextMessage -// VoiceTarget +// +// AccessTokens +// ACL +// BanList +// RegisteredUsers +// TextMessage +// VoiceTarget type Message interface { writeMessage(client *Client) error } diff --git a/gumble/gumble/user.go b/gumble/gumble/user.go index 328eca3..d23ffe2 100644 --- a/gumble/gumble/user.go +++ b/gumble/gumble/user.go @@ -1,235 +1,235 @@ package gumble import ( - "git.stormux.org/storm/barnard/gumble/gumble/MumbleProto" - "git.stormux.org/storm/barnard/gumble/go-openal/openal" - "github.com/golang/protobuf/proto" + "git.stormux.org/storm/barnard/gumble/go-openal/openal" + "git.stormux.org/storm/barnard/gumble/gumble/MumbleProto" + "google.golang.org/protobuf/proto" ) // User represents a user that is currently connected to the server. type User struct { - // The user's unique session ID. - Session uint32 - // The user's ID. Contains an invalid value if the user is not registered. - UserID uint32 - // The user's name. - Name string - // The channel that the user is currently in. - Channel *Channel + // The user's unique session ID. + Session uint32 + // The user's ID. Contains an invalid value if the user is not registered. + UserID uint32 + // The user's name. + Name string + // The channel that the user is currently in. + Channel *Channel - // Has the user has been muted? - Muted bool - // Has the user been deafened? - Deafened bool - // Has the user been suppressed? - Suppressed bool - // Has the user been muted by him/herself? - SelfMuted bool - // Has the user been deafened by him/herself? - SelfDeafened bool - // Is the user a priority speaker in the channel? - PrioritySpeaker bool - // Is the user recording audio? - Recording bool - // Has the user been locally muted by the client? - LocallyMuted bool + // Has the user has been muted? + Muted bool + // Has the user been deafened? + Deafened bool + // Has the user been suppressed? + Suppressed bool + // Has the user been muted by him/herself? + SelfMuted bool + // Has the user been deafened by him/herself? + SelfDeafened bool + // Is the user a priority speaker in the channel? + PrioritySpeaker bool + // Is the user recording audio? + Recording bool + // Has the user been locally muted by the client? + LocallyMuted bool - // The user's comment. Contains the empty string if the user does not have a - // comment, or if the comment needs to be requested. - Comment string - // The user's comment hash. nil if User.Comment has been populated. - CommentHash []byte - // The hash of the user's certificate (can be empty). - Hash string - // The user's texture (avatar). nil if the user does not have a - // texture, or if the texture needs to be requested. - Texture []byte - // The user's texture hash. nil if User.Texture has been populated. - TextureHash []byte + // The user's comment. Contains the empty string if the user does not have a + // comment, or if the comment needs to be requested. + Comment string + // The user's comment hash. nil if User.Comment has been populated. + CommentHash []byte + // The hash of the user's certificate (can be empty). + Hash string + // The user's texture (avatar). nil if the user does not have a + // texture, or if the texture needs to be requested. + Texture []byte + // The user's texture hash. nil if User.Texture has been populated. + TextureHash []byte - // The user's stats. Contains nil if the stats have not yet been requested. - Stats *UserStats + // The user's stats. Contains nil if the stats have not yet been requested. + Stats *UserStats - client *Client - decoder AudioDecoder + client *Client + decoder AudioDecoder - AudioSource *openal.Source - Boost uint16 - Volume float32 + AudioSource *openal.Source + Boost uint16 + Volume float32 } // IsMuted returns true if the user is muted either server-side or locally func (u *User) IsMuted() bool { - return u.Muted || u.LocallyMuted + return u.Muted || u.LocallyMuted } func (u *User) GetClient() *Client { - return u.client + return u.client } // SetTexture sets the user's texture. func (u *User) SetTexture(texture []byte) { - packet := MumbleProto.UserState{ - Session: &u.Session, - Texture: texture, - } - u.client.Conn.WriteProto(&packet) + packet := MumbleProto.UserState{ + Session: &u.Session, + Texture: texture, + } + u.client.Conn.WriteProto(&packet) } // SetPrioritySpeaker sets if the user is a priority speaker in the channel. func (u *User) SetPrioritySpeaker(prioritySpeaker bool) { - packet := MumbleProto.UserState{ - Session: &u.Session, - PrioritySpeaker: &prioritySpeaker, - } - u.client.Conn.WriteProto(&packet) + packet := MumbleProto.UserState{ + Session: &u.Session, + PrioritySpeaker: &prioritySpeaker, + } + u.client.Conn.WriteProto(&packet) } // SetRecording sets if the user is recording audio. func (u *User) SetRecording(recording bool) { - packet := MumbleProto.UserState{ - Session: &u.Session, - Recording: &recording, - } - u.client.Conn.WriteProto(&packet) + packet := MumbleProto.UserState{ + Session: &u.Session, + Recording: &recording, + } + u.client.Conn.WriteProto(&packet) } // IsRegistered returns true if the user's certificate has been registered with // the server. A registered user will have a valid user ID. func (u *User) IsRegistered() bool { - return u.UserID > 0 + return u.UserID > 0 } // Register will register the user with the server. If the client has // permission to do so, the user will shortly be given a UserID. func (u *User) Register() { - packet := MumbleProto.UserState{ - Session: &u.Session, - UserId: proto.Uint32(0), - } - u.client.Conn.WriteProto(&packet) + packet := MumbleProto.UserState{ + Session: &u.Session, + UserId: proto.Uint32(0), + } + u.client.Conn.WriteProto(&packet) } // SetComment will set the user's comment to the given string. The user's // comment will be erased if the comment is set to the empty string. func (u *User) SetComment(comment string) { - packet := MumbleProto.UserState{ - Session: &u.Session, - Comment: &comment, - } - u.client.Conn.WriteProto(&packet) + packet := MumbleProto.UserState{ + Session: &u.Session, + Comment: &comment, + } + u.client.Conn.WriteProto(&packet) } // Move will move the user to the given channel. func (u *User) Move(channel *Channel) { - packet := MumbleProto.UserState{ - Session: &u.Session, - ChannelId: &channel.ID, - } - u.client.Conn.WriteProto(&packet) + packet := MumbleProto.UserState{ + Session: &u.Session, + ChannelId: &channel.ID, + } + u.client.Conn.WriteProto(&packet) } // Kick will kick the user from the server. func (u *User) Kick(reason string) { - packet := MumbleProto.UserRemove{ - Session: &u.Session, - Reason: &reason, - } - u.client.Conn.WriteProto(&packet) + packet := MumbleProto.UserRemove{ + Session: &u.Session, + Reason: &reason, + } + u.client.Conn.WriteProto(&packet) } // Ban will ban the user from the server. func (u *User) Ban(reason string) { - packet := MumbleProto.UserRemove{ - Session: &u.Session, - Reason: &reason, - Ban: proto.Bool(true), - } - u.client.Conn.WriteProto(&packet) + packet := MumbleProto.UserRemove{ + Session: &u.Session, + Reason: &reason, + Ban: proto.Bool(true), + } + u.client.Conn.WriteProto(&packet) } // SetMuted sets whether the user can transmit audio or not. func (u *User) SetMuted(muted bool) { - packet := MumbleProto.UserState{ - Session: &u.Session, - Mute: &muted, - } - u.client.Conn.WriteProto(&packet) + packet := MumbleProto.UserState{ + Session: &u.Session, + Mute: &muted, + } + u.client.Conn.WriteProto(&packet) } // SetSuppressed sets whether the user is suppressed by the server or not. func (u *User) SetSuppressed(supressed bool) { - packet := MumbleProto.UserState{ - Session: &u.Session, - Suppress: &supressed, - } - u.client.Conn.WriteProto(&packet) + packet := MumbleProto.UserState{ + Session: &u.Session, + Suppress: &supressed, + } + u.client.Conn.WriteProto(&packet) } // SetDeafened sets whether the user can receive audio or not. func (u *User) SetDeafened(muted bool) { - packet := MumbleProto.UserState{ - Session: &u.Session, - Deaf: &muted, - } - u.client.Conn.WriteProto(&packet) + packet := MumbleProto.UserState{ + Session: &u.Session, + Deaf: &muted, + } + u.client.Conn.WriteProto(&packet) } // SetSelfMuted sets whether the user can transmit audio or not. // // This method should only be called on Client.Self(). func (u *User) SetSelfMuted(muted bool) { - packet := MumbleProto.UserState{ - Session: &u.Session, - SelfMute: &muted, - } - u.client.Conn.WriteProto(&packet) + packet := MumbleProto.UserState{ + Session: &u.Session, + SelfMute: &muted, + } + u.client.Conn.WriteProto(&packet) } // SetSelfDeafened sets whether the user can receive audio or not. // // This method should only be called on Client.Self(). func (u *User) SetSelfDeafened(muted bool) { - packet := MumbleProto.UserState{ - Session: &u.Session, - SelfDeaf: &muted, - } - u.client.Conn.WriteProto(&packet) + packet := MumbleProto.UserState{ + Session: &u.Session, + SelfDeaf: &muted, + } + u.client.Conn.WriteProto(&packet) } // RequestStats requests that the user's stats be sent to the client. func (u *User) RequestStats() { - packet := MumbleProto.UserStats{ - Session: &u.Session, - } - u.client.Conn.WriteProto(&packet) + packet := MumbleProto.UserStats{ + Session: &u.Session, + } + u.client.Conn.WriteProto(&packet) } // RequestTexture requests that the user's actual texture (i.e. non-hashed) be // sent to the client. func (u *User) RequestTexture() { - packet := MumbleProto.RequestBlob{ - SessionTexture: []uint32{u.Session}, - } - u.client.Conn.WriteProto(&packet) + packet := MumbleProto.RequestBlob{ + SessionTexture: []uint32{u.Session}, + } + u.client.Conn.WriteProto(&packet) } // RequestComment requests that the user's actual comment (i.e. non-hashed) be // sent to the client. func (u *User) RequestComment() { - packet := MumbleProto.RequestBlob{ - SessionComment: []uint32{u.Session}, - } - u.client.Conn.WriteProto(&packet) + packet := MumbleProto.RequestBlob{ + SessionComment: []uint32{u.Session}, + } + u.client.Conn.WriteProto(&packet) } // Send will send a text message to the user. func (u *User) Send(message string) { - textMessage := TextMessage{ - Users: []*User{u}, - Message: message, - } - u.client.Send(&textMessage) + textMessage := TextMessage{ + Users: []*User{u}, + Message: message, + } + u.client.Send(&textMessage) } // SetPlugin sets the user's plugin data. @@ -238,12 +238,12 @@ func (u *User) Send(message string) { // positional audio information from other users if their plugin context is the // same. The official Mumble client sets the context to: // -// PluginShortName + "\x00" + AdditionalContextInformation +// PluginShortName + "\x00" + AdditionalContextInformation func (u *User) SetPlugin(context []byte, identity string) { - packet := MumbleProto.UserState{ - Session: &u.Session, - PluginContext: context, - PluginIdentity: &identity, - } - u.client.Conn.WriteProto(&packet) + packet := MumbleProto.UserState{ + Session: &u.Session, + PluginContext: context, + PluginIdentity: &identity, + } + u.client.Conn.WriteProto(&packet) } diff --git a/gumble/gumble/users.go b/gumble/gumble/users.go index d859c4a..b88982a 100644 --- a/gumble/gumble/users.go +++ b/gumble/gumble/users.go @@ -1,7 +1,7 @@ package gumble import ( -// "git.stormux.org/storm/barnard/gumble/go-openal/openal" +// "git.stormux.org/storm/barnard/gumble/go-openal/openal" ) // Users is a map of server users. diff --git a/gumble/opus/opus.go b/gumble/opus/opus.go index 54ed070..f0976e4 100644 --- a/gumble/opus/opus.go +++ b/gumble/opus/opus.go @@ -1,21 +1,21 @@ package opus import ( - "git.stormux.org/storm/barnard/gumble/gumble" - "git.stormux.org/storm/barnard/gumble/go-opus" -) + "github.com/hraban/opus" + "git.stormux.org/storm/barnard/gumble/gumble" +) var Codec gumble.AudioCodec const ( - ID = 4 - VoiceChannels = 1 // Force mono for voice transmission + ID = 4 + VoiceChannels = 1 // Force mono for voice transmission ) func init() { - Codec = &generator{} - gumble.RegisterAudioCodec(4, Codec) + Codec = &generator{} + gumble.RegisterAudioCodec(4, Codec) } // generator @@ -23,81 +23,88 @@ type generator struct { } func (*generator) ID() int { - return ID + return ID } func (*generator) NewEncoder() gumble.AudioEncoder { - // Force mono for voice transmission - e, _ := opus.NewEncoder(gumble.AudioSampleRate, VoiceChannels, opus.AppVoIP) - e.SetBitrateToMax() - return &Encoder{ - e, - } + // Force mono for voice transmission + e, _ := opus.NewEncoder(gumble.AudioSampleRate, VoiceChannels, opus.AppVoIP) + _ = e.SetBitrateToMax() + return &Encoder{ + e, + } } // NewStereoEncoder creates a stereo encoder for file playback func NewStereoEncoder() gumble.AudioEncoder { - // Create stereo encoder for file playback - e, _ := opus.NewEncoder(gumble.AudioSampleRate, gumble.AudioChannels, opus.AppAudio) - e.SetBitrateToMax() - return &Encoder{ - e, - } + // Create stereo encoder for file playback + e, _ := opus.NewEncoder(gumble.AudioSampleRate, gumble.AudioChannels, opus.AppAudio) + _ = e.SetBitrateToMax() + return &Encoder{ + e, + } } func (*generator) NewDecoder() gumble.AudioDecoder { - // Create decoder with stereo support - d, _ := opus.NewDecoder(gumble.AudioSampleRate, gumble.AudioChannels) - return &Decoder{ - d, - } + // Create decoder with stereo support + d, _ := opus.NewDecoder(gumble.AudioSampleRate, gumble.AudioChannels) + return &Decoder{ + Decoder: d, + sampleRate: gumble.AudioSampleRate, + channels: gumble.AudioChannels, + } } // encoder type Encoder struct { - *opus.Encoder + *opus.Encoder } func (*Encoder) ID() int { - return ID + return ID } func (e *Encoder) Encode(pcm []int16, _, maxDataBytes int) ([]byte, error) { - buf := make([]byte, maxDataBytes) - n, err := e.Encoder.Encode(pcm, buf) - if err != nil { - return []byte{}, err - } - return buf[:n], nil + buf := make([]byte, maxDataBytes) + n, err := e.Encoder.Encode(pcm, buf) + if err != nil { + return []byte{}, err + } + return buf[:n], nil } func (e *Encoder) Reset() { - e.Encoder.Reset() + _ = e.Encoder.Reset() } // decoder type Decoder struct { - *opus.Decoder + *opus.Decoder + sampleRate int + channels int } func (*Decoder) ID() int { - return ID + return ID } func (d *Decoder) Decode(data []byte, frameSize int) ([]int16, error) { - // Allocate buffer for stereo - frameSize is per channel - pcm := make([]int16, frameSize * gumble.AudioChannels) - - // Decode the data - n, err := d.Decoder.Decode(data, pcm) - if err != nil { - return []int16{}, err - } + // Allocate buffer for stereo - frameSize is per channel + pcm := make([]int16, frameSize*gumble.AudioChannels) - // Return the exact number of samples decoded - return pcm[:n * gumble.AudioChannels], nil + // Decode the data + n, err := d.Decoder.Decode(data, pcm) + if err != nil { + return []int16{}, err + } + + // Return the exact number of samples decoded + return pcm[:n*gumble.AudioChannels], nil } func (d *Decoder) Reset() { - d.Decoder.Reset() + decoder, err := opus.NewDecoder(d.sampleRate, d.channels) + if err == nil { + d.Decoder = decoder + } } diff --git a/main.go b/main.go index 9789713..b005fe8 100644 --- a/main.go +++ b/main.go @@ -2,7 +2,10 @@ package main import _ "net/http/pprof" import ( + "al.essio.dev/pkg/shellescape" "bufio" + "crypto/tls" + "flag" "fmt" "io" "log" @@ -11,18 +14,13 @@ import ( "os/exec" "strings" "syscall" - //"gopkg.in/alessio/shellescape.v1" - //"github.com/google/shlex" - "crypto/tls" - "flag" + "git.stormux.org/storm/barnard/audio" "git.stormux.org/storm/barnard/config" - "git.stormux.org/storm/barnard/noise" - "github.com/alessio/shellescape" - "git.stormux.org/storm/barnard/gumble/go-openal/openal" "git.stormux.org/storm/barnard/gumble/gumble" _ "git.stormux.org/storm/barnard/gumble/opus" + "git.stormux.org/storm/barnard/noise" "git.stormux.org/storm/barnard/uiterm" )