SpeakerHandler constructor

SpeakerHandler({
  1. SimpleAudioPlayer playerFactory(
    1. File file
    )?,
  2. void onPlay(
    1. String sentence,
    2. File file
    )?,
  3. String? onSentenceCompleted(
    1. String
    )?,
  4. String? voice,
  5. Duration? maxSentenceDelay,
})

Implementation

SpeakerHandler({
  SimpleAudioPlayer Function(File file)? playerFactory,
  this.onPlay,
  this.onSentenceCompleted,
  String? voice,
  Duration? maxSentenceDelay,
})  : playerFactory = playerFactory ?? DynamicFactories.simplePlayerFactory,
      maxSentenceDelay =
          maxSentenceDelay ?? const Duration(milliseconds: 250),
      voice = voice ?? 'onyx';