gumble is a Mumble client implementation in Go (golang)

gumble

gumble is a Mumble client implementation in Go

Sub-projects

  • gumble (docs)
    • Client library
  • gumbleopenal (docs)
    • OpenAL audio system for gumble
  • gumbleffmpeg (docs)
    • ffmpeg audio source for gumble
  • gumbleutil (docs)
    • Extras that can make working with gumble easier

Example

package main

import (
  "layeh.com/gumble/gumble"
  "layeh.com/gumble/gumbleutil"
)

func main() {
  gumbleutil.Main(gumbleutil.Listener{
    UserChange: func(e *gumble.UserChangeEvent) {
      if e.Type.Has(gumble.UserChangeConnected) {
        e.User.Send("Welcome to the server, " + e.User.Name + "!")
      }
    },
  })
}

Related projects

  • barnard
    • terminal-based Mumble client
  • piepan
    • an easy to use framework for writing Mumble bots using Lua

License

MPL 2.0

Author

Tim Cooper ([email protected])

Comments
  • running the mumble-audio-player on windows does not play sound

    running the mumble-audio-player on windows does not play sound

    I get no error message but also hear no sound. I used the chimes.ogg file.

    I used minGW64 on windows for the go build. I can start the exe and it connects to my server. If I send the text: chimes.ogg it says: Playing chimes.ogg on the shell window but I can't hear sound. If I move the bot, I hear the text to speach message from the server, so audio ist enabled and working.

    Any hints how to debug or what to change?

  • panic: x509: certificate is valid for Murmur Autogenerated Certificate v2, not <server_address>

    panic: x509: certificate is valid for Murmur Autogenerated Certificate v2, not

    Hi,

    I have begun to rewrite MumbleDJ using your new gumble library (I prefer Go over Lua), and I seem to be having connection issues whenever I try to connect to my server. I have tried both my password-protected Mumble server on an external machine, and an unprotected localhost server and got the same result. Both attempts to connect were executed on an Arch Linux machine.

    I followed the start-up guide on your README for gumble, here is my code.

    Here's the error message that I get (this one is for localhost, but it is identical to the message I would get for external servers):

    panic: x509: certificate is valid for Murmur Autogenerated Certificate v2, not localhost
    
    goroutine 16 [running]:
    runtime.panic(0x666260, 0xc2081f23e0)
        /usr/lib/go/src/pkg/runtime/panic.c:279 +0xf5
    main.main()
        /home/matthieu/programming/go/src/github.com/matthieugrieger/mumbledj/main.go:53 +0x36d
    
    goroutine 19 [finalizer wait]:
    runtime.park(0x4143a0, 0xa164e8, 0xa03e49)
        /usr/lib/go/src/pkg/runtime/proc.c:1369 +0x89
    runtime.parkunlock(0xa164e8, 0xa03e49)
        /usr/lib/go/src/pkg/runtime/proc.c:1385 +0x3b
    runfinq()
        /usr/lib/go/src/pkg/runtime/mgc0.c:2644 +0xcf
    runtime.goexit()
        /usr/lib/go/src/pkg/runtime/proc.c:1445
    
    goroutine 17 [syscall]:
    runtime.goexit()
        /usr/lib/go/src/pkg/runtime/proc.c:1445
    

    I have a feeling I may simply be missing something related to certificates, but I didn't really have to mess with those on piepan. Thanks!

  • Configurable audio packets interval

    Configurable audio packets interval

    (Feature request)

    Currently the interval at which audio packets are sent is hardcoded as 10milliseconds. This seems to produce choppy sound for me when using 10ms buffer in mumble. Would it be possible to allow custom audio interval values?

  • Issues when attempting to reconnect to server

    Issues when attempting to reconnect to server

    Hi there,

    So a recent feature request for MumbleDJ was to make it possible for the bot to automatically reconnect upon server connection closure or kick. I wrote this bit of code, thinking this would do the trick (the panic will not be there in the future, just there for debugging purposes):

    func (dj *mumbledj) OnDisconnect(e *gumble.DisconnectEvent) {
        if e.Type == gumble.DisconnectError || e.Type == gumble.DisconnectKicked {
            fmt.Println("Disconnected from server... Will retry connection in 30 second intervals for 15 minutes.")
            reconnectSuccess := false
            for retries := 0; retries <= 30; retries++ {
                fmt.Println("Retrying connection...")
                if err := dj.client.Connect(); err == nil {
                    fmt.Println("Successfully reconnected to the server!")
                    reconnectSuccess = true
                    break
                } else {
                    panic(err)
                }
                time.Sleep(30 * time.Second)
            }
            if !reconnectSuccess {
                fmt.Println("Could not reconnect to server. Exiting...")
                dj.keepAlive <- true
                os.Exit(1)
            }
        } else {
            dj.keepAlive <- true
        }
    }
    

    However, it doesn't seem to work. Maybe I'm just approaching this wrong? This is what console spits out:

    Disconnected from server... Will retry connection in 30 second intervals for 15 minutes.
    Retrying connection...
    panic: client is already connected
    
    goroutine 5 [running]:
    main.(*mumbledj).OnDisconnect(0xbe19a0, 0xc20805a0c0)
        /home/matthieu/programming/github/mumbledj/main.go:83 +0x473
    main.*mumbledj.OnDisconnect·fm(0xc20805a0c0)
        /home/matthieu/programming/github/mumbledj/main.go:197 +0x31
    github.com/layeh/gumble/gumbleutil.Listener.OnDisconnect(0xc20800ab30, 0xc20800ab40, 0xc20800ab50, 0xc20800ab60, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
        /home/matthieu/programming/github/mumbledj/.vendor/src/github.com/layeh/gumble/gumbleutil/listener.go:36 +0x37
    github.com/layeh/gumble/gumbleutil.(*Listener).OnDisconnect(0xc20802e0f0, 0xc20805a0c0)
        <autogenerated>:2 +0xaa
    github.com/layeh/gumble/gumble.eventMultiplexer.OnDisconnect(0xc20803b020, 0xc20803b050, 0xc20805a0c0)
        /home/matthieu/programming/github/mumbledj/.vendor/src/github.com/layeh/gumble/gumble/eventmultiplexer.go:56 +0x57
    github.com/layeh/gumble/gumble.(*Client).readRoutine(0xc20805a000)
        /home/matthieu/programming/github/mumbledj/.vendor/src/github.com/layeh/gumble/gumble/client.go:191 +0x136
    created by github.com/layeh/gumble/gumble.(*Client).Connect
        /home/matthieu/programming/github/mumbledj/.vendor/src/github.com/layeh/gumble/gumble/client.go:120 +0x63d
    
    goroutine 1 [runnable]:
    main.main()
        /home/matthieu/programming/github/mumbledj/main.go:208 +0xb7b
    
    goroutine 17 [syscall, locked to thread]:
    runtime.goexit()
        /usr/lib/go/src/runtime/asm_amd64.s:2232 +0x1
    
    goroutine 6 [runnable]:
    github.com/layeh/gumble/gumble.(*Client).pingRoutine(0xc20805a000)
        /home/matthieu/programming/github/mumbledj/.vendor/src/github.com/layeh/gumble/gumble/client.go:163 +0x2dc
    created by github.com/layeh/gumble/gumble.(*Client).Connect
        /home/matthieu/programming/github/mumbledj/.vendor/src/github.com/layeh/gumble/gumble/client.go:121 +0x65a
    

    It seems strange to me that the error says that there is already an existing connection when this bit of code is within the OnDisconnect() function triggered by a DisconnectEvent.

    Thanks!

  • Audio playback stops after 00:02:44 has elasped

    Audio playback stops after 00:02:44 has elasped

    Hey there,

    I came across a rather strange bug while testing out the Play() function from gumble_ffmpeg. I am using youtube-dl to download the audio from YouTube videos in m4a format at 256k, 44100Hz and the audio playback consistently stops 2 minutes and 44 seconds in.

    I have even tested it using different YouTube videos, and it still stops right on 2 minutes 44 seconds. Maybe a memory leak issue or something? The audio playback sounds perfect up until it stops.

    Here is the youtube-dl command I am using: youtube-dl --output ~/.mumbledj/songs/<youtube_id_here>.m4a --format m4a <youtube_id_here>

    And here are the two songs I used to test it (I picked these at random): https://www.youtube.com/watch?v=5DLTlgzhxFE https://www.youtube.com/watch?v=emGri7i8Y2Y

    Thanks!

  • Audio not playing when stream status is set to StatePlaying

    Audio not playing when stream status is set to StatePlaying

    Hi!

    I've come across another issue. Apologies in advance if this is simply another case of me making a mistake. :)

    I have been trying to get MumbleDJ to stream audio over Mumble, but I can't seem to get it to work. Here is a step-by-step outline of the steps completed prior to calling Play() on the stream:

    1) Audio file is downloaded and stored on disk. I've tested that the audio file is valid by playing it in VLC, the audio works fine.

    2) A new source is created via gumbleffmpeg.SourceFile().

    3) Audio stream is initialized with gumbleffmpeg.New().

    4) Various parameters such as Offset and Volume are set on the newly created stream.

    5) Play() is called, and a goroutine is spawned that waits for the audio stream to finish.

    To my knowledge this should be the correct procedure for creating and playing an audio stream, but I do not get any audio. opusthreshold is set to 0 in the server's configuration file, so that is not the issue. Another strange thing is that calling State() on the stream after calling the Play() method the state is set to StatePlaying, even though no audio is provided. Also, calling Pause() afterwards correctly sets the state to StatePaused. It seems that the stream is behaving properly besides the fact that no audio is being played.

    Any ideas what is going on here? Here are some links to relevant sections of code in case they are of help:

    https://github.com/matthieugrieger/mumbledj/blob/refactor/bot/queue.go#L243-L288 https://github.com/matthieugrieger/mumbledj/blob/refactor/bot/queue.go#L324-L331

    Let me know if more information should be provided.

    Thanks!

  • Add elapsed time to gumble_ffmpeg

    Add elapsed time to gumble_ffmpeg

    I've been using the elapsed time patch here for stopping/resuming audio streams on my server. I needed to change the integer start offset to float to support fractional seconds to avoid small jumps when you resume audio.

    I've also got a patch for piepan to use this in the javascript plugin: https://github.com/layeh/piepan/pull/28

  • How to check permissions before moving channel

    How to check permissions before moving channel

    Currently my bot will not check if it is permitted to join a channel before joining and therefore crash if it tries to move to a channel it is not permitted to join.

    I call perm := event.Sender.Channel.Permission() but I have no idea how to work with the permission object to check for PermissionEnter. I know it's a bitmask but am unsure how to know what bit in the Int to get or really how to get it.

    (Sorry if this is a simple question but info on how to do this is hard to come by.)

  • Sound not transmitting when connected to remote server.

    Sound not transmitting when connected to remote server.

    I'm getting some very strange behavior. When attempting to play a sound, the sound often does not transmit at all when gumble is connected to a remote server, though sometimes it does work. However, if it's connected to a murmur instance running locally (i.e. "localhost") then sounds seem to play just fine. There don't appear to be any errors at all when this happens. Any thing I could be missing? Thanks!

  • Crash when attaching

    Crash when attaching "gumbleutil.AutoBitrate"

    I get the following errors and a crash if I attempt to connect mumble to a server after attaching the gumbleutil.AutoBitrate to the client:

    panic: runtime error: integer divide by zero
    [signal 0x8 code=0x7 addr=0x40c7c5d pc=0x40c7c5d]
    
    goroutine 5 [running]:
    github.com/layeh/gumble/gumbleutil.glob.func1(0xc82011ea80)
        /Users/jcdesimp/dev/go/src/github.com/layeh/gumble/gumbleutil/bitrate.go:14 +0x2d
    github.com/layeh/gumble/gumbleutil.Listener.OnConnect(0x43fcdd0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
        /Users/jcdesimp/dev/go/src/github.com/layeh/gumble/gumbleutil/listener.go:26 +0x30
    github.com/layeh/gumble/gumbleutil.(*Listener).OnConnect(0x4515b00, 0xc82011ea80)
        <autogenerated>:1 +0xa0
    github.com/layeh/gumble/gumble.(*eventMultiplexer).OnConnect(0xc8200c0018, 0xc82011ea80)
        /Users/jcdesimp/dev/go/src/github.com/layeh/gumble/gumble/eventmultiplexer.go:55 +0xcc
    github.com/layeh/gumble/gumble.(*Client).handleServerSync(0xc8200c0000, 0xc820135560, 0x11c, 0x11c, 0x0, 0x0)
        /Users/jcdesimp/dev/go/src/github.com/layeh/gumble/gumble/handlers.go:243 +0x2c5
    github.com/layeh/gumble/gumble.(*Client).readRoutine(0xc8200c0000)
        /Users/jcdesimp/dev/go/src/github.com/layeh/gumble/gumble/client.go:233 +0x3e2
    created by github.com/layeh/gumble/gumble.(*Client).Connect
        /Users/jcdesimp/dev/go/src/github.com/layeh/gumble/gumble/client.go:146 +0x725
    
    goroutine 1 [chan receive]:
    main.main()
    
    ...
    
    goroutine 17 [syscall, locked to thread]:
    runtime.goexit()
        /usr/local/go/src/runtime/asm_amd64.s:1721 +0x1
    
    goroutine 6 [select]:
    github.com/layeh/gumble/gumble.(*Client).pingRoutine(0xc8200c0000)
        /Users/jcdesimp/dev/go/src/github.com/layeh/gumble/gumble/client.go:210 +0x2b4
    created by github.com/layeh/gumble/gumble.(*Client).Connect
        /Users/jcdesimp/dev/go/src/github.com/layeh/gumble/gumble/client.go:147 +0x74a
    exit status 2
    

    Any particular caveats I should know about regarding setting the AutoBitrate that I may have fallen into here?

    client.Attach(gumbleutil.AutoBitrate) is being called before client.Connect()

    The crash does not happen if I remove client.Attach(gumbleutil.AutoBitrate)

    Thanks!

  • Unable to install opus

    Unable to install opus

    When I attempt to run go get "github.com/layeh/gumble/opus" I get the following error:

    # github.com/layeh/gumble/opus
    ../../../github.com/layeh/gumble/opus/opus.go:54: e.Encoder.ResetState undefined (type *gopus.Encoder has no field or method ResetState)
    

    I figure I must be doing something wrong but I can't figure out how to resolve it.

    I'm developing on Mac OS X 10.11.4 Beta go version go1.5.2 darwin/amd64

  • Add client config flag to explicitly signal Opus support

    Add client config flag to explicitly signal Opus support

    Add client config flag to explicitly signal Opus support even when the Opus audio codec is not loaded.

    This is useful if a client based on gumble doesn't actually process audio at all. By signalling Opus support anyway, this doesn't force everyone back to CELT if a gumble client is the only client not claiming Opus support. We can't be sure that the server admin has actually set opusthreshold = 0, so this is a pure-client way to prevent a CELT fallback.

  • How to get gumbleffmpeg stream duration/length?

    How to get gumbleffmpeg stream duration/length?

    Hello! Forgive me if this question is very simple to answer, since I am very new to go lang, but I can't seem to find how to get the stream's duration. I can easily obtain how much time has passed with Elapsed(), but I can't seem to find a method for how long the stream is (in time).

  • No audio transmitted and received and mumble-audio-player play no sound

    No audio transmitted and received and mumble-audio-player play no sound

    When I run mumble-audio-player, I can connect the mumble-server, but it shows gumble user, named "gumble-client" by me cannot transmit or receive any audio, but I have changed the config "opusthreshold=0" in murmur.ini.

    1

    Also, when I run mumble-audio-player, it shows that "audio player loaded! (0 files)", and no sound played. Is it normal? I think it should find chimes.ogg in path "../go/src/layeh.com/gumble/_examples/mumble-audio-player", but it not. Is it an error, or chimes.ogg on an incorrect path?

    2

    More information or hints about how to debugging gumble for audio is needed.

  • unseal gumbleffmpeg.Source

    unseal gumbleffmpeg.Source

    Hello, golang newbie here. I tried a lot of things to use this interface without changing the lib code but couldn't find a way to implement it.

    This change allows me to implement the interface and provide my own functions to use it. Is this a good idea?

  • Transmit Stereo Audio

    Transmit Stereo Audio

    Since https://github.com/mumble-voip/mumble/pull/4209 has been merged (and will most likely be included in the Mumble 1.4.0 release) it would be nice to have the ability to transmit stereo audio implemented into gumble.

    Presumably, at a quick uninformed glance, all that would need to change would be setting AudioChannels to 2 although it might be more complicated than that. https://github.com/layeh/gumble/blob/1ea1159c495624266a4adea43580748fd0fc9c57/gumble/audio.go#L30

    Supposedly the "opus decoder can also automatically convert a stereo stream into a mono stream, so even if we transmit a stereo stream to an older version of mumble, it would still work." according to the author of the PR.

    Regardless, it is probably sensible to default to mono still (since 1.4.0 hasn't released yet) with a configurable option to transmit in stereo.

Related tags
Golang implementation of the covid certificate QRCode decoder

Golang implementation of the covid certificates. At the moment it only includes DCC signed data decoding but I've planned to add a lot more of features related to certificates processing.

Sep 22, 2021
NoiseGo - Implementation of Improved Perlin Noise in Golang
NoiseGo - Implementation of Improved Perlin Noise in Golang

NoiseGo Implementation of Improved Perlin Noise in Golang. NoiseGo is written on

Jan 24, 2022
Go-amplitude - Amplitude Client for Golang

Amplitude Client for Go Example package main import ( "github.com/euskadi31

Jun 8, 2022
A phoenix Chain client based on the go-ethereum fork,the new PoS consensus engine is based on the VRF algorithm.

Phoenix Official Golang implementation of the Phoenix protocol. !!!The current version is for testing and developing purposes only!!! Building the sou

Aug 18, 2022
OpenStreetMap PBF golang parser

pbf OpenStreetMap PBF golang encoder/decoder A golang based OpenStreetMap PBF encoder/decoder with a handy command line utility, pbf. pbf Command Line

Oct 23, 2022
golang OpenGL helper functions

glh: golang OpenGL helpers This package contains a number of functions useful for applications using OpenGL. Code Reference Features Textures and Text

Apr 8, 2022
A library for playing with colors in go (golang).
A library for playing with colors in go (golang).

go-colorful A library for playing with colors in Go. Supports Go 1.13 onwards. Why? I love games. I make games. I love detail and I get lost in detail

Dec 30, 2022
Rasterx is an SVG 2.0 path compliant rasterizer that can use either the golang vector or a derivative of the freetype anti-aliaser.
Rasterx is an SVG 2.0 path compliant rasterizer that can use either the golang vector or a derivative of the freetype anti-aliaser.

rasterx Rasterx is a golang rasterizer that implements path stroking functions capable of SVG 2.0 compliant 'arc' joins and explicit loop closing. Pat

Nov 1, 2022
Pure golang image resizing
Pure golang image resizing

This package is no longer being updated! Please look for alternatives if that bothers you. Resize Image resizing for the Go programming language with

Jan 9, 2023
:triangular_ruler: Create beautiful generative image patterns from a string in golang.
:triangular_ruler: Create beautiful generative image patterns from a string in golang.

geopattern Create beautiful generative image patterns from a string in golang. Go port of Jason Long's awesome GeoPattern library. Read geopattern's d

Dec 29, 2022
Pure Golang Library that allows simple LSB steganography on images
Pure Golang Library that allows simple LSB steganography on images

Steganography Lib Steganography is a library written in Pure go to allow simple LSB steganography on images. It is capable of both encoding and decodi

Dec 22, 2022
GameBoy Color emulator written in golang.
GameBoy Color emulator written in golang.

?? Worldwide 日本語のドキュメントはこちら GameBoyColor emulator written in golang. This emulator can play almost all ROMs work without problems and has many feature

Dec 26, 2022
a barcode creation lib for golang

Introduction This is a package for GO which can be used to create different types of barcodes. Supported Barcode Types 2 of 5 Aztec Code Codabar Code

Jan 3, 2023
A captcha library written in golang
A captcha library written in golang

gocaptcha 一个简单的Go语言实现的验证码 图片实例 简介 基于Golang实现的图片验证码生成库,可以实现随机字母个数,随机直线,随机噪点等。可以设置任意多字体,每个验证码随机选一种字体展示。 实例 使用: go get github.com/lifei6671/gocaptcha/

Dec 29, 2022
golang package to find the K most dominant/prominent colors in an image
golang package to find the K most dominant/prominent colors in an image

prominentcolor Find the K most dominant colors in an image The Kmeans function returns the K most dominant colors in the image, ordered in the order o

Nov 7, 2022
go chart is a basic charting library in native golang.
go chart is a basic charting library in native golang.

go-chart Package chart is a very simple golang native charting library that supports timeseries and continuous line charts. Master should now be on th

Dec 30, 2022
使用 Golang+Chrome+OpenCV 破解腾讯滑块验证码
使用 Golang+Chrome+OpenCV 破解腾讯滑块验证码

一、背景 滑块验证码是一项人机识别技术,操作简单,真人体验好,机器识别效果也不差,可以有效防止脚本做任务,增加机器脚本薅羊毛的难度。但其破解也相对简单,这里演示一个Demo,以了解。通过 OpenCV 匹配找出滑块位置,计算出滑动距离,然后模拟 js 鼠标事件,在 Chrome 控制台执行脚本,完成

Dec 28, 2022
🔍 gowitness - a golang, web screenshot utility using Chrome Headless

?? gowitness A golang, web screenshot utility using Chrome Headless. introduction gowitness is a website screenshot utility written in Golang, that us

Jan 9, 2023
golang aspect tool
golang aspect tool

简介 go-aspect是一个为golang提供切面编程可能性的工具,可以使用该工具,替换原有的go build来进行编译,将预先配置好的切面编织到目标代码中 效果图 安装方式 源码安装 下载源码到本地 切换到源码目录,运行 make install 使用简介 目前仅支持mod模式的工程 编织是基于

Mar 13, 2022