No more traceback, still not working though.

This commit is contained in:
stormdragon2976 2023-06-12 00:37:45 -04:00
parent 91954beafc
commit 30df781445

View File

@ -1,6 +1,5 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
import pymumble_py3 import pymumble_py3
from pymumble_py3.callbacks import PYMUMBLE_CLBK_SOUNDRECEIVED as PCS from pymumble_py3.callbacks import PYMUMBLE_CLBK_SOUNDRECEIVED as PCS
import sounddevice as sd import sounddevice as sd
@ -10,10 +9,8 @@ import time
from modules.custom_mumble import CustomMumble from modules.custom_mumble import CustomMumble
from setproctitle import setproctitle from setproctitle import setproctitle
setproctitle("Garmr") setproctitle("Garmr")
# Connection details for Mumble server # Connection details for Mumble server
server = "mumble.example.com" # server address server = "mumble.example.com" # server address
nick = "Garmr_Test" nick = "Garmr_Test"
@ -28,9 +25,6 @@ CHANNELS = 2
mumble = CustomMumble(server, nick, password=passwd, port=port) mumble = CustomMumble(server, nick, password=passwd, port=port)
mumble.set_application_string("garmr") mumble.set_application_string("garmr")
# Set the sample rate and channels for Mumble
mumble.set_receive_sound((SAMPLE_RATE, CHANNELS))
# Create a SoundDevice audio handler # Create a SoundDevice audio handler
audio_handler = sd.OutputStream(samplerate=SAMPLE_RATE, channels=CHANNELS) audio_handler = sd.OutputStream(samplerate=SAMPLE_RATE, channels=CHANNELS)
@ -39,10 +33,9 @@ mumble.set_audio_handler(audio_handler)
# Set up the sound received callback # Set up the sound received callback
mumble.callbacks.set_callback(PCS, mumble.sound_received_handler) mumble.callbacks.set_callback(PCS, mumble.sound_received_handler)
# Start the Mumble client # Start the Mumble client
mumble.start() mumble.start()
mumble.is_ready() # Wait for the client to be ready mumble.is_ready() # Wait for the client to be ready
# Keep the script running until interrupted # Keep the script running until interrupted
@ -52,9 +45,9 @@ try:
except KeyboardInterrupt: except KeyboardInterrupt:
pass pass
finally: finally:
# Stop the Mumble client
mumble.stop()
# Stop and close the SoundDevice stream # Stop and close the SoundDevice stream
audio_handler.stop() audio_handler.stop()
audio_handler.close() audio_handler.close()
# Stop the Mumble client
mumble.stop()