From a94ec07cdaa53c0b11aa1610d40dd1a96efc0e39 Mon Sep 17 00:00:00 2001 From: skal Date: Mon, 2 Mar 2026 01:40:38 +0100 Subject: feat(audio): MP3 asset support in tracker via decode-at-init Detect MP3 blobs by magic bytes in tracker_init(), decode to spectrogram (hamming window + FDCT) using new mp3_decode(), and register with synth exactly like .spec assets. STRIP_ALL builds guard with FATAL_CHECK. handoff(Gemini): MP3 assets now usable in music.track with SAMPLE ASSET_* syntax; see doc/TRACKER.md for usage. No synth/compiler/packer changes. Co-Authored-By: Claude Sonnet 4.6 --- src/audio/mp3_sample.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/audio/mp3_sample.h') diff --git a/src/audio/mp3_sample.h b/src/audio/mp3_sample.h index e8229f2..e7e759e 100644 --- a/src/audio/mp3_sample.h +++ b/src/audio/mp3_sample.h @@ -24,6 +24,10 @@ Mp3Decoder* mp3_open(const uint8_t* data, size_t size); int mp3_decode_range(Mp3Decoder* dec, int start_frame, int num_frames, float* out); +// Read up to |num_frames| f32 mono samples sequentially from current position. +// Returns frames decoded (< num_frames means end of stream). +int mp3_decode(Mp3Decoder* dec, int num_frames, float* out); + // Release the decoder. void mp3_close(Mp3Decoder* dec); -- cgit v1.2.3