NOTE: pymumble is currently being reworked from a stateful application object to a library that can be used both as a traditional client and as an independent collection of mostly stateless functionality. The documentation is kept more or less up to date, but until 2.0.0 is released, nothing is stable.
opus is required to send and receive audio.
pip install pymumblegit clone https://codeberg.org/pymumble/pymumble.git
cd pymumble
python -m venv venv
. ./venv/bin/activate
python -m pip install -e . --group dev# /// script
# dependencies = [
# "pymumble>=2",
# ]
# ///
from mumble import Mumble
from subprocess import PIPE, Popen
with Mumble("127.0.0.1", "A Weedy Samaritan", debug=False) as m:
usernames = ", ".join(u["name"] for u in m.my_channel().get_users())
m.my_channel().send_text_message(
f"Hello, {usernames}. You're all Brian! You're all individuals!"
)
sound = Popen("ffmpeg -i audio.opus -ar 48000 -b:a 64k -f s16le -".split(), stdout=PIPE).stdout.read()
m.send_audio.add_sound(sound).wait()The following enhancements are included in pymumble 2.0.0:
- Implement encrypted UDP audio & pings with AES-OCB2, compatible with the latest Mumble server.
- Implement unencrypted UDP pings to retrieve extended server info before connecting.
- Support the latest protocol version: 1.5.735.
- Use
blackfor formatting. - Send functional version string compatible with the latest Mumble server.
- Support Python
withstatements.
In order to bring pymumble up to date with modern python development practices, the following breaking changes have been introduced in version 2.0.0:
- Rename the import path from
pymumble_py3to simplymumble. - Drop support for legacy audio codecs.
- Remove
Mumble.set_receive_sound(), audio support is now enabled by default.- To disable audio support and avoid importing
opuslib, instantiate theMumbleobject withMumble(enable_audio=False). - To disable audio support after the object has been created set
m = Mumble(); m.enable_audio = False. This will still importopuslib.
- To disable audio support and avoid importing
- Remove the
Mumbleclass getter/setter functionsset_application_string(),set_loop_rate(), andget_loop_rate(). These parameters can be set in theMumbleobject initializer and queried and changed by accessing the object'sapplicationandloop_ratepublic attributes. - Replace callback constants with a class interface. e.g.,
Mumble.callbacks.set_callback(PYMUMBLE_CLBK_SOUNDRECEIVED, ...)is nowMumble.callbacks.sound_received.set_handler(...). - Rename all constants to drop the
PYMUMBLE_prefix, some also renamed for clarity. - Rename
SoundOutputtoSendAudioandSoundQueuetoReceivedAudioQueue.
Because pymumble now follows the Semantic Versioning 2.0.0 versioning scheme, any further breaking changes must increment the MAJOR version number. The dependency
pymumble>=2,<3
will resolve to the latest version with a stable API.
We strive to keep pymumble up to date with the latest version of the mumble protocol and compatible with the mumble server. Pymumble should be bit-compatible with the official mumble client at the application/messaging layer. (The python & C++ protobuf implementations may vary in how they serialise the data over the wire, which is acceptable per the protocol buffer specification.)
Future releases will focus on:
- improving the API
- improving performance
- improving test coverage
- improving documentation
- rounding out protocol support
- Follow conventional commit guidelines for writing commit messages.
- Document code in the Sphinx docstring format.
- Include integration tests for updated or new functionality.
- Format code with
blackbefore committing.
- Abot
- Botamusique
- MumbleRadioPlayer (archived)
- MumbleRecbot (deprecated)
- @azlux for maintaining the
pymumblelibrary before version 2 - Jan Petykiewicz for the AES-OCB2 implementation
- Ranomier for the python3 port
- @raylu for making
pymumblespeak into channels - @schlarpc for fixes on buffer
- @Robert904 for the inital pymumble implementation
- All contributors to the previous versions.