Is there a way to use a grammar with the HTML 5 speech input API?

前端 未结 2 1910
一生所求
一生所求 2020-11-30 10:42

I\'m working with the HTML 5 speech input API and I want to let the server know which answers it can expect to be returned from the speech input. Is there a way to set a lis

2条回答
  •  眼角桃花
    2020-11-30 11:18

    In Google Chrome you can not use grammars yet, overall they decided to use free-form recognition only. Relevant question is Grammar in Google speech API.

    Grammars are supported in Firefox Web Speech API, but the feature is experimental.

    If your browser supports HTML5 audio, you might want to try to recognize words from your grammar using Pocketsphinx.js library, it provides javascript-based recognizer which should be very good for grammars.

提交回复
热议问题