fix: make speaking waveform animation loop seamlessly
The animPhase multiplier 1.5 caused sin(x+3π)=-sin(x) at loop restart, creating a visible jump. Changed to integer multiplier 2 so the wave returns to its initial state (sin(x+4π)=sin(x)) for a smooth loop. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
9906a67d06
commit
e3131cfe1a
1 changed files with 1 additions and 1 deletions
|
|
@ -352,7 +352,7 @@ private fun WaveformBar(
|
||||||
(0.2f + 0.15f * ((wave + 1f) / 2f)) * size.height
|
(0.2f + 0.15f * ((wave + 1f) / 2f)) * size.height
|
||||||
}
|
}
|
||||||
VoicePhase.SPEAKING -> {
|
VoicePhase.SPEAKING -> {
|
||||||
val wave = sin(normalizedX * 5f * PI.toFloat() + animPhase * 1.5f)
|
val wave = sin(normalizedX * 5f * PI.toFloat() + animPhase * 2f)
|
||||||
(0.2f + 0.4f * ((wave + 1f) / 2f)) * size.height
|
(0.2f + 0.4f * ((wave + 1f) / 2f)) * size.height
|
||||||
}
|
}
|
||||||
else -> 0.1f * size.height
|
else -> 0.1f * size.height
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue