aboutsummaryrefslogtreecommitdiff
path: root/src/wav.h
diff options
context:
space:
mode:
authorOnur Gündüz <ogunduz@gmail.com>2026-09-13 20:03:39 +0200
committerOnur Gündüz <ogunduz@gmail.com>2026-09-13 20:13:28 +0200
commit64c3a1b528a88b4ae21bf3cbcff2537200477806 (patch)
tree85da00748d7bbb5036aeb5a7a4b60b5abf75aeea /src/wav.h
downloadpyseg-64c3a1b528a88b4ae21bf3cbcff2537200477806.tar.gz
pyseg-64c3a1b528a88b4ae21bf3cbcff2537200477806.zip
Init
Diffstat (limited to 'src/wav.h')
-rw-r--r--src/wav.h22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/wav.h b/src/wav.h
new file mode 100644
index 0000000..859b535
--- /dev/null
+++ b/src/wav.h
@@ -0,0 +1,22 @@
+/* Minimal RIFF/WAVE reader for the command line tool: uncompressed 16-bit PCM
+ * only, first channel extracted. The library itself never touches files. */
+
+#ifndef PYSEG_WAV_H
+#define PYSEG_WAV_H
+
+#include <stddef.h>
+#include <stdint.h>
+
+typedef struct {
+ int16_t *samples; /* mono, first channel of the source */
+ 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 /* PYSEG_WAV_H */