From be13cc3194c25195ba2a89718ac7f821f590332d Mon Sep 17 00:00:00 2001 From: 6vision Date: Thu, 23 May 2024 01:34:20 +0800 Subject: [PATCH] Changed sampling rate --- voice/baidu/baidu_voice.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/voice/baidu/baidu_voice.py b/voice/baidu/baidu_voice.py index 66ba4d8..fbf53ce 100644 --- a/voice/baidu/baidu_voice.py +++ b/voice/baidu/baidu_voice.py @@ -62,7 +62,7 @@ class BaiduVoice(Voice): # 识别本地文件 logger.debug("[Baidu] voice file name={}".format(voice_file)) pcm = get_pcm_from_wav(voice_file) - res = self.client.asr(pcm, "pcm", 8000, {"dev_pid": self.dev_id}) + res = self.client.asr(pcm, "pcm", 16000, {"dev_pid": self.dev_id}) if res["err_no"] == 0: logger.info("百度语音识别到了:{}".format(res["result"])) text = "".join(res["result"])