Skip to content

Commit

Permalink
Merge pull request #2013 from 6vision/fix_baidu_voice
Browse files Browse the repository at this point in the history
Changed sampling rate
  • Loading branch information
6vision committed May 22, 2024
2 parents a46320e + be13cc3 commit c8d388f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion voice/baidu/baidu_voice.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def voiceToText(self, voice_file):
# 识别本地文件
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"])
Expand Down

0 comments on commit c8d388f

Please sign in to comment.