【发布时间】:2020-05-15 00:03:04
【问题描述】:
我正在尝试让我的音频界面连续循环播放相同的音频。有人推荐使用 sounddevice 库中的“OutputStream”函数。这是我为此编写的代码:
sounddevice.default.device = "Focusrite USB ASIO, ASIO"
sounddevice.default.samplerate = 48000
stream = sounddevice.OutputStream()
stream.start()
stream.write(data)
最后一行代码给了我错误:
sounddevice.PortAudioError: 等待超时 [PaErrorCode -9987]
我做错了什么?
【问题讨论】:
-
sounddevice.play(data, blocking=True)工作吗?
标签: python audio python-sounddevice