Open WilliamCheen opened 3 months ago
VoiceSegment.Volume
is calulated by root mean square (in range [0, 1]) of wave data in a time segment.
This value is usually small, e.g. 0.01~.
An idea of mapping volume to animation is as follows:
CumulativeVoiceActivityDetector.activeVolumeThreshold
(or QueueingVoiceActivityDetector.activeVolumeThreshold
).( Mathf.Clamp(volume, lower, upper) - lower ) / (upper - lower)
Please adjust upper threshold value or calculation logic for your use case.
Thank you very much for the pointers, following the steps above I achieved a similar effect, thanks!
Thank you very much for this library, it helped me a lot. I need to animate the sound waves during the recording process, and I have found a way to do it, it seems to get the current VoiceSegment, and then use voiceSegment.Volumn to do some calculations to correspond to the Image's sizeDelta.y. But unfortunately, I never found the mapping relationship. How to realize the sound wave animation during recording?