summaryrefslogtreecommitdiff
path: root/src/c_asndfile.h
blob: 8c2a1735328aa83c0cff740d89cc1932835c15d5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
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