From e336d47fc50d045f911116ca302ab2d9c3dc0a26 Mon Sep 17 00:00:00 2001 From: Tim Cooper Date: Thu, 22 Jan 2015 08:53:59 -0400 Subject: [PATCH] use gumbleutil.AutoBitrate --- client.go | 4 ---- cmd/barnard/main.go | 2 ++ 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/client.go b/client.go index 44a17e7..1d7066d 100644 --- a/client.go +++ b/client.go @@ -11,10 +11,6 @@ func (b *Barnard) OnConnect(e *gumble.ConnectEvent) { b.UiTree.Rebuild() b.Ui.Refresh() - if b.Client.AudioEncoder().Bitrate() > e.MaximumBitrate { - b.Client.AudioEncoder().SetBitrate(e.MaximumBitrate / 3) - } - b.UpdateInputStatus(fmt.Sprintf("To: %s", e.Client.Self().Channel().Name())) b.AddOutputLine(fmt.Sprintf("Connected to %s", b.Client.Conn().RemoteAddr())) if e.WelcomeMessage != "" { diff --git a/cmd/barnard/main.go b/cmd/barnard/main.go index 5ca2d6d..812a395 100644 --- a/cmd/barnard/main.go +++ b/cmd/barnard/main.go @@ -9,6 +9,7 @@ import ( "github.com/layeh/barnard" "github.com/layeh/barnard/uiterm" "github.com/layeh/gumble/gumble" + "github.com/layeh/gumble/gumbleutil" "github.com/layeh/gumble/gumble_openal" ) @@ -43,6 +44,7 @@ func main() { } b.Client = gumble.NewClient(&b.Config) + b.Client.Attach(gumbleutil.AutoBitrate) b.Client.Attach(&b) // Audio if stream, err := gumble_openal.New(b.Client); err != nil { -- 2.39.2