]> git.0d.be Git - barnard.git/commitdiff
use gumbleutil.AutoBitrate
authorTim Cooper <tim.cooper@layeh.com>
Thu, 22 Jan 2015 12:53:59 +0000 (08:53 -0400)
committerTim Cooper <tim.cooper@layeh.com>
Thu, 22 Jan 2015 12:53:59 +0000 (08:53 -0400)
client.go
cmd/barnard/main.go

index 44a17e7d79322ff118f49eb74828cde4d7b6b9b1..1d7066d9f29c5dc53b7e56f32490e4cae2aaff68 100644 (file)
--- 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 != "" {
index 5ca2d6d5783f6f6c35555d90c9703f74f8a5c83a..812a395f47d4177990c22bc06588ee6ead58d116 100644 (file)
@@ -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 {