use gumbleutil.AutoBitrate
This commit is contained in:
@@ -11,10 +11,6 @@ func (b *Barnard) OnConnect(e *gumble.ConnectEvent) {
|
|||||||
b.UiTree.Rebuild()
|
b.UiTree.Rebuild()
|
||||||
b.Ui.Refresh()
|
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.UpdateInputStatus(fmt.Sprintf("To: %s", e.Client.Self().Channel().Name()))
|
||||||
b.AddOutputLine(fmt.Sprintf("Connected to %s", b.Client.Conn().RemoteAddr()))
|
b.AddOutputLine(fmt.Sprintf("Connected to %s", b.Client.Conn().RemoteAddr()))
|
||||||
if e.WelcomeMessage != "" {
|
if e.WelcomeMessage != "" {
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ import (
|
|||||||
"github.com/layeh/barnard"
|
"github.com/layeh/barnard"
|
||||||
"github.com/layeh/barnard/uiterm"
|
"github.com/layeh/barnard/uiterm"
|
||||||
"github.com/layeh/gumble/gumble"
|
"github.com/layeh/gumble/gumble"
|
||||||
|
"github.com/layeh/gumble/gumbleutil"
|
||||||
"github.com/layeh/gumble/gumble_openal"
|
"github.com/layeh/gumble/gumble_openal"
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -43,6 +44,7 @@ func main() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
b.Client = gumble.NewClient(&b.Config)
|
b.Client = gumble.NewClient(&b.Config)
|
||||||
|
b.Client.Attach(gumbleutil.AutoBitrate)
|
||||||
b.Client.Attach(&b)
|
b.Client.Attach(&b)
|
||||||
// Audio
|
// Audio
|
||||||
if stream, err := gumble_openal.New(b.Client); err != nil {
|
if stream, err := gumble_openal.New(b.Client); err != nil {
|
||||||
|
|||||||
Reference in New Issue
Block a user