audio: refactor audio asset loading, add crit sound #9

Merged
NotAShelf merged 2 commits from amr/rogged:audio into main 2026-04-07 17:56:38 +00:00
Collaborator

Created AudioAssets struct to hold the loaded sounds. It's part of the GameState to make it easy to access everywhere. If this is bad it can be refactored fairly easily.

Created AudioAssets struct to hold the loaded sounds. It's part of the GameState to make it easy to access everywhere. If this is bad it can be refactored fairly easily.
amr 2026-04-06 21:53:28 +00:00
amr self-assigned this 2026-04-06 21:54:42 +00:00
@ -95,3 +94,3 @@
void audio_play_item_pickup(void) {
void audio_play_item_pickup(GameState *gs) {
// High-pitched pickup sound
play_tone(800.0f, 0.15f, 0.4f);
Owner

Is the double sound playback intentional?

This plays both a procedural play_tone() and the loaded gs->sounds.pickup, simultaneously. Other refactored functions (audio_play_attack, audio_play_dodge) replaced procedural tones entirely with loaded sounds.

Is the double sound playback intentional? This plays both a procedural `play_tone()` and the loaded `gs->sounds.pickup`, simultaneously. Other refactored functions (`audio_play_attack`, `audio_play_dodge`) replaced procedural tones entirely with loaded sounds.
Author
Collaborator

Oh, no, meant to remove that play_tone. Though it's not actually working anyway. But yeah I'll nix that.

Oh, no, meant to remove that play_tone. Though it's not actually working anyway. But yeah I'll nix that.
amr marked this conversation as resolved
NotAShelf approved these changes 2026-04-07 17:56:24 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
NotAShelf/rogged!9
No description provided.