summaryrefslogtreecommitdiff
path: root/src/audio/mp3_sample.h
diff options
context:
space:
mode:
authorskal <pascal.massimino@gmail.com>2026-03-02 01:40:38 +0100
committerskal <pascal.massimino@gmail.com>2026-03-02 01:40:38 +0100
commita94ec07cdaa53c0b11aa1610d40dd1a96efc0e39 (patch)
tree6a5a54e9ad99c13ef2093cf3ed7acf696cd96547 /src/audio/mp3_sample.h
parent2859c082179e19f0076a699174f7fa588234e465 (diff)
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 <noreply@anthropic.com>
Diffstat (limited to 'src/audio/mp3_sample.h')
-rw-r--r--src/audio/mp3_sample.h4
1 files changed, 4 insertions, 0 deletions
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);