简体   繁体   English

语音识别模块提供字典和列表。 任何解决方案?

[英]Speech Recognition module is giving a dictionary as well as a list. Any solutions?

It seems you make use of the package SpeechRecognition .您似乎使用了 package SpeechRecognition

On line 54 of main.py you call r.recognize_google() .main.py的第 54 行,您调用r.recognize_google() Looking at the source code of this method, on line 917 and 918 it shows that the authors of the package print the results when the method is called.查看此方法的源代码,在第 917 和 918 行显示 package 的作者在调用该方法时打印结果。

Unfortunately there is no easy way to suppress print statements in imported code.不幸的是,没有简单的方法来抑制导入代码中的打印语句。 If it really bothers you, you can modify stdout like they suggest in this thread.如果它真的困扰你,你可以像他们在这个线程中建议的那样修改 stdout 。 Or you can fork the repository and change the source code so results only print when you want to.或者您可以分叉存储库并更改源代码,以便仅在您需要时打印结果。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM