0
import simpleaudio as sa

wave_obj = sa.WaveObject.from_wave_file('path to wav file/test.wav')
play_obj = wave_obj.play()
play_obj.wait_done()  # Wait until sound has finished playing

在我安装了一些软件包(firebase、Crypto、python_jwt、cryptodome、pycrypto)之前,代码一直在工作。现在它产生:

SimpleaudioError                          Traceback (most recent call last)
<ipython-input-8-15372821820f> in <module>
      2 
      3 wave_obj = sa.WaveObject.from_wave_file('/Users/mohamed/Files/IBM Watson TTS/Segments/output.wav')
----> 4 play_obj = wave_obj.play()
      5 play_obj.wait_done()  # Wait until sound has finished playing

/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/simpleaudio/shiny.py in play(self)
     18     def play(self):
     19         return play_buffer(self.audio_data, self.num_channels,
---> 20                            self.bytes_per_sample, self.sample_rate)
     21 
     22     @classmethod

/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/simpleaudio/shiny.py in play_buffer(audio_data, num_channels, bytes_per_sample, sample_rate)
     59 def play_buffer(audio_data, num_channels, bytes_per_sample, sample_rate):
     60     play_id = _sa._play_buffer(audio_data, num_channels, bytes_per_sample,
---> 61                                sample_rate)
     62     return PlayObject(play_id)

SimpleaudioError: Unable to start queue. -- CODE: -66681
4

1 回答 1

0

重新启动计算机修复它。

于 2021-07-06T05:48:08.233 回答