Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion gumble/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,9 @@ func DialWithDialer(dialer *net.Dialer, addr string, config *Config, tlsConfig *

go client.readRoutine()

// If Opus support was not explicitly enabled, set Opus flag
// based on the presence of the Opus audio codec.
opus := client.Config.Opus || getAudioCodec(audioCodecIDOpus) != nil
// Initial packets
versionPacket := MumbleProto.Version{
Version: proto.Uint32(ClientVersion),
Expand All @@ -125,7 +128,7 @@ func DialWithDialer(dialer *net.Dialer, addr string, config *Config, tlsConfig *
authenticationPacket := MumbleProto.Authenticate{
Username: &client.Config.Username,
Password: &client.Config.Password,
Opus: proto.Bool(getAudioCodec(audioCodecIDOpus) != nil),
Opus: proto.Bool(opus),
Tokens: client.Config.Tokens,
}
client.Conn.WriteProto(&versionPacket)
Expand Down
5 changes: 5 additions & 0 deletions gumble/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@ type Config struct {
// The event listeners used when client events are triggered.
Listeners Listeners
AudioListeners AudioListeners

// If true, explicitly signals presence of Opus support. If
// false, this is determined automatically by the presence of
// an Opus codec implementation.
Opus bool
}

// NewConfig returns a new Config struct with default values set.
Expand Down
6 changes: 6 additions & 0 deletions gumble/doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,12 @@
//
// opusthreshold=0
//
// If your client is not processing audio at all, you can still claim
// to support Opus so that the Mumble server won't force usage of the
// legacy CELT codec:
//
// config.Opus = true
//
// Thread safety
//
// As a general rule, a Client everything that is associated with it
Expand Down