Config

data class Config(val defaultPreset: SpeechPreset = SpeechPreset.NEUTRAL, val preferredVoiceNames: List<String> = FrenchVoiceSelector.DEFAULT_PREFERRED_VOICES, val preprocessText: Boolean = true, val autoChunkLongText: Boolean = true, val audioFocus: BetterFrenchTts.AudioFocusMode = AudioFocusMode.DUCK, val onReady: (BetterFrenchTts) -> Unit? = null, val onInitError: (Int) -> Unit? = null)

Configuration for BetterFrenchTts.

Constructors

Link copied to clipboard
constructor(defaultPreset: SpeechPreset = SpeechPreset.NEUTRAL, preferredVoiceNames: List<String> = FrenchVoiceSelector.DEFAULT_PREFERRED_VOICES, preprocessText: Boolean = true, autoChunkLongText: Boolean = true, audioFocus: BetterFrenchTts.AudioFocusMode = AudioFocusMode.DUCK, onReady: (BetterFrenchTts) -> Unit? = null, onInitError: (Int) -> Unit? = null)

Properties

Link copied to clipboard

Audio focus strategy used while speaking. Defaults to AudioFocusMode.DUCK which lowers other apps' volume during speech.

Link copied to clipboard

When true (default), text whose SSML exceeds ~4 000 characters is automatically split at natural boundaries before dispatching.

Link copied to clipboard

Preset applied to every speak call when none is specified.

Link copied to clipboard
val onInitError: (Int) -> Unit?

Called on the main thread if TTS initialization fails. Receives the error status code from android.speech.tts.TextToSpeech.OnInitListener.

Link copied to clipboard

Called on the main thread once the TTS engine is initialized. Receives the fully ready BetterFrenchTts instance.

Link copied to clipboard

Ordered list of preferred offline voice names. Voices are matched case-insensitively among the highest-quality candidates.

Link copied to clipboard

When true (default), French text is normalized before synthesis: abbreviations are expanded, ordinals spelled out, time/units/currency converted to words, etc.