Update .wav samples to use 'agbl' chunk to accomodate for vanilla's off-by-one loop end behavior (#712)

This commit is contained in:
Marcus Huderle
2025-12-28 09:10:08 -06:00
committed by GitHub
parent 14b76daff8
commit 338ec9d956
483 changed files with 204 additions and 50 deletions
+13
View File
@@ -8,6 +8,16 @@
#define WAV_INVALID_VAL 0xFFFFFFFFu
// Structure for WAV chunk utilities
struct WavChunk {
std::string id;
std::vector<uint8_t> data;
};
void write_wav_with_agbl_chunk(const std::string& output_path,
std::vector<WavChunk>& chunks,
uint32_t loop_end_value);
class wav_file {
public:
wav_file(const std::string& path);
@@ -34,5 +44,8 @@ public:
double tuning = 0.0; // cents
uint8_t midiKey = 60;
uint32_t sampleRate;
uint32_t numSamples = 0; // total number of samples in the file
uint32_t agbPitch = 0; // optional: exact GBA pitch value from 'agbp' chunk (0 = not present)
uint32_t agbLoopEnd = 0; // optional: exact loop end from 'agbl' chunk (0 = not present)
std::vector<WavChunk> chunks; // raw chunks from the WAV file (for re-writing with modifications)
};