8000 fix: SiriWaveformWidget animation speed inconsistent across platforms · Issue #37 · halildurmus/siri_wave · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

fix: SiriWaveformWidget animation speed inconsistent across platforms #37

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
jbpassot opened this issue Apr 9, 2025 · 0 comments
Open
Labels
bug Something isn't working as expected

Comments

@jbpassot
Copy link
jbpassot commented Apr 9, 2025

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:

  1. 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
  1. 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
  1. 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.

@jbpassot jbpassot added the bug Something isn't working as expected label Apr 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working as expected
Projects
None yet
Development

No branches or pull requests

1 participant
0