def open(self):
"""Open a PyAudio instance. This needs to be called before play(),
play_rec() or rec() is called. This can be done in two ways:
snd = PA()
snd.open()
try:
snd.play(x)
finally:
snd.close()
or use the 'with' statement:
with PA() as snd:
snd.play(x)
"""
self._logger.debug("creating pyaudio instance")
self.pa = pyaudio.PyAudio()
评论列表
文章目录