Package 

Class SpeechToTextButtonKt

    • Method Detail

      • SpeechToTextButton

        @Composable() final static Unit SpeechToTextButton(SpeechToTextButtonState state, Modifier modifier, Function0<Unit> onPermissionDenied, Function1<Function0<Unit>, Unit> idleContent, Function2<Function0<Unit>, Float, Unit> recordingContent)

        A composable button that provides speech-to-text functionality.

        When not recording, displays a microphone icon button. When recording, transforms into a circle with animated bars that respond to voice input.

        The component automatically handles:

        • Audio permission requests

        • Starting and stopping speech recognition

        • Streaming recognized text chunks to the callback as they're detected

        • Animated visualization during recording

        Parameters:
        state - The state holder for tracking recording status.
        modifier - Modifier to be applied to the root container
        onPermissionDenied - Callback invoked when microphone permission is denied.
        idleContent - The composable content to display when not recording.
        recordingContent - The composable content to display when recording.
      • rememberSpeechToTextButtonState

        @Composable() final static SpeechToTextButtonState rememberSpeechToTextButtonState(Function1<String, Unit> onPartialResult, Function1<String, Unit> onFinalResult)

        Creates and remembers a SpeechToTextButtonState instance.

        The state is remembered across recompositions and can be used to track the recording status of a SpeechToTextButton.

        Parameters:
        onPartialResult - Callback invoked when text chunks are recognized.
        onFinalResult - Callback invoked when the final result is available.