AIVoiceWave

fun AIVoiceWave(state: AIVoiceAgentState, modifier: Modifier = Modifier, colors: List<Color> = AIVoiceVisualizationDefaults.colors(), expressivity: Float = 1.0f, audioLevel: () -> Float?? = null)

A voice agent as a single string, flat at its ends, carrying a wave packet that erupts with speech while its colors flow along it. Tapping the string ripples it from the touch, and so does a hovering mouse or stylus.

It has no size of its own and draws in the middle of the space it is given, about 80% as wide as its shorter side, so give it a square or a wide box.

Parameters

state

What the agent is doing, which sets how the wave moves.

modifier

The Modifier to be applied to the wave.

colors

One to five colors, flowing along the string in bands. Past five are ignored.

expressivity

From 0 to 2: how far and how fast it moves. Colors never change with it.

audioLevel

The level of whoever is talking, from 0 to 1, read once a frame. Feed it at 15 Hz or more for the wave to move with the words; null animates speech on its own.