python - 在 webrtcvac 上处理帧时出错
问题描述
我正在尝试在此函数中使用 webrtcvac.vac 检查帧是否包含语音,但出现此错误。我知道帧变量返回一个实际字节,所以我知道这部分有效,但我仍然得到错误。我对音频操作非常陌生,所以我的错误可能是由于我不明白的东西。
def check_audio(self, framex):
sample_rate = 16000
frame_duration = 10
frame = int(framex * sample_rate * frame_duration / 1000).to_bytes(2, "big")
print(frame)
return self.vad.is_speech(frame, sample_rate)
if (detector.check_audio(frame) is True):
File "C:\Users\bruhm\source\repos\speechrecognition\speechrecognition\voice_detector.py", line 17, in check_audio
return self.vad.is_speech(frame, sample_rate)
File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python37_64\lib\site-packages\webrtcvad.py", line 27, in is_speech
return _webrtcvad.process(self._vad, sample_rate, buf, length)
webrtcvad.Error: Error while processing frame
The thread 'MainThread' (0x1) has exited with code 0 (0x0).
The program 'python.exe' has exited with code 0 (0x0).
这可能是一个非常明显的错误,或者是我需要完全改变它的错误,但不幸的是,这似乎已经超出了我的掌握,因为我在理解文档/堆栈溢出内容中的任何内容时遇到了很多麻烦
谢谢
解决方案
推荐阅读
- javascript - 将参数传递给Vue.js中多选的@select - vue-multiselect
- sql - SQL:计算每个国家的红黄牌数量
- bash - 使用 su 运行时,脚本不会使用正确的环境变量运行
- outlook-web-addins - Exchange Server 版本不支持此应用所需的 API 版本
- vb.net - Visual Basic 健康费用
- node.js - 无法在 NVM 中设置默认节点版本
- python-2.7 - Python 2.7,要解压的值太多
- google-cloud-data-fusion - Google Cloud Data Fusion 1. 未连接到 oracle 2. 当管道运行时,我收到“默认”网络端口错误
- c# - 如何删除与隐藏交集表的多对多关联中的记录?
- excel - 根据包含公式的单元格有条件地格式化单元格