73
66
SF_FORMAT_SD2 = 0x160000, /* Sound Designer 2 */
74
67
SF_FORMAT_FLAC = 0x170000, /* FLAC lossless file format */
75
68
SF_FORMAT_CAF = 0x180000, /* Core Audio File format */
69
SF_FORMAT_WVE = 0x190000, /* Psion WVE format */
70
SF_FORMAT_OGG = 0x200000, /* Xiph OGG container */
71
SF_FORMAT_MPC2K = 0x210000, /* Akai MPC 2000 sampler */
72
SF_FORMAT_RF64 = 0x220000, /* RF64 WAV file */
77
74
/* Subtypes from here on. */
106
103
SF_FORMAT_DPCM_8 = 0x0050, /* 8 bit differential PCM (XI only) */
107
104
SF_FORMAT_DPCM_16 = 0x0051, /* 16 bit differential PCM (XI only) */
106
SF_FORMAT_VORBIS = 0x0060, /* Xiph Vorbis encoding. */
109
108
/* Endian-ness options. */
111
110
SF_ENDIAN_FILE = 0x00000000, /* Default file endian-ness. */
128
127
{ SFC_GET_LIB_VERSION = 0x1000,
129
128
SFC_GET_LOG_INFO = 0x1001,
129
SFC_GET_CURRENT_SF_INFO = 0x1002,
131
132
SFC_GET_NORM_DOUBLE = 0x1010,
132
133
SFC_GET_NORM_FLOAT = 0x1011,
133
134
SFC_SET_NORM_DOUBLE = 0x1012,
134
135
SFC_SET_NORM_FLOAT = 0x1013,
135
136
SFC_SET_SCALE_FLOAT_INT_READ = 0x1014,
137
SFC_SET_SCALE_INT_FLOAT_WRITE = 0x1015,
137
139
SFC_GET_SIMPLE_FORMAT_COUNT = 0x1020,
138
140
SFC_GET_SIMPLE_FORMAT = 0x1021,
152
154
SFC_GET_MAX_ALL_CHANNELS = 0x1045,
154
156
SFC_SET_ADD_PEAK_CHUNK = 0x1050,
157
SFC_SET_ADD_HEADER_PAD_CHUNK = 0x1051,
156
159
SFC_UPDATE_HEADER_NOW = 0x1060,
157
160
SFC_SET_UPDATE_HEADER_AUTO = 0x1061,
179
182
SFC_GET_BROADCAST_INFO = 0x10F0,
180
183
SFC_SET_BROADCAST_INFO = 0x10F1,
185
SFC_GET_CHANNEL_MAP_INFO = 0x1100,
186
SFC_SET_CHANNEL_MAP_INFO = 0x1101,
188
SFC_RAW_DATA_NEEDS_ENDSWAP = 0x1110,
190
/* Support for Wavex Ambisonics Format */
191
SFC_WAVEX_SET_AMBISONIC = 0x1200,
192
SFC_WAVEX_GET_AMBISONIC = 0x1201,
194
SFC_SET_VBR_ENCODING_QUALITY = 0x1300,
182
196
/* Following commands for testing only. */
183
197
SFC_TEST_IEEE_FLOAT_REPLACE = 0x6001,
241
260
SF_ERR_UNSUPPORTED_ENCODING = 4
264
/* Channel map values (used with SFC_SET/GET_CHANNEL_MAP).
268
{ SF_CHANNEL_MAP_INVALID = 0,
269
SF_CHANNEL_MAP_MONO = 1,
271
SF_CHANNEL_MAP_RIGHT,
272
SF_CHANNEL_MAP_CENTER,
273
SF_CHANNEL_MAP_FRONT_LEFT,
274
SF_CHANNEL_MAP_FRONT_RIGHT,
275
SF_CHANNEL_MAP_FRONT_CENTER,
276
SF_CHANNEL_MAP_REAR_CENTER,
277
SF_CHANNEL_MAP_REAR_LEFT,
278
SF_CHANNEL_MAP_REAR_RIGHT,
280
SF_CHANNEL_MAP_FRONT_LEFT_OF_CENTER,
281
SF_CHANNEL_MAP_FRONT_RIGHT_OF_CENTER,
282
SF_CHANNEL_MAP_SIDE_LEFT,
283
SF_CHANNEL_MAP_SIDE_RIGHT,
284
SF_CHANNEL_MAP_TOP_CENTER,
285
SF_CHANNEL_MAP_TOP_FRONT_LEFT,
286
SF_CHANNEL_MAP_TOP_FRONT_RIGHT,
287
SF_CHANNEL_MAP_TOP_FRONT_CENTER,
288
SF_CHANNEL_MAP_TOP_REAR_LEFT,
289
SF_CHANNEL_MAP_TOP_REAR_RIGHT,
290
SF_CHANNEL_MAP_TOP_REAR_CENTER
244
294
/* A SNDFILE* pointer can be passed around much like stdio.h's FILE* pointer. */
246
296
typedef struct SNDFILE_tag SNDFILE ;
248
/* The following typedef is system specific and is defined when libsndfile is.
249
** compiled. sf_count_t can be one of loff_t (Linux), off_t (*BSD),
250
** off64_t (Solaris), __int64_t (Win32) etc.
298
/* The following typedef is system specific and is defined when libsndfile is
299
** compiled. sf_count_t can be one of loff_t (Linux), off_t (*BSD), off64_t
300
** (Solaris), __int64_t (Win32) etc. On windows, we need to allow the same
301
** header file to be compiler by both GCC and the microsoft compiler.
305
typedef __int64_t sf_count_t ;
306
#define SF_COUNT_MAX 0x7fffffffffffffffi64
253
308
typedef @TYPEOF_SF_COUNT_T@ sf_count_t ;
255
309
#define SF_COUNT_MAX @SF_COUNT_MAX@
257
313
/* A pointer to a SF_INFO structure is passed to sf_open_read () and filled in.
258
314
** On write, the SF_INFO structure is filled in by the user and passed into
371
/* Struct used to retrieve broadcast (EBU) information from a file.
427
/* Struct used to retrieve broadcast (EBU) information from a file.
372
428
** Strongly (!) based on EBU "bext" chunk format used in Broadcast WAVE.
375
{ char description [256] ;
376
char originator [32] ;
377
char originator_reference [32] ;
378
char origination_date [10] ;
379
char origination_time [8] ;
380
int time_reference_low ;
381
int time_reference_high ;
384
char reserved [190] ;
385
unsigned int coding_history_size ;
386
char coding_history [256] ;
387
} SF_BROADCAST_INFO ;
430
#define SF_BROADCAST_INFO_VAR(coding_hist_size) \
432
{ char description [256] ; \
433
char originator [32] ; \
434
char originator_reference [32] ; \
435
char origination_date [10] ; \
436
char origination_time [8] ; \
437
unsigned int time_reference_low ; \
438
unsigned int time_reference_high ; \
441
char reserved [190] ; \
442
unsigned int coding_history_size ; \
443
char coding_history [coding_hist_size] ; \
446
/* SF_BROADCAST_INFO is the above struct with coding_history field of 256 bytes. */
447
typedef SF_BROADCAST_INFO_VAR (256) SF_BROADCAST_INFO ;
450
/* Virtual I/O functionality. */
389
452
typedef sf_count_t (*sf_vio_get_filelen) (void *user_data) ;
390
453
typedef sf_count_t (*sf_vio_seek) (sf_count_t offset, int whence, void *user_data) ;
417
480
** of file header is at the current file offset. This allows sound files within
418
481
** larger container files to be read and/or written.
419
482
** On error, this will return a NULL pointer. To find the error number, pass a
420
** NULL SNDFILE to sf_perror () or sf_error_str ().
483
** NULL SNDFILE to sf_strerror ().
421
484
** All calls to sf_open_fd() should be matched with a call to sf_close().