show_all = False 在 speech_recognition 中不起作用

问题描述 投票:0回答:0

我正在使用以下代码使用 this package 转录音频文件,一年前没有问题。虽然它产生了所需的输出,但它会继续打印整个过程(转录的所有迭代及其准确性),即使我已明确设置 show_all = False。我得到的输出是正常的,我只是想阻止它在运行时打印整个过程。还有其他人有这个问题/找到解决方法吗?

import speech_recognition as sr

r = sr.Recognizer()

with sr.AudioFile(filename) as source:
    audio_data = r.record(source)
    text = r.recognize_google(audio_data,language='ru-RU', show_all=False)
    
python speech-recognition speech-to-text google-speech-api
© www.soinside.com 2019 - 2024. All rights reserved.