aboutsummaryrefslogtreecommitdiff
path: root/wav.h
diff options
context:
space:
mode:
authorOnur Gündüz <ogunduz@gmail.com>2026-10-21 20:08:53 +0200
committerOnur Gündüz <ogunduz@gmail.com>2026-10-21 20:08:53 +0200
commita1e355b8ceb12ac66c9d82e7786df4c3c40be479 (patch)
tree9d69cf196ec00e85009e1037a3a314d703466ac3 /wav.h
downloadframesed-master.tar.gz
framesed-master.zip
Diffstat (limited to '')
-rw-r--r--wav.h23
1 files changed, 23 insertions, 0 deletions
diff --git a/wav.h b/wav.h
new file mode 100644
index 0000000..3bd7c6d
--- /dev/null
+++ b/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 FRAMESED_WAV_H
+#define FRAMESED_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