SpeechSettings

@Immutable
data class SpeechSettings(val recognizer: ComponentName? = null, val onDeviceRecognition: Boolean = false, val ttsEngine: String? = null, val voice: String? = null, val rate: Float = 1.0f, val pitch: Float = 1.0f)(source)

Which of the device's speech engines the voice elements use, and how they speak. Every field defaults to the system's choice, so an app only sets what its user picked (e.g. from recognitionServices and SpeechOutputState.engines in a settings screen).

Constructors

Link copied to clipboard
constructor(recognizer: ComponentName? = null, onDeviceRecognition: Boolean = false, ttsEngine: String? = null, voice: String? = null, rate: Float = 1.0f, pitch: Float = 1.0f)

Properties

Link copied to clipboard

recognise on the device, without sending audio anywhere, where the platform offers it (Android 12+, SpeechRecognizer.isOnDeviceRecognitionAvailable).

Link copied to clipboard

speech pitch, 1 = normal.

Link copied to clipboard
val rate: Float

speech rate, 1 = normal.

Link copied to clipboard
val recognizer: ComponentName?

a speech recognition service (android.speech.RecognitionService), e.g. the vendor's or Google's; null uses the system default.

Link copied to clipboard

a text-to-speech engine's package (TextToSpeech.EngineInfo.name); null uses the system default.

Link copied to clipboard

a voice of that engine (android.speech.tts.Voice.getName); null picks the engine's default for the language.