【发布时间】:2019-05-12 01:13:01
【问题描述】:
我制作了一个程序,可以让我说话并将其转换为文本。在我停止说话后,它会转换我的声音。我想做的就是在我说话的时候把我的声音转换成文字。
https://www.youtube.com/watch?v=96AO6L9qp2U&t=2s&ab_channel=StormHack 至少 2:31。
注意托尼显示器的右上角。它在说话时将他的声音转换为文本。我想做同样的事情。能做到吗?
这是我的整个程序:
import speech_recognition as sr
import pyaudio
r = sr.Recognizer()
with sr.Microphone() as source:
print("Listening...")
audio = r.listen(source)
try:
text = r.recognize_google(audio)
print("You said : {}".format(text))
except:
print("Sorry could not recognize what you said")
解决方案、提示、提示或任何内容将不胜感激,在此先感谢您。
【问题讨论】:
-
我假设您已经浏览过这里的文档:github.com/Uberi/speech_recognition
标签: python python-3.x text-to-speech voice-recognition voice-recording