Giter Site home page Giter Site logo

mumbledj's Introduction

MumbleDJ

A Mumble bot that plays audio fetched from various media websites.

Unfortunately, this project is no longer maintained. Don't expect any responses on bug reports, feature requests, etc. Forks are welcome!

Table of Contents

Features

  • Plays audio from many media websites, including YouTube, SoundCloud, and Mixcloud.
  • Supports playlists and individual videos/tracks.
  • Displays metadata in the text chat whenever a new track starts playing.
  • Incredibly customizable. Nearly everything is able to be tweaked via configuration files (by default located at $HOME/.config/mumbledj/config.yaml).
  • A large array of commands that perform a wide variety of functions.
  • Built-in vote-skipping.
  • Built-in caching system (disabled by default).
  • Built-in play/pause/volume control.

Installation

IMPORTANT NOTE: MumbleDJ is only tested and developed for Linux systems. Support will not be given for non-Linux systems if problems are encountered.

Requirements

All MumbleDJ installations must also have the following installed:

If installing via go install or from source, the following must be installed:

  • Go 1.5+
    • NOTE: Extra installation steps are required for a working Go installation. Once Go is installed, type go help gopath for more information.
    • If the repositories for your distro contain a version of Go older than 1.5, try using gvm to install Go 1.5 or newer.

YouTube API Key

A YouTube API key must be present in your configuration file in order to use the YouTube service within the bot. Below is a guide for retrieving an API key:

1) Navigate to the Google Developers Console and sign in with your Google account, or create one if you haven't already.

2) Click the "Create Project" button and give your project a name. It doesn't matter what you set your project name to. Once you have a name click the "Create" button. You should be redirected to your new project once it's ready.

3) Click on "APIs & auth" on the sidebar, and then click APIs. Under the "YouTube APIs" header, click "YouTube Data API". Click on the "Enable API" button.

4) Click on the "Credentials" option underneath "APIs & auth" on the sidebar. Underneath "Public API access" click on "Create New Key". Choose the "Server key" option.

5) Add the IP address of the machine MumbleDJ will run on in the box that appears (this is optional, but improves security). Click "Create".

6) You should now see that an API key has been generated. Copy/paste this API key into the configuration file located at $HOME/.config/mumbledj/mumbledj.yaml.

SoundCloud API Key

A SoundCloud client ID must be present in your configuration file in order to use the SoundCloud service within the bot. Below is a guide for retrieving a client ID:

1) Login/sign up for a SoundCloud account on https://soundcloud.com.

2) Create a new app: https://soundcloud.com/you/apps/new.

3) You should now see that a client ID has been generated. Copy/paste this ID (NOT the client secret) into the configuration file located at $HOME/.config/mumbledj/mumbledj.yaml.

Via go get (recommended)

After verifying that the requirements are installed, simply issue the following command:

go get -u github.com/matthieugrieger/mumbledj

This should place a binary in $GOPATH/bin that can be used to start the bot.

NOTE: If using Go 1.5, you MUST execute the following for go get to work:

export GO15VENDOREXPERIMENT=1

Pre-compiled Binaries (easiest)

Pre-compiled binaries are provided for convenience. Overall, I do not recommend using these unless you cannot get go install to work properly. Binaries compiled on your own machine are likely more efficient as these binaries are cross-compiled from a 64-bit Linux system.

After verifying that the requirements are installed, simply visit the releases page and download the appropriate binary for your platform.

From Source

First, clone the MumbleDJ repository to your machine:

git clone https://github.com/matthieugrieger/mumbledj.git

Install the required software as described in the requirements section, and execute the following:

make

This will place a compiled mumbledj binary in the cloned directory if successful. If you would like to make the binary more accessible by adding it to /usr/local/bin, simply execute the following:

sudo make install

Docker

You can also use Docker to run MumbleDJ.

First you need to clone the MumbleDJ repository to your machine:

git clone https://github.com/matthieugrieger/mumbledj.git

Assuming you have Docker installed, you will have to build the image:

docker build -t mumbledj .

And then you can run it, passing the configuration through the command line:

docker run --rm --name=mumbledj mumbledj --server=SERVER --api_keys.youtube=YOUR_YOUTUBE_API_KEY --api_keys.soundcloud=YOUR_SOUNDCLOUD_API_KEY

In order to run the process as a daemon and restart it automatically on reboot you can use:

docker run -d --restart=unless-stopped --name=mumbledj mumbledj --server=SERVER --api_keys.youtube=YOUR_YOUTUBE_API_KEY --api_keys.soundcloud=YOUR_SOUNDCLOUD_API_KEY

You can also install Docker on a Raspberry Pi for instance with hypriot or with archlinux. You just need to build the ARM image:

docker build -f raspberry.Dockerfile -t mumbledj .

Usage

MumbleDJ is a compiled program that is executed via a terminal.

Here is an example helptext that gives you a feel for the various commandline arguments you can give MumbleDJ:

NAME:
   MumbleDJ - A Mumble bot that plays audio from various media sites.

USAGE:
   mumbledj [global options] command [command options] [arguments...]

VERSION:
   v3.1.0

COMMANDS:
GLOBAL OPTIONS:
   --config value, -c value		location of MumbleDJ configuration file (default: "/home/matthieu/.config/mumbledj/config.yaml")
   --server value, -s value		address of Mumble server to connect to (default: "127.0.0.1")
   --port value, -o value		port of Mumble server to connect to (default: "64738")
   --username value, -u value		username for the bot (default: "MumbleDJ")
   --password value, -p value		password for the Mumble server
   --channel value, -n value		channel the bot enters after connecting to the Mumble server
   --p12 value				path to user p12 file for authenticating as a registered user
   --cert value, -e value		path to PEM certificate
   --key value, -k value		path to PEM key
   --accesstokens value, -a value	list of access tokens separated by spaces
   --insecure, -i			if present, the bot will not check Mumble certs for consistency
   --debug, -d				if present, all debug messages will be shown
   --help, -h				show help
   --version, -v			print the version

NOTE: You can also override all settings found within config.yaml directly from the commandline. Here's an example:

mumbledj --admins.names="SuperUser,Matt" --volume.default="0.5" --volume.lowest="0.2" --queue.automatic_shuffle_on="true"

Keep in mind that values that contain commas (such as "SuperUser,Matt") will be interpreted as string slices, or arrays if you are not familiar with Go. If you want your value to be interpreted as a normal string, it is best to avoid commas for now.

Commands

add

  • Description: Adds a track or playlist from a media site to the queue.
  • Default Aliases: add, a
  • Arguments: (Required) URL(s) to a track or playlist from a supported media site.
  • Admin-only by default: No
  • Example: !add https://www.youtube.com/watch?v=KQY9zrjPBjo

addnext

  • Description: Adds a track or playlist from a media site as the next item in the queue.
  • Default Aliases: addnext, an
  • Arguments: (Required) URL(s) to a track or playlist from a supported media site.
  • Admin-only by default: Yes
  • Example: !addnext https://www.youtube.com/watch?v=KQY9zrjPBjo

cachesize

  • Description: Outputs the file size of the cache in MiB if caching is enabled.
  • Default Aliases: cachesize, cs
  • Arguments: None
  • Admin-only by default: Yes
  • Example: !cachesize

currenttrack

  • Description: Outputs information about the current track in the queue if one exists.
  • Default Aliases: currenttrack, currentsong, current
  • Arguments: None
  • Admin-only by default: No
  • Example: !currenttrack

forceskip

  • Description: Immediately skips the current track.
  • Default Aliases: forceskip, fs
  • Arguments: None
  • Admin-only by default: Yes
  • Example: !forceskip

forceskipplaylist

  • Description: Immediately skips the current playlist.
  • Default Aliases: forceskipplaylist, fsp
  • Arguments: None
  • Admin-only by default: Yes
  • Example: !forceskipplaylist

help

  • Description: Outputs a list of available commands and their descriptions.
  • Default Aliases: help, h
  • Arguments: None
  • Admin-only by default: No
  • Example: !help

