Python语音识别逐字逐句?连续输出?

Python语音识别逐字逐句?连续输出?,python,speech-recognition,speech-to-text,Python,Speech Recognition,Speech To Text,我想知道是否有办法尽快输出单词。例如,如果我说“hello world”,它应该输出: hello world 目前我正在使用这个代码 import speech_recognition as sr r = sr.Recognizer() with sr.Microphone() as source: while True: r.pause_threshold=0.1 ##i tried playing with these 3 but no luck

我想知道是否有办法尽快输出单词。例如,如果我说“hello world”,它应该输出:

hello 
world 
目前我正在使用这个代码

import speech_recognition as sr

r = sr.Recognizer()

with sr.Microphone() as source:
    while True:
        r.pause_threshold=0.1 ##i tried playing with these 3 but no luck
        r.phrase_threshold=0.5
        r.non_speaking_duration=0.1
        audio = r.listen(source)
        try:
            text = r.recognize_google(audio)
            print(text)
        except Exception as e:
            print("-")

这样做的目的是,它会一直记录到麦克风听不到任何声音,然后将它听到的所有声音都输出到一行中,我想尽快查看所说的内容。

您正在使用的库的文档中不会找到此类信息吗?另外,不要使用
,例外情况除外:
类似的用法,请参见。