Python语音识别API响应很慢

标签 python speech-recognition ubuntu-18.04

我正在尝试开发一个法语学习应用程序,为此我使用 Python 语音识别 API 来检测一个人所说的内容,然后向他提供有关他所说内容以及他需要改进多少的反馈。但是API的响应非常非常慢。可能是什么原因。

在堆栈溢出的答案之一中,我发现要检查我的应用程序的输入源。我尝试使用内置麦克风和耳机麦克风,但没有任何效果。与此同时,我还使用 CMUSphinx 语音 API,它可以快速检测声音并做出响应,但准确性很差,因此我假设应用程序正在从麦克风接收声音。

with sr.Microphone() as source:
    r.adjust_for_ambient_noise(source)
    print("Testing Online ASR module. Backend Google Web Speech API..\n")
    while(1):
        print("Speak Now..\n")
        audio = r.listen(source)
        try:
            text = r.recognize_google(audio, language='fr-FR')
            response = json.dumps(text, ensure_ascii=False).encode('utf8')
            print("You Said: " + str(response))
        except Exception as e:
            print(" ")

最佳答案

What could be the reason.

它首先将数据发送到计划的另一侧,由 NSA 存储和分析数据,只有当 NSA 批准时您才能得到结果

i am also using CMUSphinx speech API which detect the sound and responses quickly but the accuracy is very poor

正确的方法是尝试基于神经网络的东西,比如 Kaldi

关于Python语音识别API响应很慢,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57290242/

相关文章:

python - music21:按音符位置将音符写入 MIDI 文件

javascript - 通过 javascript 使用输入 'speech' 标签

java - 如何解决 "Inconsistency detected: dl-lookup.c: 111"(Java 结果 127)错误?

c++ - 如何编译静态 OpenCV4 库?

Python 改变整个列表的类型?

python - Anaconda:安装 Python 模块

python - 为什么在转换为 exe 后出现 pyttsx3 错误?

node.js - 为什么无法在 Ubuntu 18.04.1 上安装 npm 软件包?

python - 将数组元素输入递归函数时出错

android studio 3模拟器,如何为语音识别启用麦克风输入