feat: miniaudio hybrid music system (no Wwise SDK)#41
Draft
gimploo wants to merge 7 commits into
Draft
Conversation
Add PLANNED comments and stub headers for audio_device, audio_music, and audio_sfx. No runtime behavior yet — waiting for approval before vendoring miniaudio and implementing the hybrid Wwise-export path.
Implements layered interactive music + one-shot SFX for Vedanta's Wwise-authored theme (Music_Khushi). poglib changes: - audio_device.h: miniaudio engine lifecycle (init/shutdown/engine) - audio_music.h: 4-layer streaming with intensity-driven volume curves - audio_sfx.h: one-shot impact stinger pool with round-robin sets - music_config.h: Wwise-project-derived layer/curve/sfx definitions - application.h: wire device init/shutdown into app lifecycle - external/miniaudio.h: vendored single-header audio library
gimploo
commented
Jul 18, 2026
Comment on lines
+29
to
+30
| char filepath[256]; | ||
| ma_sound sound; |
gimploo
commented
Jul 18, 2026
|
|
||
| global music_theme_t g_music = {0}; | ||
|
|
||
| static f32 music__db_from_curve(const music_curve_point_t *curve, u32 count, f32 intensity) |
Owner
Author
There was a problem hiding this comment.
use INTERNAL and internal in the function name
gimploo
commented
Jul 18, 2026
| ma_sound_set_volume(&layer->sound, gain); | ||
| } | ||
| } | ||
|
|
Owner
Author
There was a problem hiding this comment.
avoid using char * and use str_t
- Replace char[]/char* with str_t in audio_music.h, audio_sfx.h, music_config.h - Rename static helpers to INTERNAL + __internal__ naming pattern - Add math.h include for powf/fabsf
MA_NO_DSOUND prevents miniaudio's DirectSound wrapper types from conflicting with windows.h (pulled in by SDL2 before miniaudio). WASAPI remains enabled as the primary Windows audio backend. Also updated miniaudio.h to latest release (v0.11.25).
MSVC build needs Windows SDK types (WORD, DWORD, etc.) defined before miniaudio's WASAPI backend code. Add explicit windows.h include with WIN32_LEAN_AND_MEAN for miniaudio on Windows.
- Remove #define WORD 512 from common.h and dbg.h (collided with Windows SDK WORD type used by miniaudio.h) - Replace all WORD buffer-size usages with literal 512 - Fix ma_sound_set_fade_in_milliseconds signature (4 args in miniaudio v0.11.25) - Fix str() compound literal in music_config.h (not constant expression for file-scope statics)
Covers: hybrid Wwise/miniaudio approach, layer system, RTPC curves, impact stingers, game integration, runtime data flow, tradeoffs, limitations, troubleshooting. Intended for contributors unfamiliar with the audio subsystem.
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.
Summary
Adds a header-only miniaudio-based audio stack for layered interactive music + one-shot SFX. Built for Vedanta's Wwise-authored theme (Music_Khushi) without requiring the Wwise SDK or SoundBanks.
What's included
application/audio_device.h— miniaudio engine lifecycle (init/shutdown/get_engine)application/audio_music.h— 4-layer streaming music with piecewise-linear volume curves driven by a single intensity parameter (0..100)application/audio_sfx.h— one-shot SFX pool with round-robin set playback (impact stingers)application/music_config.h— Wwise-project-derived config (layer files, curves, sfx set) mapped 1:1 from Music_Khushi.wwuexternal/miniaudio.h— vendored single-header audio libraryapplication.h— device init/shutdown wired into app lifecycleDesign rationale
.bnk, no Sound Engine, no license#ifndef IGNORE_*_IMPLEMENTATIONpatternCurves extracted from Wwise
Tested