TalAter / annyang

:speech_balloon: Speech recognition for your site
https://www.talater.com/annyang/
MIT License
6.57k stars 1.05k forks source link

Change Google api for own api #413

Closed msanzn closed 4 years ago

msanzn commented 4 years ago

Expected Behavior

I am trying to implement this library with my own speech recognition api, which works by API rest and JSON objects, with POST services.

Current Behavior

I can not found the post address in the code to change it to my Speech recognition api, and neither the json structure of the response message.

Possible Solution

In the case of being the comunication with the Google api the same changing the addres, and if necesarry to JSON format.

Steps to Reproduce (for bugs)

1.

Context

I am trying to perform the speech recognition with my own api but with annyang as a way to detect the commands.

Your Environment

TalAter commented 4 years ago

annyang does not connect directly to any API's HTTP endpoint, which is why you couldn't find that. It uses the browser's internal speech recognition implementation (in the case of Chrome for example, that Speech Recognition engine uses Google's API... meaning that endpoint url would be buried inside Chrome's internals and inaccessible to you to modify).

You could either do a rewrite of annyang to make it support an external API, or just overwrite the browser's speech recognition object at runtime and replace it with one that calls your API. I am actually doing this with corti, a library which replaces the speech recognition object so that you can do automated testing of speech recognition.