EnsembleUI / ensemble

Build native apps 20x faster than Flutter, RN or any other tech
https://ensembleui.com/
BSD 3-Clause "New" or "Revised" License
117 stars 15 forks source link

User should be able to use voice instead of typing text #675

Open kmahmood74 opened 1 year ago

kmahmood74 commented 1 year ago

Use case -

  1. Search using voice
  2. Prompt using voice
  3. enter text in a text area using voice

this could be a good candidate - https://pub.dev/packages/speech_to_text I have not tested this myself so please test it first.

Suggestion:

on TextField (single and multiline), it should be a configuration property such as allowVoiceInput with default = false Otherwise it should be an action - listen with two callbacks:

unavailable: called if the user denies speech recognition onComplete: speech is complete. With event.recognizedWords

Needed by multiple customers

cc @vusters

hemish11 commented 10 months ago

@kmahmood74 I would suggest creating an action so that it's easier to access throughout the app and not limited to text field.

kmahmood74 commented 10 months ago

@kmahmood74 I would suggest creating an action so that it's easier to access throughout the app and not limited to text field.

I agree, good point. Let's do an action. Actions are incredibly powerful and useful

kmahmood74 commented 10 months ago

proposed EDL -

Button:
    onTap:
        startListening: #initializes the speechToText if needed
            id: #optional. needed to reference it
            onStatus:  #optional, invoke any action. status is accessed as this.status or use id instead of this 
            onError: #invoke any action. if not specified, we should have a default one to show the error as toast
            onResult: #could be any action. 
            isListening: #boolean

#recognized works from speechToText are always available as lastWords and you should be able to bind to that. Recognized words from the last run are available as this.result or <id>.result. The result object has the following properties - recognizedWords, confidence, hasConfidenceRating

@vusters ?