JamesBrill / react-speech-recognition

💬Speech recognition for your React app
https://webspeechrecognition.com/
MIT License
657 stars 119 forks source link

Array-based commands #75

Closed JamesBrill closed 3 years ago

JamesBrill commented 3 years ago

Based on https://github.com/JamesBrill/react-speech-recognition/issues/70, this enables an array of "phrases" to be passed into a command, allowing one callback to be triggered by multiple commands. e.g.

    {
      command: ['Hello', 'Hi'],
      callback: () => setMessage('Hi there'),
      matchInterim: true
    }