KoljaB / RealtimeTTS

Converts text to speech in realtime
2.08k stars 210 forks source link

ValueError: ('Sample format not supported', -9994) #221

Open meufff opened 4 days ago

meufff commented 4 days ago

i really dont know how to fix it but it only occurs with OpenAIEngine, with other engines it works fine

error: "Exception in thread Thread-1 (_process_buffer): Traceback (most recent call last): File "C:\Users\Jstyw\AppData\Local\Programs\Python\Python311\Lib\threading.py", line 1038, in _bootstrap_inner self.run() File "C:\Users\Jstyw\AppData\Local\Programs\Python\Python311\Lib\threading.py", line 975, in run self._target(*self._args, **self._kwargs) File "C:\Users\Jstyw\AppData\Local\Programs\Python\Python311\Lib\site-packages\RealtimeTTS\stream_player.py", line 395, in _process_buffer self._play_chunk(chunk) File "C:\Users\Jstyw\AppData\Local\Programs\Python\Python311\Lib\site-packages\RealtimeTTS\stream_player.py", line 322, in _play_chunk sample_width = self.audio_stream.pyaudio_instance.get_sample_size(self.audio_stream.config.format) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Jstyw\AppData\Local\Programs\Python\Python311\Lib\site-packages\pyaudio__init__.py", line 616, in get_sample_size return pa.get_sample_size(format) ^^^^^^^^^^^^^^^^^^^^^^^^^^ ValueError: ('Sample format not supported', -9994)"

KoljaB commented 4 days ago

Oh, thanks for reporting. Probably I messed something up or maybe OpenAI changed something, will look into that.

meufff commented 2 days ago

Now it works! Thank you so much!