summaryrefslogtreecommitdiff
path: root/src/wav.h
diff options
context:
space:
mode:
authorsteven-na <noreply.github@stvnc.dev>2026-08-01 16:18:54 -0700
committersteven-na <noreply.github@stvnc.dev>2026-08-01 16:18:54 -0700
commit584d166c4ebf2768825e6719f461fd91c3dd4555 (patch)
tree7e812af63859ff645b185ecd44fd1cef2704a970 /src/wav.h
parent75d360d5c94f70bc93dfd2a52faee374a8e5838b (diff)
Formatting
Diffstat (limited to 'src/wav.h')
-rw-r--r--src/wav.h22
1 files changed, 16 insertions, 6 deletions
diff --git a/src/wav.h b/src/wav.h
index 7e3c861..21830ad 100644
--- a/src/wav.h
+++ b/src/wav.h
@@ -5,11 +5,9 @@
#include <stdio.h>
-#define WAV_DATA_BASE_POS sizeof(wav_data_t)
-
typedef struct {
u64 sample_count;
- u8 *samples;
+ u8 * samples;
} wav_data_t;
// [Master RIFF chunk]
@@ -44,6 +42,18 @@ typedef struct {
} wav_fmt_chunk_t;
#pragma pack(pop)
- wav_data_t load_wav_file(smrt_arena_t *arena, FILE *wav_file, wav_master_chunk_t *master_o, wav_fmt_chunk_t *format_o);
- b32 write_wav_file(FILE *wav_file, wav_fmt_chunk_t *fmt_chunk_i, wav_data_t data_i);
-wav_fmt_chunk_t make_wav_fmt_chunk(u32 num_channels, u32 sample_rate, u16 bits_per_sample);
+/// Load WAV data from wav_file. Data will be allocated on arena
+wav_data_t load_wav_file(smrt_arena_t * arena ,
+ FILE *wav_file ,
+ wav_master_chunk_t *master_o ,
+ wav_fmt_chunk_t *format_o);
+
+/// Write WAV headers and data to wav_file.
+b32 write_wav_file(FILE * wav_file ,
+ wav_fmt_chunk_t *fmt_chunk_i ,
+ wav_data_t data_i);
+
+/// Generate WAV "fmt " chunk for unsigned 8-bit PCM data ready to be written to a file.
+wav_fmt_chunk_t make_wav_fmt_chunk(u32 num_channels ,
+ u32 sample_rate ,
+ u16 bits_per_sample);