csdcorp / speech_to_text

A Flutter plugin that exposes device specific text to speech recognition capability.
BSD 3-Clause "New" or "Revised" License
348 stars 217 forks source link

[new feature]Support for Command-Based Speech Input #496

Open eecopilot opened 1 month ago

eecopilot commented 1 month ago

Description: Currently, the speech-to-text plugin supports continuous speech input, transcribing everything the user says into text. However, it would be beneficial to have an additional mode that recognizes and returns only the most recent command spoken by the user, rather than transcribing the entire speech input.

This command-based speech input mode would be useful in scenarios where the user needs to issue voice commands to control an application or perform specific actions. Instead of returning a continuous stream of transcribed text, the plugin would intelligently detect and extract the most recent command uttered by the user, making it easier to integrate with command-based interfaces or voice-controlled applications.

Proposed Implementation:

  1. Add a configuration option or a separate mode to enable command-based speech input.
  2. Implement a command detection algorithm that can identify and extract the most recent command from the user's speech input.
  3. Provide a way to define or train the plugin to recognize specific commands or command patterns.
  4. Return only the most recent command detected, instead of the entire transcribed text.

Benefits:

Please consider implementing this feature as it would greatly improve the usability and versatility of the speech-to-text plugin.

eecopilot commented 1 month ago

User can define several commands, and when the commands are heard, perform your own business logic in the callback.

sowens-csd commented 1 month ago

I've considered doing this as either a separate plugin or some new classes that work with Speech to text. It's a good idea as it fits in well with the intended goal of the plugin. I haven't had time to cleanup the classes that I use to do this for inclusion but I'll increase the priority of that if people would be interested. Please upvote this feature if anyone else is interested.

Thanks for the input!