From ba124c0c03551d7b17f9f789ce6ab5b9f897f9f5 Mon Sep 17 00:00:00 2001 From: steven-na Date: Mon, 3 Aug 2026 12:16:33 -0700 Subject: wav_load accepts conflict scratch arenas --- src/wav.c | 4 ++-- src/wav.h | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/wav.c b/src/wav.c index 80c8407..7d00c1d 100644 --- a/src/wav.c +++ b/src/wav.c @@ -99,8 +99,8 @@ wav_fmt_chunk_t make_wav_fmt_chunk(u32 num_channels, u32 sample_rate, u16 bits_p return o; } -void wav_load(smrt_arena_t *arena, FILE *wav, f64 ***samples_o ,u16 *channel_count_o ,u64 *sample_count_o, u32 *sample_rate_o) { - smrta_temp_t scratch = smrta_scratch_start(NULL, 0); +void wav_load(smrt_arena_t *arena, FILE *wav, f64 ***samples_o ,u16 *channel_count_o ,u64 *sample_count_o, u32 *sample_rate_o, smrt_arena_t **conflicts, u64 num_conflicts) { + smrta_temp_t scratch = smrta_scratch_start(conflicts, num_conflicts); wav_master_chunk_t m; wav_fmt_chunk_t f; diff --git a/src/wav.h b/src/wav.h index 9fe412c..ddb37dd 100644 --- a/src/wav.h +++ b/src/wav.h @@ -58,12 +58,13 @@ wav_fmt_chunk_t make_wav_fmt_chunk(u32 num_channels , u32 sample_rate , u16 bits_per_sample); -/// Load WAV data into [-1.0, 1.0] f64 amplitudes. populates *o inputs with information. +/// Load WAV data into [-1.0, 1.0] f64 amplitudes. Populates -o inputs with information. /// samples will be amplitude data for each channel from the WAV file, of length sample_count. void wav_load(smrt_arena_t *arena, FILE *wav, f64 *** samples_o , u16 *channel_count_o , u64 * sample_count_o , - u32 * sample_rate_o); + u32 * sample_rate_o , + smrt_arena_t **conflicts, u64 num_conflicts ); f64 * read_8bps_data(smrt_arena_t *arena, wav_data_t data, u16 num_channels, u16 channel); f64 * read_16bps_data(smrt_arena_t *arena, wav_data_t data, u16 num_channels, u16 channel); -- cgit v1.2.3