SpeechListenOptions constructor

SpeechListenOptions({
  1. dynamic cancelOnError = false,
  2. dynamic partialResults = true,
  3. dynamic onDevice = false,
  4. ListenMode listenMode = ListenMode.confirmation,
  5. dynamic sampleRate = 0,
  6. dynamic autoPunctuation = false,
  7. dynamic enableHapticFeedback = false,
  8. Duration? pauseFor = null,
  9. Duration? listenFor = null,
  10. String? localeId = null,
  11. List<String>? contextualPhrases,
})

Implementation

SpeechListenOptions({
  /// If true the listen session will automatically be canceled on a permanent error.
  this.cancelOnError = false,

  /// If true the listen session will report partial results as they
  /// are recognized. When false only the final results will be reported.
  this.partialResults = true,

  /// If true the listen session will only use on device recognition. If
  /// it cannot do this the listen attempt will fail. This is usually only
  /// needed for sensitive content where privacy or security is a concern.
  /// If false the listen session will use both on device and network
  /// recognition.
  this.onDevice = false,

  /// The listen mode to use, currently only supported on iOS.
  this.listenMode = ListenMode.confirmation,

  /// The sample rate to use, currently only needed on iOS for some use
  /// cases. Occasionally some devices crash with `sampleRate != device's
  /// supported sampleRate`, try 44100 if seeing crashes.
  this.sampleRate = 0,

  /// If true the listen session will automatically add punctuation to
  /// the recognized text. This is only supported on iOS.
  this.autoPunctuation = false,

  /// If true haptic feedback will be enabled during the listen session.
  /// Usually haptics are suppressed during speech recognition to avoid
  /// interference with the microphone. Currently only supported on iOS.
  this.enableHapticFeedback = false,

  /// The length of time to pause before the speech input is considered
  /// complete. This is used to determine when to stop listening for speech
  /// input.
  this.pauseFor = null,

  /// The length of time to listen for speech input before stopping.
  /// This is used to limit the duration of the listen session. If null,
  /// the listen session will continue until the user stops it or a timeout
  /// occurs.
  this.listenFor = null,

  /// The locale to use for the listen session, if null the system default
  /// locale will be used. This is only supported on iOS and Android.
  this.localeId = null,

  /// Phrases to bias recognition toward — domain-specific vocabulary,
  /// proper nouns, or technical terms that the system might otherwise
  /// mis-transcribe. On iOS this maps to
  /// `SFSpeechRecognitionRequest.contextualStrings`. On Android this
  /// maps to `RecognizerIntent.EXTRA_BIASING_STRINGS` and requires
  /// API 33 (Android 13) or later — earlier versions silently ignore
  /// the hint. Web and other platforms also ignore the hint.
  this.contextualPhrases,
});