summaryrefslogtreecommitdiff
path: root/src/c_asndfile.h
diff options
context:
space:
mode:
authorJedidiah Barber <contact@jedbarber.id.au>2023-07-02 21:36:34 +1200
committerJedidiah Barber <contact@jedbarber.id.au>2023-07-02 21:36:34 +1200
commit049d2a9a337331295b4a2d4ad13061bc73536236 (patch)
treec360b2ce05f91d070c14dad7a3691c1435df7df7 /src/c_asndfile.h
Initial commit
Diffstat (limited to 'src/c_asndfile.h')
-rw-r--r--src/c_asndfile.h141
1 files changed, 141 insertions, 0 deletions
diff --git a/src/c_asndfile.h b/src/c_asndfile.h
new file mode 100644
index 0000000..8c2a173
--- /dev/null
+++ b/src/c_asndfile.h
@@ -0,0 +1,141 @@
+
+
+// Programmed by Jedidiah Barber
+// Released into the public domain
+
+
+#ifndef ASNDFILE_GUARD
+#define ASNDFILE_GUARD
+
+#include <sndfile.h>
+
+
+extern const int sf_false;
+extern const int sf_true;
+
+extern const int sfm_read;
+extern const int sfm_write;
+extern const int sfm_rdwr;
+
+extern const int sf_seek_set;
+extern const int sf_seek_cur;
+extern const int sf_seek_end;
+
+extern const int sf_str_title;
+extern const int sf_str_copyright;
+extern const int sf_str_software;
+extern const int sf_str_artist;
+extern const int sf_str_comment;
+extern const int sf_str_date;
+extern const int sf_str_album;
+extern const int sf_str_license;
+extern const int sf_str_tracknumber;
+extern const int sf_str_genre;
+
+extern const int format_wav;
+extern const int format_aiff;
+extern const int format_au;
+extern const int format_raw;
+extern const int format_paf;
+extern const int format_svx;
+extern const int format_nist;
+extern const int format_voc;
+extern const int format_ircam;
+extern const int format_w64;
+extern const int format_mat4;
+extern const int format_mat5;
+extern const int format_pvf;
+extern const int format_xi;
+extern const int format_htk;
+extern const int format_sds;
+extern const int format_avr;
+extern const int format_wavex;
+extern const int format_sd2;
+extern const int format_flac;
+extern const int format_caf;
+extern const int format_wve;
+extern const int format_ogg;
+extern const int format_mpc2k;
+extern const int format_rf64;
+extern const int format_mpeg;
+
+extern const int format_pcm_s8;
+extern const int format_pcm_16;
+extern const int format_pcm_24;
+extern const int format_pcm_32;
+extern const int format_pcm_u8;
+extern const int format_float;
+extern const int format_double;
+extern const int format_ulaw;
+extern const int format_alaw;
+extern const int format_ima_adpcm;
+extern const int format_ms_adpcm;
+extern const int format_gsm610;
+extern const int format_vox_adpcm;
+extern const int format_nms_adpcm_16;
+extern const int format_nms_adpcm_24;
+extern const int format_nms_adpcm_32;
+extern const int format_g721_32;
+extern const int format_g723_24;
+extern const int format_g723_40;
+extern const int format_dwvw_12;
+extern const int format_dwvw_16;
+extern const int format_dwvw_24;
+extern const int format_dwvw_n;
+extern const int format_dpcm_8;
+extern const int format_dpcm_16;
+extern const int format_vorbis;
+extern const int format_opus;
+extern const int format_alac_16;
+extern const int format_alac_20;
+extern const int format_alac_24;
+extern const int format_alac_32;
+extern const int format_mpeg_layer_i;
+extern const int format_mpeg_layer_ii;
+extern const int format_mpeg_layer_iii;
+
+extern const int endian_file;
+extern const int endian_little;
+extern const int endian_big;
+extern const int endian_cpu;
+
+extern const int err_no_error;
+extern const int err_unrecognised_format;
+extern const int err_system;
+extern const int err_malformed_file;
+extern const int err_unsupported_encoding;
+
+
+typedef struct {
+ int64_t frames;
+ int samplerate;
+ int channels;
+ int major;
+ int minor;
+ int endian;
+ int sections;
+ int seekable;
+} Asf_Info;
+
+
+SNDFILE * asf_open(const char * path, int mode, Asf_Info * sfinfo);
+int asf_format_check(Asf_Info * sfinfo);
+int64_t asf_seek(SNDFILE * sndfile, int64_t frames, int whence);
+
+int64_t asf_readf_short(SNDFILE * sndfile, short * ptr, int64_t items);
+int64_t asf_readf_int(SNDFILE * sndfile, int * ptr, int64_t items);
+int64_t asf_readf_float(SNDFILE * sndfile, float * ptr, int64_t items);
+int64_t asf_readf_double(SNDFILE * sndfile, double * ptr, int64_t items);
+
+int64_t asf_writef_short(SNDFILE * sndfile, short * ptr, int64_t items);
+int64_t asf_writef_int(SNDFILE * sndfile, int * ptr, int64_t items);
+int64_t asf_writef_float(SNDFILE * sndfile, float * ptr, int64_t items);
+int64_t asf_writef_double(SNDFILE * sndfile, double * ptr, int64_t items);
+
+int64_t asf_read_raw(SNDFILE * sndfile, void * ptr, int64_t bytes);
+int64_t asf_write_raw(SNDFILE * sndfile, void * ptr, int64_t bytes);
+
+
+#endif
+
+