vad检测没人说话超过2秒就自动停止录制并保存前面有人说话的音频文件
pip install webrtcvad
代码:
import pyaudio
import wave
import time
import webrtcvadCHUNK = 320 # 20ms 的语音帧
FORMAT = pyaudio.paInt16
CHANNELS = 1
RATE = 16000
WAVE_OUTPUT_FILENAME
vad检测没人说话超过2秒就自动停止录制并保存前面有人说话的音频文件
pip install webrtcvad
代码:
import pyaudio
import wave
import time
import webrtcvadCHUNK = 320 # 20ms 的语音帧
FORMAT = pyaudio.paInt16
CHANNELS = 1
RATE = 16000
WAVE_OUTPUT_FILENAME