]> git.sesse.net Git - casparcg/blob - SFML-1.6/extlibs/headers/sndfile.h
(no commit message)
[casparcg] / SFML-1.6 / extlibs / headers / sndfile.h
1 /*
2 ** Copyright (C) 1999-2006 Erik de Castro Lopo <erikd@mega-nerd.com>
3 **
4 ** This program is free software; you can redistribute it and/or modify
5 ** it under the terms of the GNU Lesser General Public License as published by
6 ** the Free Software Foundation; either version 2.1 of the License, or
7 ** (at your option) any later version.
8 **
9 ** This program is distributed in the hope that it will be useful,
10 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
11 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12 ** GNU Lesser General Public License for more details.
13 **
14 ** You should have received a copy of the GNU Lesser General Public License
15 ** along with this program; if not, write to the Free Software
16 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 */
18
19 /*
20 ** sndfile.h -- system-wide definitions
21 **
22 ** API documentation is in the doc/ directory of the source code tarball
23 ** and at http://www.mega-nerd.com/libsndfile/api.html.
24 */
25
26 #ifndef SNDFILE_H
27 #define SNDFILE_H
28
29 /* This is the version 1.0.X header file. */
30 #define SNDFILE_1
31
32 #include <stdio.h>
33 #ifdef __APPLE__
34     #include <stdint.h>
35 #endif
36
37 /* For the Metrowerks CodeWarrior Pro Compiler (mainly MacOS) */
38
39 #if     (defined (__MWERKS__))
40 #include        <unix.h>
41 #else
42 #include        <sys/types.h>
43 #endif
44
45 #ifdef __cplusplus
46 extern "C" {
47 #endif  /* __cplusplus */
48
49 /* The following file types can be read and written.
50 ** A file type would consist of a major type (ie SF_FORMAT_WAV) bitwise
51 ** ORed with a minor type (ie SF_FORMAT_PCM). SF_FORMAT_TYPEMASK and
52 ** SF_FORMAT_SUBMASK can be used to separate the major and minor file
53 ** types.
54 */
55
56 enum
57 {       /* Major formats. */
58         SF_FORMAT_WAV                   = 0x010000,             /* Microsoft WAV format (little endian default). */
59         SF_FORMAT_AIFF                  = 0x020000,             /* Apple/SGI AIFF format (big endian). */
60         SF_FORMAT_AU                    = 0x030000,             /* Sun/NeXT AU format (big endian). */
61         SF_FORMAT_RAW                   = 0x040000,             /* RAW PCM data. */
62         SF_FORMAT_PAF                   = 0x050000,             /* Ensoniq PARIS file format. */
63         SF_FORMAT_SVX                   = 0x060000,             /* Amiga IFF / SVX8 / SV16 format. */
64         SF_FORMAT_NIST                  = 0x070000,             /* Sphere NIST format. */
65         SF_FORMAT_VOC                   = 0x080000,             /* VOC files. */
66         SF_FORMAT_IRCAM                 = 0x0A0000,             /* Berkeley/IRCAM/CARL */
67         SF_FORMAT_W64                   = 0x0B0000,             /* Sonic Foundry's 64 bit RIFF/WAV */
68         SF_FORMAT_MAT4                  = 0x0C0000,             /* Matlab (tm) V4.2 / GNU Octave 2.0 */
69         SF_FORMAT_MAT5                  = 0x0D0000,             /* Matlab (tm) V5.0 / GNU Octave 2.1 */
70         SF_FORMAT_PVF                   = 0x0E0000,             /* Portable Voice Format */
71         SF_FORMAT_XI                    = 0x0F0000,             /* Fasttracker 2 Extended Instrument */
72         SF_FORMAT_HTK                   = 0x100000,             /* HMM Tool Kit format */
73         SF_FORMAT_SDS                   = 0x110000,             /* Midi Sample Dump Standard */
74         SF_FORMAT_AVR                   = 0x120000,             /* Audio Visual Research */
75         SF_FORMAT_WAVEX                 = 0x130000,             /* MS WAVE with WAVEFORMATEX */
76         SF_FORMAT_SD2                   = 0x160000,             /* Sound Designer 2 */
77         SF_FORMAT_FLAC                  = 0x170000,             /* FLAC lossless file format */
78         SF_FORMAT_CAF                   = 0x180000,             /* Core Audio File format */
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         /* Endian-ness options. */
113
114         SF_ENDIAN_FILE                  = 0x00000000,   /* Default file endian-ness. */
115         SF_ENDIAN_LITTLE                = 0x10000000,   /* Force little endian-ness. */
116         SF_ENDIAN_BIG                   = 0x20000000,   /* Force big endian-ness. */
117         SF_ENDIAN_CPU                   = 0x30000000,   /* Force CPU endian-ness. */
118
119         SF_FORMAT_SUBMASK               = 0x0000FFFF,
120         SF_FORMAT_TYPEMASK              = 0x0FFF0000,
121         SF_FORMAT_ENDMASK               = 0x30000000
122 } ;
123
124 /*
125 ** The following are the valid command numbers for the sf_command()
126 ** interface.  The use of these commands is documented in the file
127 ** command.html in the doc directory of the source code distribution.
128 */
129
130 enum
131 {       SFC_GET_LIB_VERSION                             = 0x1000,
132         SFC_GET_LOG_INFO                                = 0x1001,
133
134         SFC_GET_NORM_DOUBLE                             = 0x1010,
135         SFC_GET_NORM_FLOAT                              = 0x1011,
136         SFC_SET_NORM_DOUBLE                             = 0x1012,
137         SFC_SET_NORM_FLOAT                              = 0x1013,
138         SFC_SET_SCALE_FLOAT_INT_READ    = 0x1014,
139
140         SFC_GET_SIMPLE_FORMAT_COUNT             = 0x1020,
141         SFC_GET_SIMPLE_FORMAT                   = 0x1021,
142
143         SFC_GET_FORMAT_INFO                             = 0x1028,
144
145         SFC_GET_FORMAT_MAJOR_COUNT              = 0x1030,
146         SFC_GET_FORMAT_MAJOR                    = 0x1031,
147         SFC_GET_FORMAT_SUBTYPE_COUNT    = 0x1032,
148         SFC_GET_FORMAT_SUBTYPE                  = 0x1033,
149
150         SFC_CALC_SIGNAL_MAX                             = 0x1040,
151         SFC_CALC_NORM_SIGNAL_MAX                = 0x1041,
152         SFC_CALC_MAX_ALL_CHANNELS               = 0x1042,
153         SFC_CALC_NORM_MAX_ALL_CHANNELS  = 0x1043,
154         SFC_GET_SIGNAL_MAX                              = 0x1044,
155         SFC_GET_MAX_ALL_CHANNELS                = 0x1045,
156
157         SFC_SET_ADD_PEAK_CHUNK                  = 0x1050,
158
159         SFC_UPDATE_HEADER_NOW                   = 0x1060,
160         SFC_SET_UPDATE_HEADER_AUTO              = 0x1061,
161
162         SFC_FILE_TRUNCATE                               = 0x1080,
163
164         SFC_SET_RAW_START_OFFSET                = 0x1090,
165
166         SFC_SET_DITHER_ON_WRITE                 = 0x10A0,
167         SFC_SET_DITHER_ON_READ                  = 0x10A1,
168
169         SFC_GET_DITHER_INFO_COUNT               = 0x10A2,
170         SFC_GET_DITHER_INFO                             = 0x10A3,
171
172         SFC_GET_EMBED_FILE_INFO                 = 0x10B0,
173
174         SFC_SET_CLIPPING                                = 0x10C0,
175         SFC_GET_CLIPPING                                = 0x10C1,
176
177         SFC_GET_INSTRUMENT                              = 0x10D0,
178         SFC_SET_INSTRUMENT                              = 0x10D1,
179
180         SFC_GET_LOOP_INFO                               = 0x10E0,
181
182         SFC_GET_BROADCAST_INFO                  = 0x10F0,
183         SFC_SET_BROADCAST_INFO                  = 0x10F1,
184
185         /* Following commands for testing only. */
186         SFC_TEST_IEEE_FLOAT_REPLACE             = 0x6001,
187
188         /*
189         ** SFC_SET_ADD_* values are deprecated and will disappear at some
190         ** time in the future. They are guaranteed to be here up to and
191         ** including version 1.0.8 to avoid breakage of existng software.
192         ** They currently do nothing and will continue to do nothing.
193         */
194         SFC_SET_ADD_DITHER_ON_WRITE             = 0x1070,
195         SFC_SET_ADD_DITHER_ON_READ              = 0x1071
196 } ;
197
198
199 /*
200 ** String types that can be set and read from files. Not all file types
201 ** support this and even the file types which support one, may not support
202 ** all string types.
203 */
204
205 enum
206 {       SF_STR_TITLE                                    = 0x01,
207         SF_STR_COPYRIGHT                                = 0x02,
208         SF_STR_SOFTWARE                                 = 0x03,
209         SF_STR_ARTIST                                   = 0x04,
210         SF_STR_COMMENT                                  = 0x05,
211         SF_STR_DATE                                             = 0x06
212 } ;
213
214 /*
215 ** Use the following as the start and end index when doing metadata
216 ** transcoding.
217 */
218
219 #define SF_STR_FIRST    SF_STR_TITLE
220 #define SF_STR_LAST             SF_STR_DATE
221
222 enum
223 {       /* True and false */
224         SF_FALSE        = 0,
225         SF_TRUE         = 1,
226
227         /* Modes for opening files. */
228         SFM_READ        = 0x10,
229         SFM_WRITE       = 0x20,
230         SFM_RDWR        = 0x30
231 } ;
232
233 /* Public error values. These are guaranteed to remain unchanged for the duration
234 ** of the library major version number.
235 ** There are also a large number of private error numbers which are internal to
236 ** the library which can change at any time.
237 */
238
239 enum
240 {       SF_ERR_NO_ERROR                         = 0,
241         SF_ERR_UNRECOGNISED_FORMAT      = 1,
242         SF_ERR_SYSTEM                           = 2,
243         SF_ERR_MALFORMED_FILE           = 3,
244         SF_ERR_UNSUPPORTED_ENCODING     = 4
245 } ;
246
247 /* A SNDFILE* pointer can be passed around much like stdio.h's FILE* pointer. */
248
249 typedef struct SNDFILE_tag      SNDFILE ;
250
251 /* The following typedef is system specific and is defined when libsndfile is.
252 ** compiled. sf_count_t can be one of loff_t (Linux), off_t (*BSD),
253 ** off64_t (Solaris), __int64_t (Win32) etc.
254 */
255
256 #ifdef __APPLE__
257 typedef int64_t sf_count_t ;
258 #else
259 typedef __int64 sf_count_t ;
260 #endif
261
262 #define SF_COUNT_MAX            0x7FFFFFFFFFFFFFFFLL
263
264 /* A pointer to a SF_INFO structure is passed to sf_open_read () and filled in.
265 ** On write, the SF_INFO structure is filled in by the user and passed into
266 ** sf_open_write ().
267 */
268
269 struct SF_INFO
270 {       sf_count_t      frames ;                /* Used to be called samples.  Changed to avoid confusion. */
271         int                     samplerate ;
272         int                     channels ;
273         int                     format ;
274         int                     sections ;
275         int                     seekable ;
276 } ;
277
278 typedef struct SF_INFO SF_INFO ;
279
280 /* The SF_FORMAT_INFO struct is used to retrieve information about the sound
281 ** file formats libsndfile supports using the sf_command () interface.
282 **
283 ** Using this interface will allow applications to support new file formats
284 ** and encoding types when libsndfile is upgraded, without requiring
285 ** re-compilation of the application.
286 **
287 ** Please consult the libsndfile documentation (particularly the information
288 ** on the sf_command () interface) for examples of its use.
289 */
290
291 typedef struct
292 {       int                     format ;
293         const char      *name ;
294         const char      *extension ;
295 } SF_FORMAT_INFO ;
296
297 /*
298 ** Enums and typedefs for adding dither on read and write.
299 ** See the html documentation for sf_command(), SFC_SET_DITHER_ON_WRITE
300 ** and SFC_SET_DITHER_ON_READ.
301 */
302
303 enum
304 {       SFD_DEFAULT_LEVEL       = 0,
305         SFD_CUSTOM_LEVEL        = 0x40000000,
306
307         SFD_NO_DITHER           = 500,
308         SFD_WHITE                       = 501,
309         SFD_TRIANGULAR_PDF      = 502
310 } ;
311
312 typedef struct
313 {       int                     type ;
314         double          level ;
315         const char      *name ;
316 } SF_DITHER_INFO ;
317
318 /* Struct used to retrieve information about a file embedded within a
319 ** larger file. See SFC_GET_EMBED_FILE_INFO.
320 */
321
322 typedef struct
323 {       sf_count_t      offset ;
324         sf_count_t      length ;
325 } SF_EMBED_FILE_INFO ;
326
327 /*
328 **      Structs used to retrieve music sample information from a file.
329 */
330
331 enum
332 {       /*
333         **      The loop mode field in SF_INSTRUMENT will be one of the following.
334         */
335         SF_LOOP_NONE = 800,
336         SF_LOOP_FORWARD,
337         SF_LOOP_BACKWARD,
338         SF_LOOP_ALTERNATING
339 } ;
340
341 typedef struct
342 {       int gain ;
343         char basenote, detune ;
344         char velocity_lo, velocity_hi ;
345         char key_lo, key_hi ;
346         int loop_count ;
347
348         struct
349         {       int mode ;
350                 unsigned int start ;
351                 unsigned int end ;
352                 unsigned int count ;
353         } loops [16] ; /* make variable in a sensible way */
354 } SF_INSTRUMENT ;
355
356
357
358 /* Struct used to retrieve loop information from a file.*/
359 typedef struct
360 {
361         short   time_sig_num ;  /* any positive integer    > 0  */
362         short   time_sig_den ;  /* any positive power of 2 > 0  */
363         int             loop_mode ;             /* see SF_LOOP enum             */
364
365         int             num_beats ;             /* this is NOT the amount of quarter notes !!!*/
366                                                         /* a full bar of 4/4 is 4 beats */
367                                                         /* a full bar of 7/8 is 7 beats */
368
369         float   bpm ;                   /* suggestion, as it can be calculated using other fields:*/
370                                                         /* file's lenght, file's sampleRate and our time_sig_den*/
371                                                         /* -> bpms are always the amount of _quarter notes_ per minute */
372
373         int     root_key ;                      /* MIDI note, or -1 for None */
374         int future [6] ;
375 } SF_LOOP_INFO ;
376
377
378 /*      Struct used to retrieve broadcast (EBU) information from a file. 
379 **      Strongly (!) based on EBU "bext" chunk format used in Broadcast WAVE.
380 */
381 typedef struct
382 {       char                    description [256] ;
383         char                    originator [32] ;
384         char                    originator_reference [32] ;
385         char                    origination_date [10] ;
386         char                    origination_time [8] ;
387         int                             time_reference_low ;
388         int                             time_reference_high ;
389         short                   version ;
390         char                    umid [64] ;
391         char                    reserved [190] ;
392         unsigned int    coding_history_size ;
393         char                    coding_history [256] ;
394 } SF_BROADCAST_INFO ;
395
396 typedef sf_count_t              (*sf_vio_get_filelen)   (void *user_data) ;
397 typedef sf_count_t              (*sf_vio_seek)          (sf_count_t offset, int whence, void *user_data) ;
398 typedef sf_count_t              (*sf_vio_read)          (void *ptr, sf_count_t count, void *user_data) ;
399 typedef sf_count_t              (*sf_vio_write)         (const void *ptr, sf_count_t count, void *user_data) ;
400 typedef sf_count_t              (*sf_vio_tell)          (void *user_data) ;
401
402 struct SF_VIRTUAL_IO
403 {       sf_vio_get_filelen      get_filelen ;
404         sf_vio_seek                     seek ;
405         sf_vio_read                     read ;
406         sf_vio_write            write ;
407         sf_vio_tell                     tell ;
408 } ;
409
410 typedef struct SF_VIRTUAL_IO SF_VIRTUAL_IO ;
411
412 /* Open the specified file for read, write or both. On error, this will
413 ** return a NULL pointer. To find the error number, pass a NULL SNDFILE
414 ** to sf_perror () or sf_error_str ().
415 ** All calls to sf_open() should be matched with a call to sf_close().
416 */
417
418 SNDFILE*        sf_open         (const char *path, int mode, SF_INFO *sfinfo) ;
419
420 /* Use the existing file descriptor to create a SNDFILE object. If close_desc
421 ** is TRUE, the file descriptor will be closed when sf_close() is called. If
422 ** it is FALSE, the descritor will not be closed.
423 ** When passed a descriptor like this, the library will assume that the start
424 ** of file header is at the current file offset. This allows sound files within
425 ** larger container files to be read and/or written.
426 ** On error, this will return a NULL pointer. To find the error number, pass a
427 ** NULL SNDFILE to sf_perror () or sf_error_str ().
428 ** All calls to sf_open_fd() should be matched with a call to sf_close().
429
430 */
431
432 SNDFILE*        sf_open_fd      (int fd, int mode, SF_INFO *sfinfo, int close_desc) ;
433
434 SNDFILE*        sf_open_virtual (SF_VIRTUAL_IO *sfvirtual, int mode, SF_INFO *sfinfo, void *user_data) ;
435
436 /* sf_error () returns a error number which can be translated to a text
437 ** string using sf_error_number().
438 */
439
440 int             sf_error                (SNDFILE *sndfile) ;
441
442 /* sf_strerror () returns to the caller a pointer to the current error message for
443 ** the given SNDFILE.
444 */
445
446 const char* sf_strerror (SNDFILE *sndfile) ;
447
448 /* sf_error_number () allows the retrieval of the error string for each internal
449 ** error number.
450 **
451 */
452
453 const char*     sf_error_number (int errnum) ;
454
455 /* The following three error functions are deprecated but they will remain in the
456 ** library for the forseeable future. The function sf_strerror() should be used
457 ** in their place.
458 */
459
460 int             sf_perror               (SNDFILE *sndfile) ;
461 int             sf_error_str    (SNDFILE *sndfile, char* str, size_t len) ;
462
463
464 /* Return TRUE if fields of the SF_INFO struct are a valid combination of values. */
465
466 int             sf_command      (SNDFILE *sndfile, int command, void *data, int datasize) ;
467
468 /* Return TRUE if fields of the SF_INFO struct are a valid combination of values. */
469
470 int             sf_format_check (const SF_INFO *info) ;
471
472 /* Seek within the waveform data chunk of the SNDFILE. sf_seek () uses
473 ** the same values for whence (SEEK_SET, SEEK_CUR and SEEK_END) as
474 ** stdio.h function fseek ().
475 ** An offset of zero with whence set to SEEK_SET will position the
476 ** read / write pointer to the first data sample.
477 ** On success sf_seek returns the current position in (multi-channel)
478 ** samples from the start of the file.
479 ** Please see the libsndfile documentation for moving the read pointer
480 ** separately from the write pointer on files open in mode SFM_RDWR.
481 ** On error all of these functions return -1.
482 */
483
484 sf_count_t      sf_seek                 (SNDFILE *sndfile, sf_count_t frames, int whence) ;
485
486 /* Functions for retrieving and setting string data within sound files.
487 ** Not all file types support this features; AIFF and WAV do. For both
488 ** functions, the str_type parameter must be one of the SF_STR_* values
489 ** defined above.
490 ** On error, sf_set_string() returns non-zero while sf_get_string()
491 ** returns NULL.
492 */
493
494 int sf_set_string (SNDFILE *sndfile, int str_type, const char* str) ;
495
496 const char* sf_get_string (SNDFILE *sndfile, int str_type) ;
497
498 /* Functions for reading/writing the waveform data of a sound file.
499 */
500
501 sf_count_t      sf_read_raw             (SNDFILE *sndfile, void *ptr, sf_count_t bytes) ;
502 sf_count_t      sf_write_raw    (SNDFILE *sndfile, const void *ptr, sf_count_t bytes) ;
503
504 /* Functions for reading and writing the data chunk in terms of frames.
505 ** The number of items actually read/written = frames * number of channels.
506 **     sf_xxxx_raw              read/writes the raw data bytes from/to the file
507 **     sf_xxxx_short    passes data in the native short format
508 **     sf_xxxx_int              passes data in the native int format
509 **     sf_xxxx_float    passes data in the native float format
510 **     sf_xxxx_double   passes data in the native double format
511 ** All of these read/write function return number of frames read/written.
512 */
513
514 sf_count_t      sf_readf_short  (SNDFILE *sndfile, short *ptr, sf_count_t frames) ;
515 sf_count_t      sf_writef_short (SNDFILE *sndfile, const short *ptr, sf_count_t frames) ;
516
517 sf_count_t      sf_readf_int    (SNDFILE *sndfile, int *ptr, sf_count_t frames) ;
518 sf_count_t      sf_writef_int   (SNDFILE *sndfile, const int *ptr, sf_count_t frames) ;
519
520 sf_count_t      sf_readf_float  (SNDFILE *sndfile, float *ptr, sf_count_t frames) ;
521 sf_count_t      sf_writef_float (SNDFILE *sndfile, const float *ptr, sf_count_t frames) ;
522
523 sf_count_t      sf_readf_double         (SNDFILE *sndfile, double *ptr, sf_count_t frames) ;
524 sf_count_t      sf_writef_double        (SNDFILE *sndfile, const double *ptr, sf_count_t frames) ;
525
526 /* Functions for reading and writing the data chunk in terms of items.
527 ** Otherwise similar to above.
528 ** All of these read/write function return number of items read/written.
529 */
530
531 sf_count_t      sf_read_short   (SNDFILE *sndfile, short *ptr, sf_count_t items) ;
532 sf_count_t      sf_write_short  (SNDFILE *sndfile, const short *ptr, sf_count_t items) ;
533
534 sf_count_t      sf_read_int             (SNDFILE *sndfile, int *ptr, sf_count_t items) ;
535 sf_count_t      sf_write_int    (SNDFILE *sndfile, const int *ptr, sf_count_t items) ;
536
537 sf_count_t      sf_read_float   (SNDFILE *sndfile, float *ptr, sf_count_t items) ;
538 sf_count_t      sf_write_float  (SNDFILE *sndfile, const float *ptr, sf_count_t items) ;
539
540 sf_count_t      sf_read_double  (SNDFILE *sndfile, double *ptr, sf_count_t items) ;
541 sf_count_t      sf_write_double (SNDFILE *sndfile, const double *ptr, sf_count_t items) ;
542
543 /* Close the SNDFILE and clean up all memory allocations associated with this
544 ** file.
545 ** Returns 0 on success, or an error number.
546 */
547
548 int             sf_close                (SNDFILE *sndfile) ;
549
550 /* If the file is opened SFM_WRITE or SFM_RDWR, call fsync() on the file
551 ** to force the writing of data to disk. If the file is opened SFM_READ
552 ** no action is taken.
553 */
554
555 void    sf_write_sync   (SNDFILE *sndfile) ;
556
557 #ifdef __cplusplus
558 }               /* extern "C" */
559 #endif  /* __cplusplus */
560
561 #endif  /* SNDFILE_H */