fix: guard Howler rate calls when sound pool is empty - #189
Open
dazzatronus wants to merge 1 commit into
Open
dazzatronus wants to merge 1 commit into
dazzatronus wants to merge 1 commit into
Conversation
Howler's rate() getter reads _sounds[0]._id without checking the pool. Skip rate/volume control during AudioPlayer.update when the Howl is unloaded or has no sounds, so the Pixi ticker no longer TypeErrors.
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.
Why this change was needed:
Audio clip updates call Howler's
rate()during the Pixi ticker. Howler'srate()getter readsself._sounds[0]._idwith no empty-pool check, so an unloaded or cleaned Howl throwsTypeErroron_idand can crash the studio.What changed:
AudioPlayerbeforerate/volume/ play-path updates when state is notloadedor_soundsis empty.isPlayingwhen the Howl is not controllable so playback restarts cleanly once ready again.Problem solved:
Ticker updates no longer throw when a Howl sound pool has been cleared (e.g. after unload) while the audio player still runs.
Manual check:
Then load the speed template (audio clip with
speed: 1.5insrc/templates/speed.json) — changesrc/main.tsimport to./templates/speed.jsonif needed — play / scrub / change speed while audio loads and reloads.