1
0
mirror of https://github.com/azlux/pymumble synced 2024-11-23 13:56:26 +00:00
pymumble/examples/echobot.py
Farooq Karimi Zadeh 3e4ea55ba2 Added two example bots and removed the useless part of GPL (#32)
* Removing useless parts of the license
* Added two new examples: echobot and talking bot
* Fixed a mistake
* a little cleaning + comments
* Lartza's PEP8
2019-04-09 17:20:27 +02:00

26 lines
661 B
Python
Executable File

#!/usr/bin/python3
# This bot sends any sound it receives back to where it has come from.
# WARNING! Don't put two bots in the same place!
import pymumble_py3
import time
from pymumble_py3.callbacks import PYMUMBLE_CLBK_SOUNDRECEIVED as PCS
pwd = "" # password
server = "localhost"
nick = "Bob"
def sound_received_handler(user, soundchunk):
# sending the received sound back to server
mumble.sound_output.add_sound(soundchunk.pcm)
mumble = pymumble_py3.Mumble(server, nick, password=pwd)
mumble.callbacks.set_callback(PCS, sound_received_handler)
mumble.set_receive_sound(1) # we want to receive sound
mumble.start()
while 1:
time.sleep(1)