有没有办法将Javascript SpeechRecognition API与音频文件一起使用? [英] Is there a way to use the Javascript SpeechRecognition API with an audio file?

查看:96
本文介绍了有没有办法将Javascript SpeechRecognition API与音频文件一起使用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想将 SpeechRecognition api 与音频一起使用文件(mp3,波形等) 有可能吗?

I want to use the SpeechRecognition api with an audio file (mp3, wave, etc.) Is that possible?

推荐答案

简短的回答是.

Web语音Api规范不禁止这样做(浏览器可以允许最终用户选择一个文件作为输入),但是音频输入流永远不会提供给调用的javascript代码(在当前的草稿版本中),因此您无法读取或读取任何文件.更改输入到语音识别服务的音频.

The Web Speech Api Specification does not prohibit this (the browser could allow the end-user to choose a file to use as input), but the audio input stream is never provided to the calling javascript code (in the current draft version), so you don't have any way to read or change the audio that is input to the speech recognition service.

设计此规范的目的是使javascript代码只能访问来自语音识别服务的结果文本.

This specification was designed so that the javascript code will only have access to the result text coming from the speech recognition service.

这篇关于有没有办法将Javascript SpeechRecognition API与音频文件一起使用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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