You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I downloaded the audio only client and had to change some of the imports to get it to work as well as separate the audio listeners to get it to work. Here is the updated script if anyone wants it. I'm on linux by the way... This might fix the issues with the RPi 3B+?
# A python script to do both listening and talking. This is the basic model# for an audio-only mumble client.# Usage:# Install pyaudio (instructions: https://people.csail.mit.edu/hubert/pyaudio/#downloads)# If `fatal error: 'portaudio.h' file not found` is encountered while installing# pyaudio even after following the instruction, this solution might be of help:# https://stackoverflow.com/questions/33513522/when-installing-pyaudio-pip-cannot-find-portaudio-h-in-usr-local-include## Install dependencies for pymumble.## Set up a mumber server. For testing purpose, you can use https://guildbit.com/# to spin up a free server. Hard code the server details in this file.## run `python3 ./listen_n_talk.py`. Now an audio-only mumble client is connected# to the server.## To test its functionality, in a separate device, use some official mumble# client (https://www.mumble.com/mumble-download.php) to verbally communicate# with this audio-only client.## Works on MacOS. Does NOT work on RPi 3B+ (I cannot figure out why. Help will# be much appreciated)importpymumble_py3aspymumble_py3frompymumble_py3.callbacksimportPYMUMBLE_CLBK_SOUNDRECEIVEDasPCSimportpyaudio# Connection details for mumble server. Hardcoded for now, will have to be# command line arguments eventuallypwd=""# passwordserver="127.0.0.1"# server addressnick="audio-only_client"port=64738# port number# pyaudio set upCHUNK=1024FORMAT=pyaudio.paInt16# pymumble soundchunk.pcm is 16 bitsCHANNELS=1RATE=48000# pymumble soundchunk.pcm is 48000Hzp=pyaudio.PyAudio()
stream_listen=p.open(format=FORMAT,
channels=CHANNELS,
rate=RATE,
#input=True, # enable both talkoutput=True, # and listenframes_per_buffer=CHUNK)
stream_talk=p.open(format=FORMAT,
channels=CHANNELS,
rate=RATE,
input=True, # enable both talk#output=True, # and listenframes_per_buffer=CHUNK)
# mumble client set updefsound_received_handler(user, soundchunk):
""" play sound received from mumble server upon its arrival """stream_listen.write(soundchunk.pcm)
# Spin up a client and connect to mumble servermumble=pymumble_py3.Mumble(server, nick, password=pwd, port=port)
# set up callback called when PCS event occursmumble.callbacks.set_callback(PCS, sound_received_handler)
mumble.set_receive_sound(1) # Enable receiving sound from mumble servermumble.start()
mumble.is_ready() # Wait for client is ready# constant capturing sound and sending it to mumble serverwhileTrue:
data=stream_talk.read(CHUNK)
mumble.sound_output.add_sound(data)
# close the stream and pyaudio instancestream_talk.stop_stream()
stream_talk.close()
stream_listen.stop_stream()
stream_listen.close()
p.terminate()
The text was updated successfully, but these errors were encountered:
Yeah feel free... I posted it for you to update the script... Also I haven't tested it since my first post so you might want to test it again before adding it just to be sure that it works with the latest patches.
I downloaded the audio only client and had to change some of the imports to get it to work as well as separate the audio listeners to get it to work. Here is the updated script if anyone wants it. I'm on linux by the way... This might fix the issues with the RPi 3B+?
The text was updated successfully, but these errors were encountered: