音频流 Python 上的 Google 流语音识别 [英] Google Streaming Speech Recognition on an Audio Stream Python

查看:24
本文介绍了音频流 Python 上的 Google 流语音识别的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经搜索了 Google 的所有可用文档,但找不到在 Python 中的音频流上进行流式语音识别的示例.

I have searched through all the available docs of Google but I could not find an example of streaming speech recognition on an audio stream in Python.

目前,我在 Django 中使用 Python 语音识别来获取用户的音频,然后收听音频.然后我可以保存文件并运行谷歌语音识别或直接从创建的音频实例中运行.

Currently, I am using Speech Recognition for Python in Django to get the audio from the user and then listen to the audio. I can then save the file and run the google speech recognition or directly from the instance of the audio created.

有人可以指导我如何对音频流进行流式语音识别吗?

Can somebody guide me how to perform streaming speech recognition on an audio stream ?

推荐答案

Google 提供了流式 Python API 的示例 此处.

Google provides an example of the streaming Python API here.

不是打开音频文件来创建流(如该示例的第 34 行),而是将流直接传递给音频样本对象(如第 36 行).

Rather than opening an audio file to create the stream (as on line 34 of that example), pass the stream directly to the audio sample object (as on line 36).

这篇关于音频流 Python 上的 Google 流语音识别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