pymumble
pymumble copied to clipboard
Issue on macOS with Python 3.11
File "/Users/XXXXX-G8Eyb2Im/lib/python3.11/site-packages/opuslib/api/ctl.py", line 66, in inner
raise opuslib.exceptions.OpusError(result_code)
opuslib.exceptions.OpusError: b'invalid argument'
The line that is triggering the error in libopus and hence the exception: soundoutput.py:151
self.encoder.bitrate = self.bandwidth - overhead_per_second
I'm not sure if there is a problem in pymumble or libopus, but the same code with the same Python version on Debian appears to work without issue. I'm a bit stumped.
Kind of out of curiosity, I downgraded my pipenv to 3.9, and now it's working. Still don't understand what the issue is, but at least I can continue working on my code.
The relevant code to trigger the error is very straigtforward:
mumble = pymumble_py3.Mumble(**server_args)
mumble.start()
mumble.is_ready()
Curioser and curioser. After switching to Python 3.9, I didn't get the crash on connecting, but I also didn't get any audio; mumble.sound_output was None. Setting mumble.set_receive_sound(True) before connecting fixed that, but it also brings back the first error.
The debug log output just before the error is
2023-12-15 23:57:29,465-PyMumble-DEBUG-Bandwidth is 50000, downgrading to 30400 due to the protocol overhead
I'm not sure the bandwidth can be chosen arbitrarily, but I don't claim to understand how Opus works.
Simply commenting out the line leads to working code?