mirror of
https://github.com/zhayujie/chatgpt-on-wechat.git
synced 2026-07-20 13:47:15 +08:00
Changed sampling rate
This commit is contained in:
@@ -62,7 +62,7 @@ class BaiduVoice(Voice):
|
|||||||
# 识别本地文件
|
# 识别本地文件
|
||||||
logger.debug("[Baidu] voice file name={}".format(voice_file))
|
logger.debug("[Baidu] voice file name={}".format(voice_file))
|
||||||
pcm = get_pcm_from_wav(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:
|
if res["err_no"] == 0:
|
||||||
logger.info("百度语音识别到了:{}".format(res["result"]))
|
logger.info("百度语音识别到了:{}".format(res["result"]))
|
||||||
text = "".join(res["result"])
|
text = "".join(res["result"])
|
||||||
|
|||||||
Reference in New Issue
Block a user