diff options
| author | Onur Gündüz <ogunduz@gmail.com> | 2026-10-08 09:02:54 +0200 |
|---|---|---|
| committer | Onur Gündüz <ogunduz@gmail.com> | 2026-10-08 09:02:54 +0200 |
| commit | 978aa89541181c7e5b114589fac686a96702d371 (patch) | |
| tree | 5dd902164af651c8029be43332c2fe6e932e674e /tools/wav.h | |
| parent | a5af9c3d351085f4005a949f8c382a3aad4e0b29 (diff) | |
| download | svad-master.tar.gz svad-master.zip | |
Diffstat (limited to 'tools/wav.h')
| -rw-r--r-- | tools/wav.h | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/tools/wav.h b/tools/wav.h new file mode 100644 index 0000000..3fde703 --- /dev/null +++ b/tools/wav.h @@ -0,0 +1,23 @@ +/* Minimal RIFF/WAVE reader for the command line tool: uncompressed 16-bit PCM + * only. Multichannel input is downmixed by averaging every channel. The + * library itself never touches files. */ + +#ifndef VIX_WAV_H +#define VIX_WAV_H + +#include <stddef.h> +#include <stdint.h> + +typedef struct { + int16_t *samples; /* mono, averaged across source channels */ + size_t count; + int sample_rate; + int channels; +} wav_t; + +/* Returns 0 on success. On failure returns non-zero and, when err is + * non-NULL, writes a short reason there. */ +int wav_read_mono_s16(const char *path, wav_t *out, const char **err); +void wav_free(wav_t *w); + +#endif |
