fix: SiriWaveformWidget animation speed inconsistent across platforms · Issue #37 · halildurmus/siri_wave · GitHub
More Web Proxy on the site http://driver.im/
You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The IOS9SiriWaveform widget (SiriWaveformWidget) has inconsistent animation speeds when used with identical parameters across different platforms. This makes it difficult to implement a consistent user experience in cross-platform applications.
Current Behavior
When using the same controller and parameters on iOS, Android, and web platforms, the waveform animation runs at noticeably different speeds on each platform.
Platforms Affected
iOS
Android
Web
Steps To Reproduce
(Note that I am changing the amplitude dynamically based on the intensity of a voice.)
The waveform animation should run at a consistent, predictable speed regardless of the platform. The same parameter values should produce visually similar animation speeds on iOS, Android, and web.
Additional Context
Based on some initial investigation:
The current implementation is frame-dependent animation approach. The phase increments with each frame rendered, which means:
Different frame rates = different speeds:
iOS, Android, and web browsers can have different default frame rates
Higher frame rate devices will appear to animate faster because they call paint more frequently
Web particularly can have inconsistent frame rates across browsers
No time normalization:
The code doesn't account for the actual time elapsed between frames
It simply adds a fixed amount to the phase on each redraw
Fixed speed factor:
_speedFactor = 1 is platform-agnostic but doesn't compensate for platform differences
IOS9SiriWaveformPainter should probably use a time-based animation approach to ensure consistent speed across platforms.
The text was updated successfully, but these errors were encountered:
Uh oh!
There was an error while loading. Please reload this page.
Description
The IOS9SiriWaveform widget (SiriWaveformWidget) has inconsistent animation speeds when used with identical parameters across different platforms. This makes it difficult to implement a consistent user experience in cross-platform applications.
Current Behavior
When using the same controller and parameters on iOS, Android, and web platforms, the waveform animation runs at noticeably different speeds on each platform.
Platforms Affected
iOS
Android
Web
Steps To Reproduce
(Note that I am changing the amplitude dynamically based on the intensity of a voice.)
intensitySubscription = audioService.intensityStream.listen((intensity) {
if (audioService.isPlaying() && intensity != _intensity) {
_intensity = intensity;
siriwaveIos9Controller.amplitude = _intensity;
}
});
Expected Behavior
The waveform animation should run at a consistent, predictable speed regardless of the platform. The same parameter values should produce visually similar animation speeds on iOS, Android, and web.
Additional Context
Based on some initial investigation:
The current implementation is frame-dependent animation approach. The phase increments with each frame rendered, which means:
IOS9SiriWaveformPainter should probably use a time-based animation approach to ensure consistent speed across platforms.
The text was updated successfully, but these errors were encountered: