VoiceInputIndicator

Functions summary

Unit
@Composable
VoiceInputIndicator(
    level: () -> Float,
    modifier: Modifier,
    indicatorColor: Color
)

A voice input indicator that displays sound activity to the user.

Functions

VoiceInputIndicator

@Composable
fun VoiceInputIndicator(
    level: () -> Float,
    modifier: Modifier = Modifier,
    indicatorColor: Color = GlimmerTheme.colors.primary
): Unit

A voice input indicator that displays sound activity to the user.

This component can be used when accepting voice input to show that the app is listening to the user's input. The indicator responds to the level provided, showing a visual representation of the audio intensity.

See ContainedVoiceInputIndicator for the version of this component with a background container where the indicator bars are transparent.

import androidx.compose.runtime.Composable
import androidx.xr.glimmer.VoiceInputIndicator

// Get audio input from microphone.
// Normalize audio input to level 0...1

// Pass normalized level to Composable.
VoiceInputIndicator(level = { level })
Parameters
level: () -> Float

The level of the voice input, ranging from 0.0 (silence) to 1.0 (loudest).

modifier: Modifier = Modifier

The modifier to be applied to the indicator.

indicatorColor: Color = GlimmerTheme.colors.primary

The color of the indicator bars.