【二营长爬坑】音频流、文件路径、IO到ASR识别 #1965
SuperKsa
started this conversation in
Show and tell
Replies: 1 comment 6 replies
-
请问ASREngine哪来的? |
Beta Was this translation helpful? Give feedback.
6 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
如果我们在python中以音频流的方式传入ASR进行识别,根据官方文档只能用socket的方式(客户端送数据到服务端),而这种方式略感繁琐,因为中间多了一层网络通讯。
那我们要是直接在ASR服务端完成识别就需要用到下面的实现方式:
大家可以参考代码根据自身场景自行调整
以下是用法:
class文件
考虑到场景多样性,所以下面这段代码改成可以支持 传入音频流、文件路径、内存IO文件
注意:代码中有个读取音频流的外部函数:
filesystem_get_contents
PHP写多了,就这个名字好用
此坑感谢飞桨团队(张北北)指点
Beta Was this translation helpful? Give feedback.
All reactions