Audio music and sound#30
Open
clintjeff2 wants to merge 2 commits into
Open
Conversation
- Implement AudioManager using Web Audio API for low-latency playback. - Add royalty-free music and SFX assets (via URL for demo purposes). - Map SFX to game events: click, movement, attack, production, and end turn. - Implement music switching between menu and gameplay. - Add Audio Settings UI with volume sliders and mute toggle. - Persist volume settings in localStorage. - Comply with browser autoplay policies by initializing on user interaction. Co-authored-by: clintjeff2 <119521983+clintjeff2@users.noreply.github.com>
…1149493533 Audio system: music and sound effects implementation
Author
|
@leocagli , kindly review and merge. |
|
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.



I have implemented a comprehensive audio system for the 'Human vs Bots' game demo.
Key features include:
audio.jsfile houses theAudioManagerclass, which manages the Web Audio API lifecycle, separate gain nodes for a mixer effect (Master, Music, SFX), and asset loading.localStorageand restored upon reloading the game.I verified the implementation using a Playwright script that confirmed the triggering of music and SFX events and captured a screenshot of the new UI.
Closes #25