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.
This PR kicks off a process of adding sound effects to the hypertext.tv UI, starting with the “physical” buttons below the screen.
To do this I:
howler.js
to manage play back of an audio sprite.Some notes to go with this:
I’m not super happy with
howler.js
as it’s a pretty chunky library that does more than we need (~10 kB gzipped, 37 kB uncompressed). I got sidetracked looking at building a lighter weight alternative, which hopefully I could finish one day, but at this time it does feel like Howler is a reliable if somewhat outdated approach, which could be swapped out later.Because the channel change buttons cause page navigations, they can interrupt sound effect playback (especially when a channel was already visited as the navigation will be faster). Marking this as a draft PR for this reason so we can revisit whether to add Astro’s client router to improve handling here.
The audio sprite was created using recordings in the “Buttons and Levers” sound pack by Coral Island Studios on freesound.org, which are shared under the public domain Creative Commons 0 license.