Implement proper playback on audio components using Timer#267
Merged
waynemwashuma merged 12 commits intowimaengine:devfrom Sep 27, 2025
Merged
Conversation
d977695 to
6313a29
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Objective
Implements the audio playback system to use the centralized
Timercomponent instead of the defunct customplaybackproperty within audio components.Note
This aligns the audio playback system with the engine's timing model, making audio playback control more intuitive and feature-rich. The changes enable sophisticated audio sequencing and synchronization with other timed events in the application.
New features available:
timer.speedtimer.seek()timer.cyclesCompleted()for loop countingtimer.playbackChanged()Solution
The solution involved replacing the internal
playbackstate inAudioPlayerandAudioOscillatorcomponents with the standardTimercomponent used throughout the engine. This provides several benefits:Key changes made:
playbackproperty from audio componentsTimercomponent requirement for all audio entitiesShowcase
Set up simple audio playback with timer control:
Control playback using timer methods
The new audio playback demo also demonstrates various controls.
Migration Guide
This introduces breaking changes to audio component usage:
Required Changes:
Timercomponent to all entities containing audio componentsplaybackModeparameter fromAudioPlayerconstructorChecklist