joinme

  • Description: Moves MumbleDJ into your current channel if not playing audio to someone else.
  • Default Aliases: joinme, join
  • Arguments: None
  • Admin-only by default: Yes
  • Example: !joinme

kill

  • Description: Stops the bot and cleans its cache directory.
  • Default Aliases: kill, k
  • Arguments: None
  • Admin-only by default: Yes
  • Example: !kill

listtracks

  • Description: Outputs a list of the tracks currently in the queue.
  • Default Aliases: listtracks, listsongs, list, l
  • Arguments: (Optional) Number of tracks to list
  • Admin-only by default: No
  • Example: !listtracks 10

move

  • Description: Moves the bot into the Mumble channel provided via argument.
  • Default Aliases: move, m
  • Arguments: (Required) Mumble channel to move the bot into
  • Admin-only by default: Yes
  • Example: !move Music

nexttrack

  • Description: Outputs information about the next track in the queue if one exists.
  • Default Aliases: nexttrack, nextsong, next
  • Arguments: None
  • Admin-only by default: No
  • Example: !nexttrack

numcached

  • Description: Outputs the number of tracks cached on disk if caching is enabled.
  • Default Aliases: numcached, nc
  • Arguments: None
  • Admin-only by default: Yes
  • Example: !numcached

numtracks

  • Description: Outputs the number of tracks currently in the queue.
  • Default Aliases: numtracks, numsongs, nt
  • Arguments: None
  • Admin-only by default: No
  • Example: !numtracks

pause

  • Description: Pauses audio playback.
  • Default Aliases: pause
  • Arguments: None
  • Admin-only by default: No
  • Example: !pause

register

  • Description: Registers the bot on the server.
  • Default Aliases: register, reg
  • Arguments: None
  • Admin-only by default: Yes
  • Example: !register

reload

  • Description: Reloads the configuration file.
  • Default Aliases: reload, r
  • Arguments: None
  • Admin-only by default: Yes
  • Example: !reload

reset

  • Description: Resets the queue by removing all queue items.
  • Default Aliases: reset, re
  • Arguments: None
  • Admin-only by default: Yes
  • Example: !reset

resume

  • Description: Resumes audio playback.
  • Default Aliases: resume
  • Arguments: None
  • Admin-only by default: No
  • Example: !pause

setcomment

  • Description: Sets the comment displayed next to MumbleDJ's username in Mumble. If the argument is left empty, the current comment is removed.
  • Default Aliases: setcomment, comment, sc
  • Arguments: (Optional) New comment
  • Admin-only by default: Yes
  • Example: !setcomment Hello! I'm a bot. Beep boop.

shuffle

  • Description: Randomizes the tracks currently in the queue.
  • Default Aliases: shuffle, shuf, sh
  • Arguments: None
  • Admin-only by default: Yes
  • Example: !shuffle

skip

  • Description: Places a vote to skip the current track.
  • Default Aliases: skip, s
  • Arguments: None
  • Admin-only by default: No
  • Example: !skip

skipplaylist

  • Description: Places a vote to skip the current playlist.
  • Default Aliases: skipplaylist, sp
  • Arguments: None
  • Admin-only by default: No
  • Example: !skipplaylist

toggleshuffle

  • Description: Toggles permanent track shuffling on/off.
  • Default Aliases: toggleshuffle, toggleshuf, togshuf, tsh
  • Arguments: None
  • Admin-only by default: Yes
  • Example: !toggleshuffle

version

  • Description: Outputs the current version of MumbleDJ.
  • Default Aliases: version, v
  • Arguments: None
  • Admin-only by default: No
  • Example: !version

volume

  • Description: Changes the volume if an argument is provided, outputs the current volume otherwise.
  • Default Aliases: volume, vol
  • Arguments: (Optional) New volume
  • Admin-only by default: No
  • Example: !volume 0.5

Contributing

Contributions to MumbleDJ are always welcome! Please see the contribution guidelines for instructions and suggestions!

Author

Matthieu Grieger

License

The MIT License (MIT)

Copyright (c) 2016 Matthieu Grieger

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

Thanks

mumbledj's People

Contributors

alucardrd avatar benklett avatar cmahaff avatar danielmarquard avatar dylanetaft avatar fiveofeight avatar gplassard avatar jakexks avatar matthieugrieger avatar mattikus avatar mjljr avatar mkbwong avatar mkody avatar mpacella88 avatar mrkrucible avatar nkhoit avatar zeblau avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mumbledj's Issues

Auto-reconnect Feature?

At times some connection gets broken between either my Mumble server, or the VPS I put MumbleDJ on. Can an auto-reconnect feature be added so I don't have to restart MumbleDJ everytime the connection goes down?

Index out of range on dj.conf.General.CommandPrefix

I know this might be a bad bug report, but strangely today I was no longer able start mumbleDJ due to Index Out of Range on

https://github.com/matthieugrieger/mumbledj/blob/master/main.go#L99

panic: runtime error: index out of range

goroutine 5 [running]:
main.(*mumbledj).OnTextMessage(0xb833a0, 0xc20800ed90)
        /opt/djmumble/mumbledj/main.go:99 +0x7e
main.*mumbledj.OnTextMessage·fm(0xc20800ed90)
        /opt/djmumble/mumbledj/main.go:196 +0x31
