我尝试使用下面显示的python代码试用口袋狮身人面像和谷歌stt引擎:
import speech_recognition as sr
r = sr.Recognizer()
with sr.Microphone() as source:
audio = r.adjust_for_ambient_noise(source)
print('\n\n')
print("Say something!")
audio = r.listen(source,timeout=5)
t=r.recognize_google(audio)
s=r.recognize_sphinx(audio)
print('\n\n')
print('Google thinks that you said:',t)
print('Sphinx thinks that you said:',s)
代码的输入短语是:"测试音频2录音"
Say something!
Google thinks that you said: text audio two recording
Sphinx thinks that you said: this would you move it going to the fed
然而,通过口袋狮身人面像识别的语音非常差,甚至与我说的话都不相似......但谷歌的STt认为它很完美..无论如何都有提高口袋狮身人面像的语音检测质量。我不希望口袋狮身人面像非常完美,但所识别的单词听起来甚至听起来与我说的相似......
那么有没有办法改善口袋狮身人面像的质量........我刚为python3安装了Pocketsphinx和SpeechRecognition模块。