summaryrefslogtreecommitdiff
path: root/wave.h
diff options
context:
space:
mode:
authorMike Pavone <pavone@retrodev.com>2013-06-16 17:57:57 -0700
committerMike Pavone <pavone@retrodev.com>2013-06-16 17:57:57 -0700
commit4a5e8b3bb9c88a802c2b7744c3766e81b0a02c6c (patch)
tree7f194ccd2765e5d51f6a7fd58606b11446bdced0 /wave.h
parent0a7995ec919cc21fe19a8b8a53512b2c979bba5f (diff)
Add support for logging YM2612 channels to WAVE files
Diffstat (limited to 'wave.h')
-rw-r--r--wave.h38
1 files changed, 38 insertions, 0 deletions
diff --git a/wave.h b/wave.h
new file mode 100644
index 0000000..4fa2440
--- /dev/null
+++ b/wave.h
@@ -0,0 +1,38 @@
+#ifndef WAVE_H_
+#define WAVE_H_
+
+#include <stdint.h>
+#include <stdio.h>
+
+#pragma pack(push, 1)
+
+typedef struct {
+ char id[4];
+ uint32_t size;
+ char format[4];
+} riff_chunk;
+
+typedef struct {
+ char id[4];
+ uint32_t size;
+} riff_sub_chunk;
+
+typedef struct {
+ riff_chunk chunk;
+ riff_sub_chunk format_header;
+ uint16_t audio_format;
+ uint16_t num_channels;
+ uint32_t sample_rate;
+ uint32_t byte_rate;
+ uint16_t block_align;
+ uint16_t bits_per_sample;
+ riff_sub_chunk data_header;
+} wave_header;
+
+#pragma pack(pop)
+
+int wave_init(FILE * f, uint32_t sample_rate, uint16_t bits_per_sample, uint16_t num_channels);
+int wave_finalize(FILE * f);
+
+#endif //WAVE_H_
+