speech-recognition

Trigger local “OK Google” actions programmatically

天涯浪子 提交于 2020-08-23 03:28:30
问题 I'm writing an app that responds to custom voice commands. I want to add the ability to hand some of them off to "OK Google" functionality that handles actions locally (e.g. "launch " or "volume up"). I don't want to hand it off to to the Google Assistant cloud-based APIs, just the local version that handles simple commands that control the device. My app uses the ACTION_RECOGNIZE_SPEECH intent to get the spoken text. The goal is that if it's not a command my app handles, it will trigger

Is there a way to use the Javascript SpeechRecognition API with an audio file?

给你一囗甜甜゛ 提交于 2020-08-17 19:45:26
问题 I want to use the SpeechRecognition api with an audio file (mp3, wave, etc.) Is that possible? 回答1: The short answer is No . 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. This specification was designed