rememberSpeechToTextButtonState
fun rememberSpeechToTextButtonState(onPartialResult: (String) -> Unit? = null, onFinalResult: (String) -> Unit): SpeechToTextButtonState
Creates and remembers a SpeechToTextButtonState instance.
The state is remembered across recompositions and can be used to track the recording status of a SpeechToTextButton.
Return
A remembered instance of SpeechToTextButtonState
Parameters
onPartialResult
Callback invoked when text chunks are recognized. Called with each partial result as speech is detected, enabling real-time text streaming.
onFinalResult
Callback invoked when the final result is available.