]> git.0d.be Git - barnard.git/blobdiff - cmd/barnard/main.go
change license, update gumbleopenal package name
[barnard.git] / cmd / barnard / main.go
index 5ca2d6d5783f6f6c35555d90c9703f74f8a5c83a..37a7baa9ffb0c5176ed62f3c0eaeb18018a6c59e 100644 (file)
@@ -9,7 +9,9 @@ import (
        "github.com/layeh/barnard"
        "github.com/layeh/barnard/uiterm"
        "github.com/layeh/gumble/gumble"
-       "github.com/layeh/gumble/gumble_openal"
+       "github.com/layeh/gumble/gumbleutil"
+       "github.com/layeh/gumble/gumbleopenal"
+       _ "github.com/layeh/gumble/opus"
 )
 
 func main() {
@@ -26,10 +28,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,10 +43,14 @@ 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 stream, err := gumble_openal.New(b.Client); err != nil {
+       if os.Getenv("ALSOFT_LOGLEVEL") == "" {
+               os.Setenv("ALSOFT_LOGLEVEL", "0")
+       }
+       if stream, err := gumbleopenal.New(b.Client); err != nil {
                fmt.Fprintf(os.Stderr, "%s\n", err)
                os.Exit(1)
        } else {