1 /*
2                                     __
3                                    / _|
4   __ _ _   _ _ __ ___  _ __ __ _  | |_ ___  ___ ___
5  / _` | | | | '__/ _ \| '__/ _` | |  _/ _ \/ __/ __|
6 | (_| | |_| | | | (_) | | | (_| | | || (_) \__ \__ \
7  \__,_|\__,_|_|  \___/|_|  \__,_| |_| \___/|___/___/
8 
9 Copyright (C) 2018-2019 Aurora Free Open Source Software.
10 
11 This file is part of the Aurora Free Open Source Software. This
12 organization promote free and open source software that you can
13 redistribute and/or modify under the terms of the GNU Lesser General
14 Public License Version 3 as published by the Free Software Foundation or
15 (at your option) any later version approved by the Aurora Free Open Source
16 Software Organization. The license is available in the package root path
17 as 'LICENSE' file. Please review the following information to ensure the
18 GNU Lesser General Public License version 3 requirements will be met:
19 https://www.gnu.org/licenses/lgpl.html .
20 
21 Alternatively, this file may be used under the terms of the GNU General
22 Public License version 3 or later as published by the Free Software
23 Foundation. Please review the following information to ensure the GNU
24 General Public License requirements will be met:
25 http://www.gnu.org/licenses/gpl-3.0.html.
26 
27 NOTE: All products, services or anything associated to trademarks and
28 service marks used or referenced on this file are the property of their
29 respective companies/owners or its subsidiaries. Other names and brands
30 may be claimed as the property of others.
31 
32 For more info about intellectual property visit: aurorafoss.org or
33 directly send an email to: contact (at) aurorafoss.org .
34 */
35 
36 module riverd.sndfile.types;
37 
38 import core.stdc.stdio : SEEK_SET, SEEK_CUR, SEEK_END;
39 
40 extern(C):
41 
42 /* This is the version 1.0.X header file. */
43 enum SNDFILE_1 = true;
44 
45 /* The following file types can be read and written.
46  ** A file type would consist of a major type (ie SF_FORMAT_WAV) bitwise
47  ** ORed with a minor type (ie SF_FORMAT_PCM). SF_FORMAT_TYPEMASK and
48  ** SF_FORMAT_SUBMASK can be used to separate the major and minor file
49  ** types.
50  */
51 
52 enum
53 {	/* Major formats. */
54 	SF_FORMAT_WAV			= 0x010000,		/* Microsoft WAV format (little endian default). */
55 	SF_FORMAT_AIFF			= 0x020000,		/* Apple/SGI AIFF format (big endian). */
56 	SF_FORMAT_AU			= 0x030000,		/* Sun/NeXT AU format (big endian). */
57 	SF_FORMAT_RAW			= 0x040000,		/* RAW PCM data. */
58 	SF_FORMAT_PAF			= 0x050000,		/* Ensoniq PARIS file format. */
59 	SF_FORMAT_SVX			= 0x060000,		/* Amiga IFF / SVX8 / SV16 format. */
60 	SF_FORMAT_NIST			= 0x070000,		/* Sphere NIST format. */
61 	SF_FORMAT_VOC			= 0x080000,		/* VOC files. */
62 	SF_FORMAT_IRCAM			= 0x0A0000,		/* Berkeley/IRCAM/CARL */
63 	SF_FORMAT_W64			= 0x0B0000,		/* Sonic Foundry's 64 bit RIFF/WAV */
64 	SF_FORMAT_MAT4			= 0x0C0000,		/* Matlab (tm) V4.2 / GNU Octave 2.0 */
65 	SF_FORMAT_MAT5			= 0x0D0000,		/* Matlab (tm) V5.0 / GNU Octave 2.1 */
66 	SF_FORMAT_PVF			= 0x0E0000,		/* Portable Voice Format */
67 	SF_FORMAT_XI			= 0x0F0000,		/* Fasttracker 2 Extended Instrument */
68 	SF_FORMAT_HTK			= 0x100000,		/* HMM Tool Kit format */
69 	SF_FORMAT_SDS			= 0x110000,		/* Midi Sample Dump Standard */
70 	SF_FORMAT_AVR			= 0x120000,		/* Audio Visual Research */
71 	SF_FORMAT_WAVEX			= 0x130000,		/* MS WAVE with WAVEFORMATEX */
72 	SF_FORMAT_SD2			= 0x160000,		/* Sound Designer 2 */
73 	SF_FORMAT_FLAC			= 0x170000,		/* FLAC lossless file format */
74 	SF_FORMAT_CAF			= 0x180000,		/* Core Audio File format */
75 	SF_FORMAT_WVE			= 0x190000,		/* Psion WVE format */
76 	SF_FORMAT_OGG			= 0x200000,		/* Xiph OGG container */
77 	SF_FORMAT_MPC2K			= 0x210000,		/* Akai MPC 2000 sampler */
78 	SF_FORMAT_RF64			= 0x220000,		/* RF64 WAV file */
79 
80 	/* Subtypes from here on. */
81 
82 	SF_FORMAT_PCM_S8		= 0x0001,		/* Signed 8 bit data */
83 	SF_FORMAT_PCM_16		= 0x0002,		/* Signed 16 bit data */
84 	SF_FORMAT_PCM_24		= 0x0003,		/* Signed 24 bit data */
85 	SF_FORMAT_PCM_32		= 0x0004,		/* Signed 32 bit data */
86 
87 	SF_FORMAT_PCM_U8		= 0x0005,		/* Unsigned 8 bit data (WAV and RAW only) */
88 
89 	SF_FORMAT_FLOAT			= 0x0006,		/* 32 bit float data */
90 	SF_FORMAT_DOUBLE		= 0x0007,		/* 64 bit float data */
91 
92 	SF_FORMAT_ULAW			= 0x0010,		/* U-Law encoded. */
93 	SF_FORMAT_ALAW			= 0x0011,		/* A-Law encoded. */
94 	SF_FORMAT_IMA_ADPCM		= 0x0012,		/* IMA ADPCM. */
95 	SF_FORMAT_MS_ADPCM		= 0x0013,		/* Microsoft ADPCM. */
96 
97 	SF_FORMAT_GSM610		= 0x0020,		/* GSM 6.10 encoding. */
98 	SF_FORMAT_VOX_ADPCM		= 0x0021,		/* OKI / Dialogix ADPCM */
99 
100 	SF_FORMAT_G721_32		= 0x0030,		/* 32kbs G721 ADPCM encoding. */
101 	SF_FORMAT_G723_24		= 0x0031,		/* 24kbs G723 ADPCM encoding. */
102 	SF_FORMAT_G723_40		= 0x0032,		/* 40kbs G723 ADPCM encoding. */
103 
104 	SF_FORMAT_DWVW_12		= 0x0040, 		/* 12 bit Delta Width Variable Word encoding. */
105 	SF_FORMAT_DWVW_16		= 0x0041, 		/* 16 bit Delta Width Variable Word encoding. */
106 	SF_FORMAT_DWVW_24		= 0x0042, 		/* 24 bit Delta Width Variable Word encoding. */
107 	SF_FORMAT_DWVW_N		= 0x0043, 		/* N bit Delta Width Variable Word encoding. */
108 
109 	SF_FORMAT_DPCM_8		= 0x0050,		/* 8 bit differential PCM (XI only) */
110 	SF_FORMAT_DPCM_16		= 0x0051,		/* 16 bit differential PCM (XI only) */
111 
112 	SF_FORMAT_VORBIS		= 0x0060,		/* Xiph Vorbis encoding. */
113 
114 	/* Endian-ness options. */
115 
116 	SF_ENDIAN_FILE			= 0x00000000,	/* Default file endian-ness. */
117 	SF_ENDIAN_LITTLE		= 0x10000000,	/* Force little endian-ness. */
118 	SF_ENDIAN_BIG			= 0x20000000,	/* Force big endian-ness. */
119 	SF_ENDIAN_CPU			= 0x30000000,	/* Force CPU endian-ness. */
120 
121 	SF_FORMAT_SUBMASK		= 0x0000FFFF,
122 	SF_FORMAT_TYPEMASK		= 0x0FFF0000,
123 	SF_FORMAT_ENDMASK		= 0x30000000
124 }
125 
126 /*
127  ** The following are the valid command numbers for the sf_command()
128  ** interface.  The use of these commands is documented in the file
129  ** command.html in the doc directory of the source code distribution.
130  */
131 
132 enum
133 {	SFC_GET_LIB_VERSION				= 0x1000,
134 	SFC_GET_LOG_INFO				= 0x1001,
135 	SFC_GET_CURRENT_SF_INFO			= 0x1002,
136 
137 
138 	SFC_GET_NORM_DOUBLE				= 0x1010,
139 	SFC_GET_NORM_FLOAT				= 0x1011,
140 	SFC_SET_NORM_DOUBLE				= 0x1012,
141 	SFC_SET_NORM_FLOAT				= 0x1013,
142 	SFC_SET_SCALE_FLOAT_INT_READ	= 0x1014,
143 	SFC_SET_SCALE_INT_FLOAT_WRITE	= 0x1015,
144 
145 	SFC_GET_SIMPLE_FORMAT_COUNT		= 0x1020,
146 	SFC_GET_SIMPLE_FORMAT			= 0x1021,
147 
148 	SFC_GET_FORMAT_INFO				= 0x1028,
149 
150 	SFC_GET_FORMAT_MAJOR_COUNT		= 0x1030,
151 	SFC_GET_FORMAT_MAJOR			= 0x1031,
152 	SFC_GET_FORMAT_SUBTYPE_COUNT	= 0x1032,
153 	SFC_GET_FORMAT_SUBTYPE			= 0x1033,
154 
155 	SFC_CALC_SIGNAL_MAX				= 0x1040,
156 	SFC_CALC_NORM_SIGNAL_MAX		= 0x1041,
157 	SFC_CALC_MAX_ALL_CHANNELS		= 0x1042,
158 	SFC_CALC_NORM_MAX_ALL_CHANNELS	= 0x1043,
159 	SFC_GET_SIGNAL_MAX				= 0x1044,
160 	SFC_GET_MAX_ALL_CHANNELS		= 0x1045,
161 
162 	SFC_SET_ADD_PEAK_CHUNK			= 0x1050,
163 	SFC_SET_ADD_HEADER_PAD_CHUNK	= 0x1051,
164 
165 	SFC_UPDATE_HEADER_NOW			= 0x1060,
166 	SFC_SET_UPDATE_HEADER_AUTO		= 0x1061,
167 
168 	SFC_FILE_TRUNCATE				= 0x1080,
169 
170 	SFC_SET_RAW_START_OFFSET		= 0x1090,
171 
172 	SFC_SET_DITHER_ON_WRITE			= 0x10A0,
173 	SFC_SET_DITHER_ON_READ			= 0x10A1,
174 
175 	SFC_GET_DITHER_INFO_COUNT		= 0x10A2,
176 	SFC_GET_DITHER_INFO				= 0x10A3,
177 
178 	SFC_GET_EMBED_FILE_INFO			= 0x10B0,
179 
180 	SFC_SET_CLIPPING				= 0x10C0,
181 	SFC_GET_CLIPPING				= 0x10C1,
182 
183 	SFC_GET_INSTRUMENT				= 0x10D0,
184 	SFC_SET_INSTRUMENT				= 0x10D1,
185 
186 	SFC_GET_LOOP_INFO				= 0x10E0,
187 
188 	SFC_GET_BROADCAST_INFO			= 0x10F0,
189 	SFC_SET_BROADCAST_INFO			= 0x10F1,
190 
191 	SFC_GET_CHANNEL_MAP_INFO		= 0x1100,
192 	SFC_SET_CHANNEL_MAP_INFO		= 0x1101,
193 
194 	SFC_RAW_DATA_NEEDS_ENDSWAP		= 0x1110,
195 
196 	/* Support for Wavex Ambisonics Format */
197 	SFC_WAVEX_SET_AMBISONIC			= 0x1200,
198 	SFC_WAVEX_GET_AMBISONIC			= 0x1201,
199 
200 	SFC_SET_VBR_ENCODING_QUALITY	= 0x1300,
201 
202 	/* Following commands for testing only. */
203 	SFC_TEST_IEEE_FLOAT_REPLACE		= 0x6001,
204 
205 	/*
206 	 ** SFC_SET_ADD_* values are deprecated and will disappear at some
207 	 ** time in the future. They are guaranteed to be here up to and
208 	 ** including version 1.0.8 to avoid breakage of existng software.
209 	 ** They currently do nothing and will continue to do nothing.
210 	 */
211 	SFC_SET_ADD_DITHER_ON_WRITE		= 0x1070,
212 	SFC_SET_ADD_DITHER_ON_READ		= 0x1071
213 }
214 
215 
216 /*
217  ** String types that can be set and read from files. Not all file types
218  ** support this and even the file types which support one, may not support
219  ** all string types.
220  */
221 
222 enum
223 {	SF_STR_TITLE					= 0x01,
224 	SF_STR_COPYRIGHT				= 0x02,
225 	SF_STR_SOFTWARE					= 0x03,
226 	SF_STR_ARTIST					= 0x04,
227 	SF_STR_COMMENT					= 0x05,
228 	SF_STR_DATE						= 0x06,
229 	SF_STR_ALBUM					= 0x07,
230 	SF_STR_LICENSE					= 0x08,
231 	SF_STR_TRACKNUMBER				= 0x09,
232 	SF_STR_GENRE					= 0x10
233 }
234 
235 /*
236  ** Use the following as the start and end index when doing metadata
237  ** transcoding.
238  */
239 
240 alias	SF_STR_TITLE		SF_STR_FIRST;
241 alias	SF_STR_GENRE		SF_STR_LAST;
242 
243 enum
244 {	/* True and false */
245 	SF_FALSE	= 0,
246 	SF_TRUE		= 1,
247 
248 	/* Modes for opening files. */
249 	SFM_READ	= 0x10,
250 	SFM_WRITE	= 0x20,
251 	SFM_RDWR	= 0x30,
252 
253 	SF_AMBISONIC_NONE		= 0x40,
254 	SF_AMBISONIC_B_FORMAT	= 0x41
255 }
256 
257 /* Public error values. These are guaranteed to remain unchanged for the duration
258  ** of the library major version number.
259  ** There are also a large number of private error numbers which are internal to
260  ** the library which can change at any time.
261  */
262 
263 enum
264 {	SF_ERR_NO_ERROR				= 0,
265 	SF_ERR_UNRECOGNISED_FORMAT	= 1,
266 	SF_ERR_SYSTEM				= 2,
267 	SF_ERR_MALFORMED_FILE		= 3,
268 	SF_ERR_UNSUPPORTED_ENCODING	= 4
269 }
270 
271 
272 /* Channel map values (used with SFC_SET/GET_CHANNEL_MAP).
273  */
274 
275 enum
276 {	SF_CHANNEL_MAP_INVALID = 0,
277 	SF_CHANNEL_MAP_MONO = 1,
278 	SF_CHANNEL_MAP_LEFT,					/* Apple calls this 'Left' */
279 	SF_CHANNEL_MAP_RIGHT,					/* Apple calls this 'Right' */
280 	SF_CHANNEL_MAP_CENTER,					/* Apple calls this 'Center' */
281 	SF_CHANNEL_MAP_FRONT_LEFT,
282 	SF_CHANNEL_MAP_FRONT_RIGHT,
283 	SF_CHANNEL_MAP_FRONT_CENTER,
284 	SF_CHANNEL_MAP_REAR_CENTER,				/* Apple calls this 'Center Surround', Msft calls this 'Back Center' */
285 	SF_CHANNEL_MAP_REAR_LEFT,				/* Apple calls this 'Left Surround', Msft calls this 'Back Left' */
286 	SF_CHANNEL_MAP_REAR_RIGHT,				/* Apple calls this 'Right Surround', Msft calls this 'Back Right' */
287 	SF_CHANNEL_MAP_LFE,						/* Apple calls this 'LFEScreen', Msft calls this 'Low Frequency'  */
288 	SF_CHANNEL_MAP_FRONT_LEFT_OF_CENTER,	/* Apple calls this 'Left Center' */
289 	SF_CHANNEL_MAP_FRONT_RIGHT_OF_CENTER,	/* Apple calls this 'Right Center */
290 	SF_CHANNEL_MAP_SIDE_LEFT,				/* Apple calls this 'Left Surround Direct' */
291 	SF_CHANNEL_MAP_SIDE_RIGHT,				/* Apple calls this 'Right Surround Direct' */
292 	SF_CHANNEL_MAP_TOP_CENTER,				/* Apple calls this 'Top Center Surround' */
293 	SF_CHANNEL_MAP_TOP_FRONT_LEFT,			/* Apple calls this 'Vertical Height Left' */
294 	SF_CHANNEL_MAP_TOP_FRONT_RIGHT,			/* Apple calls this 'Vertical Height Right' */
295 	SF_CHANNEL_MAP_TOP_FRONT_CENTER,		/* Apple calls this 'Vertical Height Center' */
296 	SF_CHANNEL_MAP_TOP_REAR_LEFT,			/* Apple and MS call this 'Top Back Left' */
297 	SF_CHANNEL_MAP_TOP_REAR_RIGHT,			/* Apple and MS call this 'Top Back Right' */
298 	SF_CHANNEL_MAP_TOP_REAR_CENTER,			/* Apple and MS call this 'Top Back Center' */
299 
300 	SF_CHANNEL_MAP_AMBISONIC_B_W,
301 	SF_CHANNEL_MAP_AMBISONIC_B_X,
302 	SF_CHANNEL_MAP_AMBISONIC_B_Y,
303 	SF_CHANNEL_MAP_AMBISONIC_B_Z,
304 
305 	SF_CHANNEL_MAP_MAX
306 }
307 
308 
309 /* A SNDFILE* pointer can be passed around much like stdio.h's FILE* pointer. */
310 
311 struct SNDFILE_tag;
312 alias SNDFILE_tag* SNDFILE;
313 
314 /* The following typedef is system specific and is defined when libsndfile is
315  ** compiled. sf_count_t will be a 64 bit value when the underlying OS allows
316  ** 64 bit file offsets.
317  ** On windows, we need to allow the same header file to be compiler by both GCC
318  ** and the Microsoft compiler.
319  */
320 
321 alias long sf_count_t;
322 enum SF_COUNT_MAX = sf_count_t.max;
323 
324 /* A pointer to a SF_INFO structure is passed to sf_open () and filled in.
325  ** On write, the SF_INFO structure is filled in by the user and passed into
326  ** sf_open ().
327  */
328 
329 struct SF_INFO
330 {	sf_count_t	frames ;		/* Used to be called samples.  Changed to avoid confusion. */
331 	int			samplerate ;
332 	int			channels ;
333 	int			format ;
334 	int			sections ;
335 	int			seekable ;
336 }
337 
338 
339 /* The SF_FORMAT_INFO struct is used to retrieve information about the sound
340  ** file formats libsndfile supports using the sf_command () interface.
341  **
342  ** Using this interface will allow applications to support new file formats
343  ** and encoding types when libsndfile is upgraded, without requiring
344  ** re-compilation of the application.
345  **
346  ** Please consult the libsndfile documentation (particularly the information
347  ** on the sf_command () interface) for examples of its use.
348  */
349 
350 struct SF_FORMAT_INFO
351 {	int			format ;
352 	const char	*name ;
353 	const char	*extension ;
354 }
355 
356 /*
357  ** Enums and typedefs for adding dither on read and write.
358  ** See the html documentation for sf_command(), SFC_SET_DITHER_ON_WRITE
359  ** and SFC_SET_DITHER_ON_READ.
360  */
361 
362 enum
363 {	SFD_DEFAULT_LEVEL	= 0,
364 	SFD_CUSTOM_LEVEL	= 0x40000000,
365 
366 	SFD_NO_DITHER		= 500,
367 	SFD_WHITE			= 501,
368 	SFD_TRIANGULAR_PDF	= 502
369 }
370 
371 struct SF_DITHER_INFO
372 {	int			type ;
373 	double		level ;
374 	const char	*name ;
375 }
376 
377 /* Struct used to retrieve information about a file embedded within a
378  ** larger file. See SFC_GET_EMBED_FILE_INFO.
379  */
380 
381 struct SF_EMBED_FILE_INFO
382 {	sf_count_t	offset ;
383 	sf_count_t	length ;
384 }
385 
386 /*
387  **	Structs used to retrieve music sample information from a file.
388  */
389 
390 enum
391 {	/*
392 	**	The loop mode field in SF_INSTRUMENT will be one of the following.
393 	*/
394 	SF_LOOP_NONE = 800,
395 	SF_LOOP_FORWARD,
396 	SF_LOOP_BACKWARD,
397 	SF_LOOP_ALTERNATING
398 }
399 
400 struct SF_INSTRUMENT
401 {	int gain ;
402 	char basenote, detune ;
403 	char velocity_lo, velocity_hi ;
404 	char key_lo, key_hi ;
405 	int loop_count ;
406 
407 	struct loop_
408 	{	int mode ;
409 		uint start ;
410 		uint end ;
411 		uint count ;
412 	} /* make variable in a sensible way */
413 	loop_[16] loops;
414 }
415 
416 /* Struct used to retrieve loop information from a file.*/
417 struct SF_LOOP_INFO
418 {
419 	short	time_sig_num ;	/* any positive integer    > 0  */
420 	short	time_sig_den ;	/* any positive power of 2 > 0  */
421 	int		loop_mode ;		/* see SF_LOOP enum             */
422 
423 	int		num_beats ;		/* this is NOT the amount of quarter notes !!!*/
424 							/* a full bar of 4/4 is 4 beats */
425 							/* a full bar of 7/8 is 7 beats */
426 
427 	float	bpm ;			/* suggestion, as it can be calculated using other fields:*/
428 							/* file's lenght, file's sampleRate and our time_sig_den*/
429 							/* -> bpms are always the amount of _quarter notes_ per minute */
430 
431 	int	root_key ;			/* MIDI note, or -1 for None */
432 	int [6] future ;
433 }
434 
435 /*	Struct used to retrieve broadcast (EBU) information from a file.
436  **	Strongly (!) based on EBU "bext" chunk format used in Broadcast WAVE.
437  */
438 struct SF_BROADCAST_INFO_VAR(size_t coding_hist_size)
439 {	char [256]	description ;
440 	char [32]	originator ;
441 	char [32]	originator_reference ;
442 	char [10]	origination_date ;
443 	char [8]	origination_time ;
444 	uint			time_reference_low ;
445 	uint			time_reference_high ;
446 	short		version_ ;
447 	char [64]	umid ;
448 	char [190]	reserved ;
449 	uint					coding_history_size;
450 	char [coding_hist_size]	coding_history ;
451 }
452 
453 /* SF_BROADCAST_INFO is the above struct with coding_history field of 256 bytes. */
454 alias SF_BROADCAST_INFO_VAR!(256) SF_BROADCAST_INFO ;
455 
456 
457 /*	Virtual I/O functionality. */
458 alias sf_count_t function(void *user_data) sf_vio_get_filelen;
459 alias sf_count_t function(sf_count_t offset, int whence, void *user_data) sf_vio_seek;
460 alias sf_count_t function(void *ptr, sf_count_t count, void *user_data) sf_vio_read;
461 alias sf_count_t function(const void *ptr, sf_count_t count, void *user_data) sf_vio_write;
462 alias sf_count_t function(void *user_data) sf_vio_tell;
463 
464 struct SF_VIRTUAL_IO
465 {	sf_vio_get_filelen	get_filelen ;
466 	sf_vio_seek			seek ;
467 	sf_vio_read			read ;
468 	sf_vio_write		write ;
469 	sf_vio_tell			tell ;
470 }
471 
472 
473 /* Seek within the waveform data chunk of the SNDFILE. sf_seek () uses
474  ** the same values for whence (SEEK_SET, SEEK_CUR and SEEK_END) as
475  ** stdio.h function fseek ().
476  ** An offset of zero with whence set to SEEK_SET will position the
477  ** read / write pointer to the first data sample.
478  ** On success sf_seek returns the current position in (multi-channel)
479  ** samples from the start of the file.
480  ** Please see the libsndfile documentation for moving the read pointer
481  ** separately from the write pointer on files open in mode SFM_RDWR.
482  ** On error all of these functions return -1.
483  */
484 
485 enum
486 {	SF_SEEK_SET = SEEK_SET,
487 	SF_SEEK_CUR = SEEK_CUR,
488 	SF_SEEK_END = SEEK_END
489 }
490 
491 extern(C) @nogc nothrow {
492 	alias da_sf_open = SNDFILE* function(const char *path, int mode, SF_INFO *sfinfo);
493 	alias da_sf_open_fd = SNDFILE* function(int fd, int mode, SF_INFO *sfinfo, int close_desc);
494 	alias da_sf_open_virtual = SNDFILE* function(SF_VIRTUAL_IO *sfvirtual, int mode, SF_INFO *sfinfo, void *user_data);
495 	alias da_sf_error = int function(SNDFILE *sndfile);
496 	alias da_sf_strerror = const(char)* function(SNDFILE *sndfile);
497 	alias da_sf_error_number = const(char)* function(int errnum);
498 	alias da_sf_perror = int function(SNDFILE *sndfile);
499 	alias da_sf_error_str = int function(SNDFILE *sndfile, char* str, size_t len);
500 	alias da_sf_command = int function(SNDFILE *sndfile, int command, void *data, int datasize);
501 	alias da_sf_format_check = int function(const SF_INFO *info);
502 	alias da_sf_seek = sf_count_t function(SNDFILE *sndfile, sf_count_t frames, int whence);
503 	alias da_sf_set_string = int function(SNDFILE *sndfile, int str_type, const char* str);
504 	alias da_sf_get_string = const(char)* function(SNDFILE *sndfile, int str_type);
505 	alias da_sf_version_string = const(char)* function();
506 	alias da_sf_read_raw = sf_count_t function(SNDFILE *sndfile, void *ptr, sf_count_t bytes);
507 	alias da_sf_write_raw = sf_count_t function(SNDFILE *sndfile, const void *ptr, sf_count_t bytes);
508 	alias da_sf_readf_short = sf_count_t function(SNDFILE *sndfile, short *ptr, sf_count_t frames);
509 	alias da_sf_writef_short = sf_count_t function(SNDFILE *sndfile, const short *ptr, sf_count_t frames);
510 	alias da_sf_readf_int = sf_count_t function(SNDFILE *sndfile, int *ptr, sf_count_t frames);
511 	alias da_sf_writef_int = sf_count_t function(SNDFILE *sndfile, const int *ptr, sf_count_t frames);
512 	alias da_sf_readf_float = sf_count_t function(SNDFILE *sndfile, float *ptr, sf_count_t frames);
513 	alias da_sf_writef_float = sf_count_t function(SNDFILE *sndfile, const float *ptr, sf_count_t frames);
514 	alias da_sf_readf_double = sf_count_t function(SNDFILE *sndfile, double *ptr, sf_count_t frames);
515 	alias da_sf_writef_double = sf_count_t function(SNDFILE *sndfile, const double *ptr, sf_count_t frames);
516 	alias da_sf_read_short = sf_count_t function(SNDFILE *sndfile, short *ptr, sf_count_t items);
517 	alias da_sf_write_short = sf_count_t function(SNDFILE *sndfile, const short *ptr, sf_count_t items);
518 	alias da_sf_read_int = sf_count_t function(SNDFILE *sndfile, int *ptr, sf_count_t items);
519 	alias da_sf_write_int = sf_count_t function(SNDFILE *sndfile, const int *ptr, sf_count_t items);
520 	alias da_sf_read_float = sf_count_t function(SNDFILE *sndfile, float *ptr, sf_count_t items);
521 	alias da_sf_write_float = sf_count_t function(SNDFILE *sndfile, const float *ptr, sf_count_t items);
522 	alias da_sf_read_double = sf_count_t function(SNDFILE *sndfile, double *ptr, sf_count_t items);
523 	alias da_sf_write_double = sf_count_t function(SNDFILE *sndfile, const double *ptr, sf_count_t items);
524 	alias da_sf_close = int function(SNDFILE *sndfile);
525 	alias da_sf_write_sync = void function(SNDFILE *sndfile);
526 	alias da_sf_wchar_open = SNDFILE* function(wchar* wpath, int mode, SF_INFO *sfinfo);
527 }