]> git.0d.be Git - barnard.git/blobdiff - cmd/barnard/main.go
update due to gumble changes
[barnard.git] / cmd / barnard / main.go
index 5ca2d6d5783f6f6c35555d90c9703f74f8a5c83a..8b2a331cdd8eef6a4d95ddd8e30679bd3dd25d79 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"
 )
 
@@ -26,10 +27,9 @@ func main() {
        b.Ui = uiterm.New(&b)
 
        // Gumble
-       b.Config = gumble.Config{
-               Username: *username,
-               Address:  *server,
-       }
+       b.Config = gumble.NewConfig()
+       b.Config.Username = *username
+       b.Config.Address = *server
        if *insecure {
                b.Config.TLSConfig.InsecureSkipVerify = true
        }
@@ -42,9 +42,13 @@ func main() {
                }
        }
 
-       b.Client = gumble.NewClient(&b.Config)
+       b.Client = gumble.NewClient(b.Config)
+       b.Client.Attach(gumbleutil.AutoBitrate)
        b.Client.Attach(&b)
        // Audio
+       if os.Getenv("ALSOFT_LOGLEVEL") == "" {
+               os.Setenv("ALSOFT_LOGLEVEL", "0")
+       }
        if stream, err := gumble_openal.New(b.Client); err != nil {
                fmt.Fprintf(os.Stderr, "%s\n", err)
                os.Exit(1)