• Stars
    star
    127
  • Rank 282,790 (Top 6 %)
  • Language
    Ruby
  • License
    MIT License
  • Created over 12 years ago
  • Updated 5 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A headless mumble client API written in Ruby

mumble-ruby

http://www.github.com/mattvperry/mumble-ruby

DESCRIPTION:¶ ↑

Mumble-Ruby is a headless client for the Mumble VOIP application. Mumble-Ruby provides the ability to write scripts and bots which interact with mumble servers through a simple DSL. Mumble-Ruby also has the ability to stream raw audio from a fifo pipe (mpd) to the mumble server. There is huge room for improvement in this library and I am willing to accept all sorts of pull requests so please do.

INSTALL:¶ ↑

[sudo] gem install mumble-ruby

REQUIREMENTS:¶ ↑

  • Ruby >= 2.1.0

  • OPUS Audio Codec

  • Murmur server > 1.2.4 – NOTE: mumble-ruby will not be able to stream audio to servers that don’t support OPUS anymore. I haven’t looked into backwards-compatability with CELT.

RECENT CHANGES:¶ ↑

  • Merged changes for proper user/channel objects

  • Merged changes for recording feature

  • Added half-broken support for playing files (Something is wrong, wouldn’t recommend using it)

  • Bit of refactoring and renaming

  • Added OPUS support

  • Added more configuration options

  • Added image text messages

  • Added ssl cert auth

  • Fixed several bugs

BASIC USAGE:¶ ↑

# Configure all clients globally
Mumble.configure do |conf|
    # sample rate of sound (48 khz recommended)
    conf.sample_rate = 48000

    # bitrate of sound (32 kbit/s recommended)
    conf.bitrate = 32000

    # directory to store user's ssl certs
    conf.ssl_cert_opts[:cert_dir] = File.expand_path("./")
end

# Create client instance for your server
cli = Mumble::Client.new('localhost') do |conf|
    conf.username = 'Mumble Bot'
    conf.password = 'password123'

    # Overwrite global config
    conf.bitrate = 48000
end
# => #<Mumble::Client:0x00000003064fe8 @host="localhost", @port=64738, @username="Mumble Bot", @password="password123", @channels={}, @users={}, @callbacks={}>

# Set up some callbacks for when you recieve text messages
# There are callbacks for every Mumble Protocol Message that a client can recieve
# For a reference on those, see the linked PDF at the bottom of the README.
cli.on_text_message do |msg|
    puts msg.message
end
# => [#<Proc:0x0000000346e5f8@(irb):2>]

# Initiate the connection to the client
cli.connect
# => #<Thread:0x000000033d7388 run>

# Mute and Deafen yourself after connecting
cli.on_connected do
    cli.me.mute
    cli.me.deafen
end

# Join the channel titled "Chillen" (this will return a channel object for that channel)
cli.join_channel('Chillen')

# Get a list of channels
cli.channels
# Returns a hash of channel_id: Channel objects

# Join Channel using ID
cli.join_channel(0)

# Join Channel using Channel object
cli.join_channel(cli.channels[0])
cli.channels[0].join

# Get a list of users
cli.users
# Returns a hash of session_id: UserState Messages

# Text user
cli.text_user('perrym5', "Hello there, I'm a robot!")

# Text an image to a channel
cli.text_channel_img('Chillen', '/path/to/image.jpg')

# Start streaming from a FIFO queue of raw PCM data
cli.player.stream_named_pipe('/tmp/mpd.fifo')

# EXPERIMENTAL: Recording feature
cli.recorder.start('/home/matt/record.wav')
sleep(2)
cli.recorder.stop

# EXPERIMENTAL: Play wav files
cli.player.play_file('/home/matt/record.wav')

# Safely disconnect
cli.disconnect
# => nil

MUMBLE PROTOCOL:¶ ↑

The documentation for Mumble’s control and voice protocol is a good reference for using this client as all of the callbacks are based on the types of messages the Mumble uses to accomplish its tasks. You can see it here.

More Repositories

1

Mumble.NET

C# class library for interacting with Mumble VoIP servers.
C#
8
star
2

ruby-libmpq

ruby-libmpq is a gem for reading and manipulating Blizzard MPQ files.
C
4
star
3

opus-ruby

Ruby FFI module for the OPUS Audio Codec
Ruby
4
star
4

celt-ruby

Ruby FFI module for the CELT Audio Codec
Ruby
4
star
5

youtube-dl-rb

A feature parity ruby port of the popular python command line tool youtube-dl
Ruby
3
star
6

raid-sim

ROSS Model for a RAID File Server Farm
C
3
star
7

sc2parse

Ruby parser for Starcraft 2 replay files.
Ruby
3
star
8

tsbot

Typescript port of GitHub's Hubot.
TypeScript
3
star
9

we_the_people

Class project in which we manipulate results from a Google search in order to promote a cause.
Python
2
star
10

semantic_crime

Class project to combine goverment data sets using semantic web techniques and vizualize the results.
2
star
11

gondola

Ruby command line utility and library for integrating the Selenium IDE more tightly with Sauce Labs' Ondemand services
Ruby
2
star
12

EnterpriseCheckers

Simple Console Checkers game written in the way an Enterprise would.
C#
2
star
13

typed-googl

Type definitions for https://github.com/kaimallea/node-googl
1
star
14

hubot-groupme-webhook

GroupMe adapter for Hubot using the bot API webhook
CoffeeScript
1
star
15

typed-fluent-ffmpeg

Type definitions for https://github.com/fluent-ffmpeg/node-fluent-ffmpeg
1
star
16

stcapital

Playing with DeFi arbitrage bots
TypeScript
1
star
17

hubot-discord-ts

Hubot discord adapter written in Typescript
TypeScript
1
star
18

aoc2021

Advent of Code 2021 solutions in TS
TypeScript
1
star
19

stacks

Portainer stacks
1
star