Voice Input

A voice input component.

Example:

<VoiceInput
    langage="en-US"
    defaultValue="Enter text"
/>

Open interactive preview

Options:

  • autorecord | boolean: controls whether to automatically start recording. Default: false.
  • defaultValue | string: default text value. Default: ''.
  • grammars | array: speech grammar list (unsupported). Default: [].
  • language | string: language identifier. Default: 'en-US'.
  • legend | string: legend displayed in front of input field. Default: ''.
  • mode | string: set to full to display a text input field alongside the microphone, status to only display a statusbar with the transcribed texts, microphone to show just a button to toggle recording, or none when the voice input should be invisible and purely controlled via hotkeys / voice commands. Default: 'full'.
  • onChange | function: callback function invoked when text input value is updated. Default: onChange() {}.
  • onClick | function: callback function invoked when clicking on the microphone button. Default: onClick() {}.
  • onFinalText | function: callback function invoked once final text is received. Default: onFinalText() {}.
  • onRecordingStart | function: callback function invoked when recording is started. Default: onRecordingStart() {}.
  • onRecordingStop | function: callback function invoked once recording is stopped. Default: onRecordingStop() {}.
  • onSegment | function: callback function invoked with text segments. Default: onSegment() {}.
  • onSubmit | function: callback function when submitting text input value by hitting "Enter". Default: onSubmit() {}.
  • placeholder | string: text input placeholder. Default: 'Enter text'.
  • remote | object: object with start, stop, and toggle and associated hotkeys. Default: none.
  • style | object: CSS inline styles. Default: {}.
  • timeout | number: number of milliseconds after which to timeout the recording. Default: none.
  • stopTooltip | string: tooltip message desplayed while recording. Default: 'Click to stop recording'.
  • startTooltip | string: tooltip message desplayed while not recording. Default: 'Click to start recording'.
  • width | number: voice input width (in px). Default: 500.
  • height | number: voice input height (in px). Default: 36.

results matching ""

    No results matching ""