github.com/layeh/gumble/gumbleutil.Listener.OnTextMessage(0xc208028b10, 0xc208028b20, 0xc208028b30, 0xc208028b40, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
        /opt/djmumble/mumbledj/.vendor/src/github.com/layeh/gumble/gumbleutil/listener.go:44 +0x37
github.com/layeh/gumble/gumbleutil.(*Listener).OnTextMessage(0xc20802e370, 0xc20800ed90)
        <autogenerated>:3 +0xaa
github.com/layeh/gumble/gumble.eventMultiplexer.OnTextMessage(0xc20803aff0, 0xc20803b020, 0xc20800ed90)
        /opt/djmumble/mumbledj/.vendor/src/github.com/layeh/gumble/gumble/eventmultiplexer.go:62 +0x57
github.com/layeh/gumble/gumble.handleTextMessage(0xc208066630, 0xc2080c6000, 0xb7, 0xb7, 0x0, 0x0)
        /opt/djmumble/mumbledj/.vendor/src/github.com/layeh/gumble/gumble/handlers.go:589 +0x8f8
github.com/layeh/gumble/gumble.(*Client).readRoutine(0xc208066630)
        /opt/djmumble/mumbledj/.vendor/src/github.com/layeh/gumble/gumble/client.go:182 +0x1cf
created by github.com/layeh/gumble/gumble.(*Client).Connect
        /opt/djmumble/mumbledj/.vendor/src/github.com/layeh/gumble/gumble/client.go:116 +0x5dc

goroutine 1 [chan receive]:
main.main()
        /opt/djmumble/mumbledj/main.go:206 +0xb7b

goroutine 17 [syscall, locked to thread]:
runtime.goexit()
        /usr/local/go/src/runtime/asm_amd64.s:2232 +0x1

goroutine 6 [select]:
github.com/layeh/gumble/gumble.(*Client).pingRoutine(0xc208066630)
        /opt/djmumble/mumbledj/.vendor/src/github.com/layeh/gumble/gumble/client.go:159 +0x2dc
created by github.com/layeh/gumble/gumble.(*Client).Connect
        /opt/djmumble/mumbledj/.vendor/src/github.com/layeh/gumble/gumble/client.go:117 +0x5f9

Making the following code changes I was able to fix it for myself

    // OnTextMessage event. Checks for command prefix, and calls parseCommand if it exists. Ignores
    // the incoming message otherwise.
    func (dj *mumbledj) OnTextMessage(e *gumble.TextMessageEvent) {
            plainMessage := gumbleutil.PlainText(&e.TextMessage)
            if len(plainMessage) >= 2 {
                    if string(plainMessage[0]) == dj.conf.General.CommandPrefix {
                            parseCommand(e.Sender, e.Sender.Name, plainMessage[1:])
                    }
            }
    }

AUDIO_FAIL_MSG

I had an issue where my distribution of ubuntu having an older version of youtube-dl in apt-get, which causes the AUDIO_FAIL_MSG / "The audio download for this video failed. YouTube has likely not generated the audio files for this video yet." message to appear whenever you try to !add a song. This is somewhat confusing, as it's really a dependency issue.

It looks so similar to this issue #21 that I thought it was actually an issue with youtube, and not with my configuration.

Not a big issue, I just wanted to mention it. Thanks for writing this, it works great.

Unable to make

go get github.com/nitrous-io/goop
package code.google.com/p/go.tools/go/vcs: Get https://code.google.com/p/go/source/checkout?repo=tools: x509: failed to load system roots and no roots provided
make: *** [mumbledj] Error 1

Not sure what I did wrong

Bot crashes while changing to youtube playlist URL

I was playing around a bit as tester, could then reproduce the following behaviour while playing one youtube URL and skipping then to a youtube-playlist URL, it seems only affect playlist URLs:

[19:02:01] An Music: !add https://www.youtube.com/watch?v=R8MWKsheHxk
[19:02:02] MumbleDJ: raz0rsedge added "'The Journey' (2 Hour Drum & Bass Mix)" to the queue.
[19:02:44] An Music: !add http://www.youtube.com/playlist?list=PL71A8OkKAS9QH1ervN6bpCKcnmGC0-MlO
[19:02:45] MumbleDJ: raz0rsedge has added the playlist "" to the queue. ???
[19:03:47] An Music: !skip
[19:03:47] MumbleDJ: raz0rsedge has voted to skip the current song.
[19:03:47] MumbleDJ: The number of votes required for a skip has been met. Skipping song!
[19:03:47] MumbleDJ left the server. ???

I could reproduce this with any playlist URL in 2.2.4
I hope I could help as proof tester

MumbleDJ doesn't start playing

Hello,
I succesfully installed MumbleDJ on my Ubuntu 14.04 - The only Problem: MumbleDJ doesn't start with playing, but everything else works like a charm. Here is a Screenshot where you can see that Bot added the songs:

http://ni507446_3.fastdownload.nitrado.net/mumbledj.png

I also checked the song directory in my ~/, and everything looks OK. So Youtube-DL isn't the problem.

Go Version is 1.3.3
MumbleDJ cloned today.

Freeze on !add and crash on !skip

Finally decided to upgrade to the gumble version of your bot, and thank you very much for developing it! I've come across a similar problem to my first issue and it's happening on a Debian machine again.

Running !add freezes the bot up with no feedback. Typing out !skip when something isn't in queue gives me this dump. Just from looking at it I think I'm probably missing something Go related; go version gives out 1.4

Command used to start bot...
$ mumbledj -server=mymumble -port=64738 -username=Data -password="" -channel=music

Channel doesn't exist or one was not provided, staying in root channel...
Configuration successfully loaded!
panic: runtime error: index out of range

goroutine 5 [running]:
main.skip(0xc20800cd00, 0xc208099250, 0xa, 0x0)
        /home/kirk/git/mumbledj/commands.go:205 +0xf58
main.parseCommand(0xc20800cd00, 0xc208099250, 0xa, 0xc2080f5111, 0x4)
        /home/kirk/git/mumbledj/commands.go:45 +0x317
main.(*mumbledj).OnTextMessage(0xc28760, 0xc2080fd490)
        /home/kirk/git/mumbledj/main.go:69 +0xce
main.*mumbledj.OnTextMessage·fm(0xc2080fd490)
        /home/kirk/git/mumbledj/main.go:117 +0x31
github.com/layeh/gumble/gumbleutil.Listener.OnTextMessage(0xc20802aac0, 0xc20802aad0, 0xc20802aae0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
        /home/kirk/go/src/github.com/layeh/gumble/gumbleutil/listener.go:44 +0x37
github.com/layeh/gumble/gumbleutil.(*Listener).OnTextMessage(0xc208030320, 0xc2080fd490)
        <autogenerated>:3 +0xaa
github.com/layeh/gumble/gumble.eventMultiplexer.OnTextMessage(0xc20803d410, 0xc20803d440, 0xc2080fd490)
        /home/kirk/go/src/github.com/layeh/gumble/gumble/eventmultiplexer.go:62 +0x57
github.com/layeh/gumble/gumble.handleTextMessage(0xc2080e0000, 0xc208033400, 0xc, 0x400, 0x0, 0x0)
        /home/kirk/go/src/github.com/layeh/gumble/gumble/handlers.go:582 +0x917
github.com/layeh/gumble/gumble.(*Client).readRoutine(0xc2080e0000)
        /home/kirk/go/src/github.com/layeh/gumble/gumble/client.go:204 +0x613
created by github.com/layeh/gumble/gumble.(*Client).Connect
        /home/kirk/go/src/github.com/layeh/gumble/gumble/client.go:108 +0x434

goroutine 1 [chan receive]:
main.main()
        /home/kirk/git/mumbledj/main.go:128 +0x4ea

goroutine 17 [syscall, locked to thread]:
runtime.goexit()
        /usr/local/go/src/runtime/asm_amd64.s:2232 +0x1

goroutine 6 [select]:
github.com/layeh/gumble/gumble.(*Client).pingRoutine(0xc2080e0000)
        /home/kirk/go/src/github.com/layeh/gumble/gumble/client.go:163 +0x2dc
created by github.com/layeh/gumble/gumble.(*Client).Connect
        /home/kirk/go/src/github.com/layeh/gumble/gumble/client.go:109 +0x451
kirk@kirk:~/git/mumbledj$ ```

Audio cutting out

Hi,

Your project is awesome and I am looking to use several features in my own bot which performs other tasks.

When I run your bot the audio cuts out constantly. All users on the server experience this. This does not happen to users who are talking, only to the bot. I believe it may be a format issue and have been trying to generate the .ogg files using exactly the same format as the piepan examples. I have recompiled libvorbis and ffmpeg with various versions/options, but my files are not the same. I wondered if you had this issue? It could be codec or a problem with piepan and longer length files.

When you run "strings song-converted.ogg | grep Vorbis" I get nothing, but from "strings lol.ogg | grep Vorbis" I get "Xiph.Org libVorbis I 20140122 (Turpak".

ffmpeg output shows:
encoder : Lavf53.21.1
Stream #0.0(eng): Audio: libvorbis, 48000 Hz, 1 channels, s16, 40 kb/s (default)

Windows properties show the Tool name field as Lavf53.21.1 for the converted ogg, and Xiph.Org lib Vorbis | 20120203 for the sample sounds.

Thanks!

2.2.5 make process

Okay today I'm getting this while trying to make V2.2.5, anyone else getting this error?

./commands.go:156: invalid operation: shortUrl != nil (mismatched types string and nil)
make: *** [mumbledj] Error 2

Feature Request: Radio/Shuffle mode

Having just started using mumbledj, I love it, it does exactly what I was looking for, but when using it a few small things came to mind that would be great to see.

Namely, a shuffle mode. We get pretty excited about adding songs to the playlist, and, often it occurs that any one song you add will not be playing for at least an hour, which is fine, but sometimes it would be nice to mix it up. Just having a !suffle or !shuffleon/!shuffleoff command would be awesome and improve our experience a lot.

Now, on a similar note, I had another idea that involved sort of a fall back playlist, something to play when nothing else is selected. This could be stored in a flat text file with youtube IDs even. User submitted songs would always take precedence, but when it new there was a break in the playlist coming up it would fallback to a predefined list (perhaps added to with commands? !radioadd !radiolist !radioremove.) This mode would always be on shuffle to keep it a bit dynamic, if people really want for some niche use, that could be turned off in settings.

The default mode of it would be interrupted as soon as anyone gives it something to play, and start as soon as it has nothing to play. Perhaps stopping if the channel is empty after a few minutes.

It would be cool if this was toggleable directly as well, but that might just be fluff. This would allow me to say !radioon, and force it to that mode.

Just some thoughts, I absolutely love it as is, but these thigns crossed my mind and thoguht I would share them.

Bug

I am sorry about the two different issues but I did not want to put two different things in the same post. I am currently having the problem that if i put a few songs in the Que if the Que gets empty and then a new song is added it will not start playing.

Build Error

goop go build .

./commands.go:278: cannot assign to dj.audioStream.Volume
./commands.go:278: cannot use newVolume (type float32) as type func() float32 in assignment
./main.go:54: cannot assign to dj.audioStream.Volume
./main.go:54: cannot use dj.conf.Volume.DefaultVolume (type float32) as type func() float32 in assignment
./song.go:88: too many arguments in call to dj.audioStream.Play
goop: Command failed with exit status 2
make: *** [mumbledj] Error 2

I'd like to point out that MumbleDJ should be installable by a normal user - because we have a lot of multiuser linux environments out there and it's imho not necessary to use a root account...
In the past I simply did this by changing the cp command line in the Makefile:
cp -f mumbledj ~/bin/mumbledj

If I try to build goop separately as user, I get lots of errors... my GOPATH var seems to be not used anymore... however I can build the goop binary but then I get stuck on goop go build .

Minor: large mixes make queue hung for a while

My friends used to add some mixes to the mumbledj queue, for instance a 237 minutes lasting megamix - I dunno whether it was a joke or serious =)
MumbleDJ then needs a very long time to process this 4h Mix (I asume to render the m4a..) I wonder if there is a way to produce a textmessage if the processing is longer than 30 seconds maybe:
"MumbleDJ is processing an !add request..." or sumthin, because there's only the User has added "XY" to the queue message.

We talked about the way the queue is processed, afaik after playback while movin onto next song in queue the last song is deleted. For future improvement like !random or !repeat[song,playlist] I suggest an internal memory of the !add commands, so maybe that's a way mumbledj can remember the contents of the queue to a certain date.

Lets say we have added 2 playlists to the queue and after that we have at the end of the playtime some users wish to repeat whole 2 playlists - at the current state thats not possible afaik - but if MumbleDJ has cached the !add requests, it is able to repeat playlists or just internally repeat the cached !add commands...

That all is not important for now, but I'd like to know what other users think about it... heading into DJ capability direction ;-)

Thx again Matt for being so patient with me.

make error

On CentOS as non-privileged user I get this error while make, I couldn't find out where the build-process is searching for the opus.h file since gopus.h simply includes opus.h from which path?:

go get -u github.com/layeh/gumble/gumble

github.com/layeh/gopus

In file included from ../src/github.com/layeh/gopus/decoder.go:4:
gopus.h:1:18: error: opus.h: No such file or directory

!command bugs

! is the same as !skipplaylist - I don't think it should do anything.. it's not a command just a character.

when using !add, a newline after the youtube url will 'added "" to the queue.' and break it. A !reset after this causes crash.

!move does not work with sub channels.

Works fine for channels after root (case sensitive is annoying)
any channel deeper will not work ie game1 or subchan1

root
-AFK
-Games
--game1
--game2
-Notgamming
--subchan1
--subchan2

Using !skip two times by the same user crashes bot

I got my guys breaking this bot by spamming !skip, but it's probably related to the previous issue.

Here's the dump I got.

kirk@kirk:~/git/mumbledj$ mumbledj -server=mumble.justsomegamers.com -port=6052 -username=Data -password="" -channel=M

Channel doesn't exist or one was not provided, staying in root channel...
Configuration successfully loaded!
panic: An error occurred while adding a skip to the current song.

goroutine 5 [running]:
main.skip(0xc20800ca00, 0xc2081051a0, 0xf, 0x0)
        /home/kirk/git/mumbledj/commands.go:224 +0xf0a
main.parseCommand(0xc20800ca00, 0xc2081051a0, 0xf, 0xc208104dd9, 0x4)
        /home/kirk/git/mumbledj/commands.go:45 +0x317
main.(*mumbledj).OnTextMessage(0xc28760, 0xc20810dea0)
        /home/kirk/git/mumbledj/main.go:69 +0xce
main.*mumbledj.OnTextMessage·fm(0xc20810dea0)
        /home/kirk/git/mumbledj/main.go:117 +0x31
github.com/layeh/gumble/gumbleutil.Listener.OnTextMessage(0xc20802aac0, 0xc20802aad0, 0xc20802aae0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
        /home/kirk/go/src/github.com/layeh/gumble/gumbleutil/listener.go:44 +0x37
github.com/layeh/gumble/gumbleutil.(*Listener).OnTextMessage(0xc208030320, 0xc20810dea0)
        <autogenerated>:3 +0xaa
github.com/layeh/gumble/gumble.eventMultiplexer.OnTextMessage(0xc20803d410, 0xc20803d440, 0xc20810dea0)
        /home/kirk/go/src/github.com/layeh/gumble/gumble/eventmultiplexer.go:62 +0x57
github.com/layeh/gumble/gumble.handleTextMessage(0xc20806e000, 0xc208033400, 0xb, 0x400, 0x0, 0x0)
        /home/kirk/go/src/github.com/layeh/gumble/gumble/handlers.go:582 +0x917
github.com/layeh/gumble/gumble.(*Client).readRoutine(0xc20806e000)
        /home/kirk/go/src/github.com/layeh/gumble/gumble/client.go:204 +0x613
created by github.com/layeh/gumble/gumble.(*Client).Connect
        /home/kirk/go/src/github.com/layeh/gumble/gumble/client.go:108 +0x434

goroutine 1 [chan receive, 13 minutes]:
main.main()
        /home/kirk/git/mumbledj/main.go:128 +0x4ea

goroutine 17 [syscall, 13 minutes, locked to thread]:
runtime.goexit()
        /usr/local/go/src/runtime/asm_amd64.s:2232 +0x1

goroutine 6 [select]:
github.com/layeh/gumble/gumble.(*Client).pingRoutine(0xc20806e000)
        /home/kirk/go/src/github.com/layeh/gumble/gumble/client.go:163 +0x2dc
created by github.com/layeh/gumble/gumble.(*Client).Connect
        /home/kirk/go/src/github.com/layeh/gumble/gumble/client.go:109 +0x451

goroutine 13 [select]:
github.com/layeh/gumble/gumble_ffmpeg.(*Stream).sourceRoutine(0xc20802c680)
        /home/kirk/go/src/github.com/layeh/gumble/gumble_ffmpeg/gumble_ffmpeg.go:89 +0x452
created by github.com/layeh/gumble/gumble_ffmpeg.(*Stream).Play
        /home/kirk/go/src/github.com/layeh/gumble/gumble_ffmpeg/gumble_ffmpeg.go:47 +0x39d

goroutine 10 [IO wait]:
net.(*pollDesc).Wait(0xc208011020, 0x72, 0x0, 0x0)
        /usr/local/go/src/net/fd_poll_runtime.go:84 +0x47
net.(*pollDesc).WaitRead(0xc208011020, 0x0, 0x0)
        /usr/local/go/src/net/fd_poll_runtime.go:89 +0x43
net.(*netFD).Read(0xc208010fc0, 0xc208106000, 0x1000, 0x1000, 0x0, 0x7fac5af31d70, 0xc208105030)
        /usr/local/go/src/net/fd_unix.go:242 +0x40f
net.(*conn).Read(0xc20802e088, 0xc208106000, 0x1000, 0x1000, 0x0, 0x0, 0x0)
        /usr/local/go/src/net/net.go:121 +0xdc
net/http.noteEOFReader.Read(0x7fac5af33290, 0xc20802e088, 0xc2080be108, 0xc208106000, 0x1000, 0x1000, 0x740da0, 0x0, 0x0)
        /usr/local/go/src/net/http/transport.go:1270 +0x6e
net/http.(*noteEOFReader).Read(0xc20801eca0, 0xc208106000, 0x1000, 0x1000, 0xc208012000, 0x0, 0x0)
        <autogenerated>:125 +0xd4
bufio.(*Reader).fill(0xc20800a780)
        /usr/local/go/src/bufio/bufio.go:97 +0x1ce
bufio.(*Reader).Peek(0xc20800a780, 0x1, 0x0, 0x0, 0x0, 0x0, 0x0)
        /usr/local/go/src/bufio/bufio.go:132 +0xf0
net/http.(*persistConn).readLoop(0xc2080be0b0)
        /usr/local/go/src/net/http/transport.go:842 +0xa4
created by net/http.(*Transport).dialConn
        /usr/local/go/src/net/http/transport.go:660 +0xc9f

goroutine 11 [select]:
net/http.(*persistConn).writeLoop(0xc2080be0b0)
        /usr/local/go/src/net/http/transport.go:945 +0x41d
created by net/http.(*Transport).dialConn
        /usr/local/go/src/net/http/transport.go:661 +0xcbc
kirk@kirk:~/git/mumbledj$ ./data.sh
Channel doesn't exist or one was not provided, staying in root channel...
Configuration successfully loaded!
panic: An error occurred while adding a skip to the current song.

goroutine 5 [running]:
main.skip(0xc20800d700, 0xc2081025b0, 0xa, 0x0)
        /home/kirk/git/mumbledj/commands.go:224 +0xf0a
main.parseCommand(0xc20800d700, 0xc2081025b0, 0xa, 0xc2081038b1, 0x4)
        /home/kirk/git/mumbledj/commands.go:45 +0x317
main.(*mumbledj).OnTextMessage(0xc28760, 0xc2082bdce0)
        /home/kirk/git/mumbledj/main.go:69 +0xce
main.*mumbledj.OnTextMessage·fm(0xc2082bdce0)
        /home/kirk/git/mumbledj/main.go:117 +0x31
github.com/layeh/gumble/gumbleutil.Listener.OnTextMessage(0xc20802aac0, 0xc20802aad0, 0xc20802aae0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
        /home/kirk/go/src/github.com/layeh/gumble/gumbleutil/listener.go:44 +0x37
github.com/layeh/gumble/gumbleutil.(*Listener).OnTextMessage(0xc208030320, 0xc2082bdce0)
        <autogenerated>:3 +0xaa
github.com/layeh/gumble/gumble.eventMultiplexer.OnTextMessage(0xc20803d410, 0xc20803d440, 0xc2082bdce0)
        /home/kirk/go/src/github.com/layeh/gumble/gumble/eventmultiplexer.go:62 +0x57
github.com/layeh/gumble/gumble.handleTextMessage(0xc20806e000, 0xc208033400, 0xb, 0x400, 0x0, 0x0)
        /home/kirk/go/src/github.com/layeh/gumble/gumble/handlers.go:582 +0x917
github.com/layeh/gumble/gumble.(*Client).readRoutine(0xc20806e000)
        /home/kirk/go/src/github.com/layeh/gumble/gumble/client.go:204 +0x613
created by github.com/layeh/gumble/gumble.(*Client).Connect
        /home/kirk/go/src/github.com/layeh/gumble/gumble/client.go:108 +0x434

goroutine 1 [chan receive]:
main.main()
        /home/kirk/git/mumbledj/main.go:128 +0x4ea

goroutine 17 [syscall, locked to thread]:
runtime.goexit()
        /usr/local/go/src/runtime/asm_amd64.s:2232 +0x1

goroutine 6 [select]:
github.com/layeh/gumble/gumble.(*Client).pingRoutine(0xc20806e000)
        /home/kirk/go/src/github.com/layeh/gumble/gumble/client.go:163 +0x2dc
created by github.com/layeh/gumble/gumble.(*Client).Connect
        /home/kirk/go/src/github.com/layeh/gumble/gumble/client.go:109 +0x451

goroutine 12 [select]:
github.com/layeh/gumble/gumble_ffmpeg.(*Stream).sourceRoutine(0xc20802c680)
        /home/kirk/go/src/github.com/layeh/gumble/gumble_ffmpeg/gumble_ffmpeg.go:89 +0x452
created by github.com/layeh/gumble/gumble_ffmpeg.(*Stream).Play
        /home/kirk/go/src/github.com/layeh/gumble/gumble_ffmpeg/gumble_ffmpeg.go:47 +0x39d

goroutine 10 [IO wait]:
net.(*pollDesc).Wait(0xc208010f40, 0x72, 0x0, 0x0)
        /usr/local/go/src/net/fd_poll_runtime.go:84 +0x47
net.(*pollDesc).WaitRead(0xc208010f40, 0x0, 0x0)
        /usr/local/go/src/net/fd_poll_runtime.go:89 +0x43
net.(*netFD).Read(0xc208010ee0, 0xc208100000, 0x1000, 0x1000, 0x0, 0x7f6fe15e6d70, 0xc2080bd5a0)
        /usr/local/go/src/net/fd_unix.go:242 +0x40f
net.(*conn).Read(0xc20802e088, 0xc208100000, 0x1000, 0x1000, 0x0, 0x0, 0x0)
        /usr/local/go/src/net/net.go:121 +0xdc
net/http.noteEOFReader.Read(0x7f6fe15e8290, 0xc20802e088, 0xc2080be108, 0xc208100000, 0x1000, 0x1000, 0x740da0, 0x0, 0x0)
        /usr/local/go/src/net/http/transport.go:1270 +0x6e
net/http.(*noteEOFReader).Read(0xc20801ec40, 0xc208100000, 0x1000, 0x1000, 0xc208012000, 0x0, 0x0)
        <autogenerated>:125 +0xd4
bufio.(*Reader).fill(0xc20800a960)
        /usr/local/go/src/bufio/bufio.go:97 +0x1ce
bufio.(*Reader).Peek(0xc20800a960, 0x1, 0x0, 0x0, 0x0, 0x0, 0x0)
        /usr/local/go/src/bufio/bufio.go:132 +0xf0
net/http.(*persistConn).readLoop(0xc2080be0b0)
        /usr/local/go/src/net/http/transport.go:842 +0xa4
created by net/http.(*Transport).dialConn
        /usr/local/go/src/net/http/transport.go:660 +0xc9f

goroutine 11 [select]:
net/http.(*persistConn).writeLoop(0xc2080be0b0)
        /usr/local/go/src/net/http/transport.go:945 +0x41d
created by net/http.(*Transport).dialConn
        /usr/local/go/src/net/http/transport.go:661 +0xcbc

Posting binary image data in chat causes crash

Easily reproducible, pasting binary image data to chat in a channel where the bot resides seems to make it crash. That is to say, not a link to an image, but the actual image itself, to make it show inline.

Steps to reproduce:
Find any random image in your browser, "Copy Image" from context menu.
Right click on channel name in mumble, send message, paste it in the contents
Send it.

Poof, crash.

If this is something isolated to just me and you can't reproduce it, I can get a log soon when everyone's done using mumble for the day.

gopus function ends without return statement

$ make
go get -u github.com/layeh/gumble/gumble

github.com/layeh/gopus

gopus.go:32[/tmp/go-build747645988/github.com/layeh/gopus/_obj/gopus.cgo1.go:27]: function ends without a return statement
make: *** [mumbledj] Error 2

Am I missing something?

Audio cutting out

I see that someone was having this problem previously but it does not look like it was resolved for him. I was just wandering if anyone else was having this problem and knows how to fix it.

goop

Hello, I have a problem:

go get github.com/nitrous-io/goop
rm -rf Goopfile.lock
goop install
make: goop: Command not found
make: *** [mumbledj] Error 127

How to solve it?
Best Regards

Feature requests

  1. be able to set a comment on bot - ie 'I'm just a bot - type !help in channel'

  2. Add some way to tell if the !currentsong is from a playlist

Problem with the !move command

I noticed that the bot can't move to the channels with a space in them. This isn't a huge problem, but is there a simple fix for this?

Bot freezes and disconnects on !add command

Output from terminal:
$ botmaster@debian-swirl:~/mumbledj/mumbledj$ ./piepan -u Jukebot -s myipaddress mumbledj.lua
$ Jukebot has connected to the server!
$ Error: src/piepan_impl.lua:351: channel must be a piepan.Channel
$ MrKrucible has told the bot to add the following URL to the queue: https://www.youtube.com/watch?v=mAFvaKAMAPg.

!kill does not disconnect the bot AFTER !add is entered, then the bot disconnects after a few seconds.
Is this related to the piepan.Channel error or is there something I could me missing from the Setup?

Admins list not applying

Adding new names to the Admins list like Admins = "MrKrucible" still does not apply access to admin commands.

Though changing my name to Matt enables me to use the admin commands, even if Admins = "Matt" is not in the mumble.gcfg file.

Running sudo nano mumble.gcfg so I know the file has been written and double-checked spelling.

audio download failed, numsongs still 1 (does not skip to next song)

I'm seeing a lot more 'audio download fails' lately, and on songs that have worked in the past.

If one of these songs is the first to get added it will not skip and need a !reset - you can !add but nothing is played, the song is not actually skipped

Also Ive been experimenting with multiple bots on different servers do you for see any problems with this?

Client crashing after a few hours of play time.

What kind of !uptime and !totalplayed songs do people get? I'm crashing after about 2 hours of playing. All I have is output when it panics hope it is helpful. please advise.

panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xb code=0x1 addr=0x0 pc=0x45eb44]

goroutine 80 [running]:
runtime.panic(0x783fc0, 0xbfd813)
/usr/lib/go/src/pkg/runtime/panic.c:279 +0xf5
github.com/layeh/gumble/gumble.(_User).Send(0x0, 0x8a94d0, 0x6e)
/home/user/gobuild/src/github.com/layeh/gumble/gumble/user.go:266 +0x104
main.(_SongQueue).PrepareAndPlayNextItem(0xc20803c0a0)
/home/user/gobuild/src/github.com/matthieugrieger/mumbledj/songqueue.go:144 +0x3c5
main.(_SongQueue).OnItemFinished(0xc20803c0a0)
/home/user/gobuild/src/github.com/matthieugrieger/mumbledj/songqueue.go:109 +0x463
main._SongQueue.OnItemFinished·fm()
/home/user/gobuild/src/github.com/matthieugrieger/mumbledj/main.go:54 +0x26
github.com/layeh/gumble/gumble_ffmpeg.func·001()
/home/user/gobuild/src/github.com/layeh/gumble/gumble_ffmpeg/gumble_ffmpeg.go:99 +0xa5
github.com/layeh/gumble/gumble_ffmpeg.(_Stream).sourceRoutine(0xc2080cc360)
/home/user/gobuild/src/github.com/layeh/gumble/gumble_ffmpeg/gumble_ffmpeg.go:112 +0x2b2
created by github.com/layeh/gumble/gumble_ffmpeg.(_Stream).Play
/home/user/gobuild/src/github.com/layeh/gumble/gumble_ffmpeg/gumble_ffmpeg.go:60 +0x31e

goroutine 16 [chan receive, 96 minutes]:
main.main()
/home/user/gobuild/src/github.com/matthieugrieger/mumbledj/main.go:147 +0x4ef

goroutine 19 [finalizer wait, 4 minutes]:
runtime.park(0x41fa40, 0xc15ec0, 0xc023a9)
/usr/lib/go/src/pkg/runtime/proc.c:1369 +0x89
runtime.parkunlock(0xc15ec0, 0xc023a9)
/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, 96 minutes]:
runtime.goexit()
/usr/lib/go/src/pkg/runtime/proc.c:1445

goroutine 20 [IO wait]:
net.runtime_pollWait(0x7f3e194b4970, 0x72, 0x0)
/usr/lib/go/src/pkg/runtime/netpoll.goc:146 +0x66
net.(_pollDesc).Wait(0xc208024300, 0x72, 0x0, 0x0)
/usr/lib/go/src/pkg/net/fd_poll_runtime.go:84 +0x46
net.(_pollDesc).WaitRead(0xc208024300, 0x0, 0x0)
/usr/lib/go/src/pkg/net/fd_poll_runtime.go:89 +0x42
net.(_netFD).Read(0xc2080242a0, 0xc20803ac00, 0x400, 0x400, 0x0, 0x7f3e194b3418, 0xb)
/usr/lib/go/src/pkg/net/fd_unix.go:242 +0x34c
net.(_conn).Read(0xc208038028, 0xc20803ac00, 0x400, 0x400, 0x0, 0x0, 0x0)
/usr/lib/go/src/pkg/net/net.go:122 +0xe7
crypto/tls.(_block).readFromUntil(0xc208021620, 0x7f3e194b4a48, 0xc208038028, 0x5, 0x0, 0x0)
/usr/lib/go/src/pkg/crypto/tls/conn.go:451 +0xd9
crypto/tls.(_Conn).readRecord(0xc208074580, 0x17, 0x0, 0x0)
/usr/lib/go/src/pkg/crypto/tls/conn.go:536 +0x1ff
crypto/tls.(_Conn).Read(0xc208074580, 0xc20823d770, 0x2, 0x8, 0x0, 0x0, 0x0)
/usr/lib/go/src/pkg/crypto/tls/conn.go:901 +0x16a
io.ReadAtLeast(0x7f3e194b4f08, 0xc208074580, 0xc20823d770, 0x2, 0x8, 0x2, 0x0, 0x0, 0x0)
/usr/lib/go/src/pkg/io/io.go:289 +0xf7
io.ReadFull(0x7f3e194b4f08, 0xc208074580, 0xc20823d770, 0x2, 0x8, 0x4, 0x0, 0x0)
/usr/lib/go/src/pkg/io/io.go:307 +0x71
encoding/binary.Read(0x7f3e194b4f08, 0xc208074580, 0x7f3e194b4e20, 0x0, 0x6b63c0, 0xc20823d768, 0x0, 0x0)
/usr/lib/go/src/pkg/encoding/binary/binary.go:147 +0x12b
github.com/layeh/gumble/gumble.(_Client).readRoutine(0xc2080f0000)
/home/user/gobuild/src/github.com/layeh/gumble/gumble/client.go:190 +0x23d
created by github.com/layeh/gumble/gumble.(*Client).Connect
/home/user/gobuild/src/github.com/layeh/gumble/gumble/client.go:111 +0x344

goroutine 21 [select]:
github.com/layeh/gumble/gumble.(_Client).pingRoutine(0xc2080f0000)
/home/user/gobuild/src/github.com/layeh/gumble/gumble/client.go:166 +0x291
created by github.com/layeh/gumble/gumble.(_Client).Connect
/home/user/gobuild/src/github.com/layeh/gumble/gumble/client.go:112 +0x35f
[1]+ Exit 2 ./mumbledj -server=hostname.net -port=64738 -username=iPlayMuzak -channel=Surfin


panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xb code=0x1 addr=0x0 pc=0x45eb44]

goroutine 77 [running]:
runtime.panic(0x783fc0, 0xbfd813)
/usr/lib/go/src/pkg/runtime/panic.c:279 +0xf5
github.com/layeh/gumble/gumble.(_User).Send(0x0, 0x8a94d0, 0x6e)
/home/user/gobuild/src/github.com/layeh/gumble/gumble/user.go:266 +0x104
main.(_SongQueue).PrepareAndPlayNextItem(0xc20803c0a0)
/home/user/gobuild/src/github.com/matthieugrieger/mumbledj/songqueue.go:144 +0x3c5
main.(_SongQueue).OnItemFinished(0xc20803c0a0)
/home/user/gobuild/src/github.com/matthieugrieger/mumbledj/songqueue.go:109 +0x463
main._SongQueue.OnItemFinished·fm()
/home/user/gobuild/src/github.com/matthieugrieger/mumbledj/main.go:54 +0x26
github.com/layeh/gumble/gumble_ffmpeg.func·001()
/home/user/gobuild/src/github.com/layeh/gumble/gumble_ffmpeg/gumble_ffmpeg.go:99 +0xa5
github.com/layeh/gumble/gumble_ffmpeg.(_Stream).sourceRoutine(0xc20810acc0)
/home/user/gobuild/src/github.com/layeh/gumble/gumble_ffmpeg/gumble_ffmpeg.go:112 +0x2b2
created by github.com/layeh/gumble/gumble_ffmpeg.(_Stream).Play
/home/user/gobuild/src/github.com/layeh/gumble/gumble_ffmpeg/gumble_ffmpeg.go:60 +0x31e

goroutine 16 [chan receive, 244 minutes]:
main.main()
/home/user/gobuild/src/github.com/matthieugrieger/mumbledj/main.go:147 +0x4ef

goroutine 19 [finalizer wait, 4 minutes]:
runtime.park(0x41fa40, 0xc15ec0, 0xc023a9)
/usr/lib/go/src/pkg/runtime/proc.c:1369 +0x89
runtime.parkunlock(0xc15ec0, 0xc023a9)
/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, 244 minutes]:
runtime.goexit()
/usr/lib/go/src/pkg/runtime/proc.c:1445

goroutine 20 [IO wait]:
net.runtime_pollWait(0x7fd1e87dda58, 0x72, 0x0)
/usr/lib/go/src/pkg/runtime/netpoll.goc:146 +0x66
net.(_pollDesc).Wait(0xc208024300, 0x72, 0x0, 0x0)
/usr/lib/go/src/pkg/net/fd_poll_runtime.go:84 +0x46
net.(_pollDesc).WaitRead(0xc208024300, 0x0, 0x0)
/usr/lib/go/src/pkg/net/fd_poll_runtime.go:89 +0x42
net.(_netFD).Read(0xc2080242a0, 0xc20803a800, 0x400, 0x400, 0x0, 0x7fd1e87dc418, 0xb)
/usr/lib/go/src/pkg/net/fd_unix.go:242 +0x34c
net.(_conn).Read(0xc208038028, 0xc20803a800, 0x400, 0x400, 0x0, 0x0, 0x0)
/usr/lib/go/src/pkg/net/net.go:122 +0xe7
crypto/tls.(_block).readFromUntil(0xc2080215f0, 0x7fd1e87ddb30, 0xc208038028, 0x5, 0x0, 0x0)
/usr/lib/go/src/pkg/crypto/tls/conn.go:451 +0xd9
crypto/tls.(_Conn).readRecord(0xc2080be000, 0x17, 0x0, 0x0)
/usr/lib/go/src/pkg/crypto/tls/conn.go:536 +0x1ff
crypto/tls.(_Conn).Read(0xc2080be000, 0xc20810d730, 0x2, 0x8, 0x0, 0x0, 0x0)
/usr/lib/go/src/pkg/crypto/tls/conn.go:901 +0x16a
io.ReadAtLeast(0x7fd1e87ddff0, 0xc2080be000, 0xc20810d730, 0x2, 0x8, 0x2, 0x0, 0x0, 0x0)
/usr/lib/go/src/pkg/io/io.go:289 +0xf7
io.ReadFull(0x7fd1e87ddff0, 0xc2080be000, 0xc20810d730, 0x2, 0x8, 0x4, 0x0, 0x0)
/usr/lib/go/src/pkg/io/io.go:307 +0x71
encoding/binary.Read(0x7fd1e87ddff0, 0xc2080be000, 0x7fd1e87ddf08, 0x0, 0x6b63c0, 0xc20810d728, 0x0, 0x0)
/usr/lib/go/src/pkg/encoding/binary/binary.go:147 +0x12b
github.com/layeh/gumble/gumble.(_Client).readRoutine(0xc2080f0000)
/home/user/gobuild/src/github.com/layeh/gumble/gumble/client.go:190 +0x23d
created by github.com/layeh/gumble/gumble.(*Client).Connect
/home/user/gobuild/src/github.com/layeh/gumble/gumble/client.go:111 +0x344

goroutine 21 [select]:
github.com/layeh/gumble/gumble.(_Client).pingRoutine(0xc2080f0000)
/home/user/gobuild/src/github.com/layeh/gumble/gumble/client.go:166 +0x291
created by github.com/layeh/gumble/gumble.(_Client).Connect
/home/user/gobuild/src/github.com/layeh/gumble/gumble/client.go:112 +0x35f

Plans For SoundCloud

Does it look like SoundCloud could be implemented as the next big update for MumbleDJ?

Request 2

On the topic of requests by caindrac, my guys have asked for a simple !help command.

I can see that now the issues section is kinda blowing up XD
Good to see more people getting interested in this project.

Make install fails

I'm trying to install MumbleDJ on an Arch Linux machine. The make-command runs throught perfectly, but when I want to 'make install' the following is the result:

mkdir -p ~/.mumbledj/config
mkdir -p ~/.mumbledj/songs
if [ -a ~/.mumbledj/config/mumbledj.gcfg ]; then mv ~/.mumbledj/config/mumbledj.gcfg ~/.mumbledj/config/mumbledj_backup.gcfg; fi;
cp -u mumbledj.gcfg ~/.mumbledj/config/mumbledj.gcfg
if [ -d ~/bin ]; then cp -f mumbledj ~/bin/mumbledj; else sudo cp -f mumbledj /usr/local/bin/mumbledj; fi;
cp: cannot stat 'mumbledj': No such file or directory
Makefile:13: recipe for target 'install' failed
make: *** [install] Error 1

What am I doing wrong?

Music doesn't start playing when I add a song.

So I installed it (using Go 1.4.1), as well as installing ffmpeg and mercurial.

However, when I add a song, the music doesn't start playing. It seems to know the song is there, but is not playing it.
image

After reading other issues, I made sure gopus and goprotobuf were installed. However, that does not seem to have fixed the issue.

I'm sure I'm doing something wrong, but do you know how to fix it?

Unabled to play music

I get this error with every YouTube link I try

The audio download for this video failed. YouTube has likely not generated the audio files for this video yet. Skipping to the next song!

Also, what's the command to add admins?

Question about a possible New Function

Is it possible for you to add command that will clear the whole que but not remove the bot from mumble. Basically !kill command with out the disconnect.

While attempting "make install," I receive this error:

=> Done!
goop go build .
user@ubuntu:~/dj$ make install
mkdir -p ~/.mumbledj/config
mkdir -p ~/.mumbledj/songs
if [ -a ~/.mumbledj/config/mumbledj.gcfg ]; then mv ~/.mumbledj/config/mumbledj.gcfg ~/.mumbledj/config/mumbledj_backup.gcfg; fi;
/bin/sh: 1: [: -a: unexpected operator
cp -u mumbledj.gcfg ~/.mumbledj/config/mumbledj.gcfg
if [ -d ~/bin ]; then cp -f mumbledj ~/bin/mumbledj; else sudo cp -f mumbledj /usr/local/bin/mumbledj; fi;
cp: cannot stat ‘mumbledj’: No such file or directory
make: *** [install] Error 1

Certificate support

Can you add support to use PEM keys to the bot for authenticating to the server?
He can't be registered and we can't add him different permissions for some channels with LCAs.

But thanks for this project, it works really fine and it's useful 👍

error youtube

Hello, I have this error.
The audio download for this video failed. YouTube has likely not generated the audio files for this video yet.

Best Regards

Problem

I am having a problem that start when I updated to the newest mumbleDJ version. When in installed the newest version I updated all the dependency packages. My murmur server runs at 62 kbit/s after this update my bot is only running at about 32 kbit/s and this is making the sound not clear. I don't know if this has something to do with the bot or gumble.

not sound

Hello, Happy new year, my bot runs but not sound.
I have a virtual machine that has no sound card, it is because her?
Codec : CELT 0.7.0
thank you

Can't download audio files whose Youtube ID starts with a dash "-"

Hi,

When I !add https://www.youtube.com/watch?v=-w-58hQ9dLk, I get the "The audio download for this video failed. YouTube has likely not generated the audio files for this video yet. Skipping to the next song!" error message.

The problem seems to be that youtube-dl doesn't recognise video IDs that start with a -.
youtube-dl -w-58hQ9dLk doesn't work because it confuses the ID with a command line option.
The audio files definitely exist on youtube.

youtube-dl "ytsearch:'-w-58hQ9dLk'" doesn't find any results either, so it looks like youtube-dl can't handle it when we only give it a video ID which starts with a -.

I worked around it for now by changing line 83 in song.go from
cmd := exec.Command("youtube-dl", "--output", fmt.Sprintf(/.mumbledj/songs/%s.m4a, s.youtubeId), "--format", "m4a", s.youtubeId)
to
cmd := exec.Command("youtube-dl", "--output", fmt.Sprintf(
/.mumbledj/songs/%s.m4a, s.youtubeId), "--format", "m4a", fmt.Sprintf(https://www.youtube.com/watch?v=%s`, s.youtubeId))`

It works of course if you do youtube-dl -- -w-58hQ9dLk or use the whole URL for example, but I don't think you or the youtube-dl devs want to have to handle such cases manually (if possible).

Thought I'd let you know of this. Do you think the youtube-dl devs would like to know about this issue or am I missing some obvious solution to this problem?

Make error (again)

After cloning and navigating to the directory on my ubuntu server, I get this when I try to make it:

go get -u github.com/layeh/gumble/gumble

github.com/layeh/gumble/gumble

/root/go/src/github.com/layeh/gumble/gumble/client.go:97: undefined: tls.DialWithDialer
Makefile:4: recipe for target 'mumbledj' failed
make: *** [mumbledj] Error 2

How can I fix this? Thank you in advance!

MumbleDJ: The audio download for this video failed. YouTube has likely not generated the audio files for this video yet. Skipping to the next song!

Hello !

I am migrating from piepan (with mumble dj) to this great bot, but i cant play videos when i chat (i am admin in mumbledjconfig):
!add https://www.youtube.com/watch?v=cmXDqH26EMo
Message in mumble client:
jonybravo30 has added "Killzone: Shadow Fall - Review" to the queue.
[23:13:49] MumbleDJ: The audio download for this video failed. YouTube has likely not generated the audio files for this video yet. Skipping to the next song!
That happens with all youtube videos.

my execution:
ubuntu@ip:~/mumbledj-2.6.5$ ./mumbledj-2.6.5 -server=localhost -port=64738 -username=MumbleDJ -password="" -channel="ASD" -cert="" -key="" -insecure
Configuration successfully loaded!
(Nothing more)

¿What could It to be happening?Thanks in advance.

Fantastic tool, its awesome ^_^

Text to speech

We have a different bot on our mumble along with your bot. the other bot has Text to speech. basically a robot voice for people without mics. Maybe you could incorporate this?

Makefile errors on armhf

I'm attempting to run this off a Raspberry Pi (a small, inexpensive microcomputer) running a arm-specific distro of Wheezy. However, Wheezy doesn't (officially) support Go beyond 1.0.2.
I attempted to install 1.4.1 from source and simply got a nastier error. (All imports failed)

Would be possible to build MumbleDJ on a different box and copy it over to Raspian? Or would I just have to run it off a different system entirely?

panic: runtime error: index out of range

Heh
(He doesn't respond because of permissions on this channel, but that doesn't affect)

After exactly 5 minutes, the bot crashes.

Configuration successfully loaded!
panic: runtime error: index out of range

goroutine 8 [running]:
main.(*SongCache).ClearExpired(0xc20802a990)
        /root/mumbledj/cache.go:76 +0x5cd
created by main.(*mumbledj).OnConnect
        /root/mumbledj/main.go:69 +0x53c

goroutine 1 [chan receive, 5 minutes]:
main.main()
        /root/mumbledj/main.go:182 +0x988

goroutine 17 [syscall, 5 minutes, locked to thread]:
runtime.goexit()
        /usr/local/go/src/runtime/asm_amd64.s:2232 +0x1

goroutine 5 [IO wait]:
net.(*pollDesc).Wait(0xc20807a060, 0x72, 0x0, 0x0)
        /usr/local/go/src/net/fd_poll_runtime.go:84 +0x47
net.(*pollDesc).WaitRead(0xc20807a060, 0x0, 0x0)
        /usr/local/go/src/net/fd_poll_runtime.go:89 +0x43
net.(*netFD).Read(0xc20807a000, 0xc2080ca000, 0x8000, 0x8000, 0x0, 0x7ff952e2cbf0, 0xc208154158)
        /usr/local/go/src/net/fd_unix.go:242 +0x40f
net.(*conn).Read(0xc20802e020, 0xc2080ca000, 0x8000, 0x8000, 0x0, 0x0, 0x0)
        /usr/local/go/src/net/net.go:121 +0xdc
crypto/tls.(*block).readFromUntil(0xc20806a1b0, 0x7ff952e2e7c8, 0xc20802e020, 0x5, 0x0, 0x0)
        /usr/local/go/src/crypto/tls/conn.go:454 +0xe6
crypto/tls.(*Conn).readRecord(0xc208078000, 0x17, 0x0, 0x0)
        /usr/local/go/src/crypto/tls/conn.go:539 +0x2da
crypto/tls.(*Conn).Read(0xc208078000, 0xc208154150, 0x2, 0x8, 0x0, 0x0, 0x0)
        /usr/local/go/src/crypto/tls/conn.go:904 +0x166
io.ReadAtLeast(0x7ff952e2eef0, 0xc208078000, 0xc208154150, 0x2, 0x8, 0x2, 0x0, 0x0, 0x0)
        /usr/local/go/src/io/io.go:298 +0xf1
io.ReadFull(0x7ff952e2eef0, 0xc208078000, 0xc208154150, 0x2, 0x8, 0x4, 0x0, 0x0)
        /usr/local/go/src/io/io.go:316 +0x6d
encoding/binary.Read(0x7ff952e2eef0, 0xc208078000, 0x7ff952e2ee68, 0xbe4698, 0x6c6da0, 0xc208154148,
 0x0, 0x0)
        /usr/local/go/src/encoding/binary/binary.go:148 +0x12d
github.com/layeh/gumble/gumble.(*Conn).ReadPacket(0xc2080601c0, 0xc20812e000, 0x0, 0x0, 0x0, 0x0, 0x
0)
        /root/mumbledj/.vendor/src/github.com/layeh/gumble/gumble/conn.go:46 +0x22a
github.com/layeh/gumble/gumble.(*Client).readRoutine(0xc20809a000)
        /root/mumbledj/.vendor/src/github.com/layeh/gumble/gumble/client.go:173 +0x8d
created by github.com/layeh/gumble/gumble.(*Client).Connect
        /root/mumbledj/.vendor/src/github.com/layeh/gumble/gumble/client.go:113 +0x515

goroutine 6 [select]:
github.com/layeh/gumble/gumble.(*Client).pingRoutine(0xc20809a000)
        /root/mumbledj/.vendor/src/github.com/layeh/gumble/gumble/client.go:156 +0x2dc
created by github.com/layeh/gumble/gumble.(*Client).Connect
        /root/mumbledj/.vendor/src/github.com/layeh/gumble/gumble/client.go:114 +0x532

!volume causes error

Hi,

Thanks for your good work.

I tried to use the !volume command, but it gave me the following error:

Error: mumbledj.lua:84: attempt to compare number with string

So I changed line 84 in mumbledj.lua to
if tonumber(config.LOWEST_VOLUME) < tonumber(argument) and tonumber(argument) < tonumber(config.HIGHEST_VOLUME) then
to make the comparison errors disappear. The !volume command works now.

Does this issue only happen on my side, or do you get the same error?

I've also got another little question:
Is the !volume command only intended to change the volume for the next (and future) songs or should the volume change affect the played audio immediately?
In case it's the former: Is that a limitation of piepan?
I read your code and it would make sense that the volume is only changed per song since we set the audio each time in the ffmpeg conversion with the -vol option.

Request

I was wandering if you could add in a command to tell the number of songs in the que.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.