TABLE OF CONTENTS

sndfile.library/--background--
sndfile.library/SF_GetLibVersion
sndfile.library/SF_OpenRead
sndfile.library/SF_OpenWrite
sndfile.library/SF_Close
sndfile.library/SF_ReadRaw
sndfile.library/SF_WriteRaw
sndfile.library/SF_ReadChar
sndfile.library/SF_WriteChar
sndfile.library/SF_ReadShort
sndfile.library/SF_WriteShort
sndfile.library/SF_ReadInt
sndfile.library/SF_WriteInt
sndfile.library/SF_ReadDouble
sndfile.library/SF_WriteDouble
sndfile.library/SF_ReadFChar
sndfile.library/SF_WriteFChar
sndfile.library/SF_ReadFShort
sndfile.library/SF_WriteFShort
sndfile.library/SF_ReadFInt
sndfile.library/SF_WriteFInt
sndfile.library/SF_ReadFDouble
sndfile.library/SF_WriteFDouble
sndfile.library/SF_Seek
sndfile.library/SF_FormatCheck
sndfile.library/SF_SignalMax
sndfile.library/SF_GetHeaderInfo
sndfile.library/SF_ErrorStr
sndfile.library/--background--

PURPOSE

	This shared library is derived from from Erik de Castro Lopo's excellent
	libsndfile link library.

	Libsndfile is a library designed to allow the reading and writing of many
	different sampled sound file formats (such as MS Windows WAV and the Apple/SGI
	AIFF format) through one standard library interface.


CAPABILITIES

	Libsndfile is currently capable of reading and writing the following sound file formats:

	o Microsoft WAV 8, 16, 24 and 32 bit integer PCM.
	o Microsoft 32 bit floating point PCM.
	o Microsoft IMA/DVI ADPCM WAV format (16 bits per sample compressed to 4 bits per sample).
	o Microsoft ADPCM WAV format (16 bits per sample compressed to 4 bits per sample).
	o Microsoft 8 bit A-law an u-law formats (16 bits per sample compressed to 8 bits per sample).
	o Microsoft WAV files using GSM 6.10 encoding.
	o Apple/SGI AIFF and AIFC uncompressed 8, 16, 24 and 32 bit integer PCM.
	o Sun/NeXT AU/SND format (big endian 8, 16, 24 and 32 bit PCM, 8 bit u-law and 8 bit A-law).
	o Dec AU format (little endian 8, 16, 24 and 32 bit PCM, 8 bit u-law and 8 bit A-law).
	o RAW header-less PCM files of 8 (signed and unsigned), 16, 24 and 32 bits. The 16, 24 and 32
		bit files may be big or little endian byte ordering.
	o Amiga uncompressed IFF / 8SVX / 16SV PCM files (8 and 16 bit).
	o Ensoniq PARIS big and little endian, 16 and 24 bit PCM files (.PAF).


	More information can be obtained here:  http://www.zip.com.au/~erikd/libsndfile/


SYNOPSIS

	The functions of sndfile.library are almost identical to those of
	libsndfile with the following exceptions:

		o Different capitalization (f.ex. sf_readf_int() == SF_ReadFInt()).
		o There's no SF_PError() (because of the way libraries work), see
		  example in SF_ErrorStr() doc on how to emulate this.
		o SF_SignalMax() returns a pointer to double instead of double.

	Any libsndfile program can be made to use sndfile.library by linking with
	one of the included linklibs that are appropriate to your compiler/options.

	The functions of libsndfile are defined as follows:


		SNDFILE*  sf_open_read       (const char *path, SF_INFO *sfinfo) ;
		SNDFILE*  sf_open_write      (const char *path, const SF_INFO *sfinfo) ;

		int       sf_perror          (SNDFILE *sndfile) ;
		int       sf_error_str       (SNDFILE *sndfile, char* str, size_t len) ;
		int       sf_error_number    (int errnum, char* str, size_t len) ;

		size_t    sf_get_header_info (SNDFILE *sndfile, char* buffer, size_t bufferlen, size_t offset) ;
		size_t    sf_get_lib_version (char* buffer, size_t bufferlen) ;

		int       sf_format_check    (const SF_INFO *info) ;
		double    sf_signal_max      (SNDFILE *sndfile) ;

		off_t     sf_seek            (SNDFILE *sndfile, off_t frames, int whence) ;

		size_t    sf_read_raw        (SNDFILE *sndfile, void *ptr, size_t bytes) ;
		size_t    sf_write_raw       (SNDFILE *sndfile, void *ptr, size_t bytes) ;

		size_t    sf_read_short      (SNDFILE *sndfile, short *ptr, size_t items) ;
		size_t    sf_read_int        (SNDFILE *sndfile, int *ptr, size_t items) ;
		size_t    sf_read_double     (SNDFILE *sndfile, double *ptr, size_t items, int normalize) ;

		size_t    sf_readf_short     (SNDFILE *sndfile, short *ptr, size_t frames) ;
		size_t    sf_readf_int       (SNDFILE *sndfile, int *ptr, size_t frames) ;
		size_t    sf_readf_double    (SNDFILE *sndfile, double *ptr, size_t frames, int normalize) ;

		size_t    sf_write_short     (SNDFILE *sndfile, short *ptr, size_t items) ;
		size_t    sf_write_int       (SNDFILE *sndfile, int *ptr, size_t items) ;
		size_t    sf_write_double    (SNDFILE *sndfile, double *ptr, size_t items, int normalize) ;

		size_t    sf_writef_short    (SNDFILE *sndfile, short *ptr, size_t frames) ;
		size_t    sf_writef_int      (SNDFILE *sndfile, int *ptr, size_t frames) ;
		size_t    sf_writef_double   (SNDFILE *sndfile, double *ptr, size_t frames, int normalize) ;

		int       sf_close           (SNDFILE *sndfile) ;


	SNDFILE* is an anonymous pointer to data which is private to the library.


	The SF_INFO structure is for passing data between the calling function and
	the library	when opening a file for read or writing. It is defined in
	sndfile.h as follows:

		typedef struct
		{	int      samplerate ;
			int      samples ;
			int      channels ;
			int      pcmbitwidth ;
			int      format ;
			int      sections ;
			int      seekable ;
		} SF_INFO ;

	The format field in the above structure is made up of the bit-wise OR of a
	major format type with a value of 0x10000 or greater and a minor format
	type with a value less than 0x10000. The currently understood formats are
	listed in sndfile.h as follows and also includes two bitmasks for
	separating major and minor file types.

	Not all combinations of major and minor file types are valid. 

		enum
		{	SF_FORMAT_WAV       = 0x10000,  /* Microsoft WAV format (big endian). */
			SF_FORMAT_AIFF      = 0x20000,  /* Apple/SGI AIFF format (little endian). */
			SF_FORMAT_AU        = 0x30000,  /* Sun/NeXT AU format (big endian). */
			SF_FORMAT_AULE      = 0x40000,  /* DEC AU format (little endian). */
			SF_FORMAT_RAW       = 0x50000,  /* RAW PCM data. */
			SF_FORMAT_PAF       = 0x60000,  /* Ensoniq PARIS file format. */
			SF_FORMAT_SVX       = 0x70000,  /* Amiga IFF / SVX8 / SV16 format. */
			SF_FORMAT_NIST      = 0x80000,  /* Sphere NIST format. */

			SF_FORMAT_PCM       = 0x0001,   /* PCM data in 8, 16, 24 or 32 bits. */
			SF_FORMAT_FLOAT     = 0x0002,   /* 32 bit floats. */
			SF_FORMAT_ULAW      = 0x0003,   /* U-Law encoded. */
			SF_FORMAT_ALAW      = 0x0004,   /* A-Law encoded. */
			SF_FORMAT_IMA_ADPCM = 0x0005,   /* IMA ADPCM. */
			SF_FORMAT_MS_ADPCM  = 0x0006,   /* Microsoft ADPCM. */

			SF_FORMAT_PCM_BE    = 0x0007,   /* Big endian PCM data. */
			SF_FORMAT_PCM_LE    = 0x0008,   /* Little endian PCM data. */
			SF_FORMAT_PCM_S8    = 0x0009,   /* Signed 8 bit PCM. */
			SF_FORMAT_PCM_U8    = 0x000A,   /* Unsigned 8 bit PCM. */

			SF_FORMAT_PCM_BE    = 0x0007,   /* RAW PCM (big endian). */
			SF_FORMAT_PCM_LE    = 0x0008,   /* RAW PCM (little endian). */
			SF_FORMAT_RAW_S8    = 0x0009,   /* Signed 8 bit RAW PCM. */
			SF_FORMAT_RAW_U8    = 0x000A,   /* Unsigned 8 bit RAW PCM. */

			SF_FORMAT_SVX_FIB   = 0x000B,   /* SVX Fibonacci Delta encoding. */
			SF_FORMAT_SVX_EXP   = 0x000C,   /* SVX Exponential Delta encoding. */

			SF_FORMAT_GSM610    = 0x000D,   /* GSM 6.10 encoding. */

			SF_FORMAT_G721_32   = 0x000E,   /* 32kbs G721 ADPCM encoding. */
			SF_FORMAT_G723_24   = 0x000F,   /* 24kbs G723 ADPCM encoding. */

			SF_FORMAT_SUBMASK   = 0xFFFF,
			SF_FORMAT_TYPEMASK  = 0x7FFF0000
		} ;


sndfile.library/SF_GetLibVersion             sndfile.library/SF_GetLibVersion

   NAME
	SF_GetLibVersion - Get the library version string.

   SYNOPSIS
	length = SF_GetLibVersion(buffer, bufferlen)
	                          A0      D0

	size_t SF_GetLibVersion(char *, size_t);

   FUNCTION
	Fill in the provided buffer with the library version string.

   NOTE

   EXAMPLE
		size_t len;
		char buf[256];

		len = SF_GetLibVersion(buf, sizeof(buf));
		printf("Length: %d  String: %s\n", len, buf);

   INPUTS
	buffer - pointer to a buffer that the version string will be put in.
	bufferlen - maximum length of version string (size of buffer).

   RESULT
	length - length of actual string returned.

   SEE ALSO


sndfile.library/SF_OpenRead                       sndfile.library/SF_OpenRead

   NAME
	SF_OpenRead - Open the specified file for read.

   SYNOPSIS
	sfptr = SF_OpenRead(path, wfinfo)
	                    A0    A1

	SNDFILE* SF_OpenRead(const char *, SF_INFO *);

   FUNCTION
	Open the specified file for read and fill in SF_INFO structure.

   NOTE
	When RAW files are opened, the SF_INFO structure will be used to determine
	bitwidth etc, so always fill in some defaults...

   EXAMPLE
		SNDFILE *sfptr;
		SF_INFO wfinfo;

		wfinfo.seekable		= TRUE;
		wfinfo.samplerate	= 44100;
		wfinfo.pcmbitwidth	= 16;
		wfinfo.channels		= 2;
		wfinfo.format		= SF_FORMAT_RAW_BE;
		sfptr = SF_OpenRead("Work:Test.aiff", &wfinfo);

   INPUTS
	path - full path to inputfile.
	wfinfo - pointer to SF_INFO structure.

   RESULT
	sfptr - pointer to use in all subsequent sndfile-operations on file.
	NULL on error.

   SEE ALSO
	SF_OpenWrite()


sndfile.library/SF_OpenWrite                     sndfile.library/SF_OpenWrite

   NAME
	SF_OpenWrite - Open the specified file for write.

   SYNOPSIS
	sfptr = SF_OpenWrite(path, wfinfo)
	                     A0    A1

	SNDFILE* SF_OpenWrite(const char *, const SF_INFO *);

   FUNCTION
	Open the specified file for write using the SF_INFO structure.

   NOTE
	For encoded formats (ie u-law, A-law and ADPCM), pcmbitwidth is the bit
	width before encoding or after decoding.

   EXAMPLE
		SNDFILE *sfptr;
		SF_INFO wfinfo;

		wfinfo.samplerate	= 44100;
		wfinfo.pcmbitwidth	= 16;
		wfinfo.channels		= 2;
		wfinfo.format		= SF_FORMAT_AIFF | SF_FORMAT_PCM;
		sfptr = SF_OpenWrite("RAM:Test.aiff", &wfinfo);

   INPUTS
	path - full path to outputfile.
	wfinfo - pointer to SF_INFO structure.

   RESULT
	sfptr - pointer to use in all subsequent sndfile-operations on file.
	NULL on error.

   SEE ALSO
	SF_OpenRead()


sndfile.library/SF_Close                             sndfile.library/SF_Close

   NAME
	SF_Close - Close a previously opened file.

   SYNOPSIS
	success = SF_Close(sndfile)
	                   A0

	int SF_Close(SNDFILE *);

   FUNCTION
	Close a previously opened file.

   NOTE

   EXAMPLE

   INPUTS
	sndfile - previously allocated SNDFILE pointer.

   RESULT
	success - 0 for success or an error value.

   SEE ALSO
	SF_OpenRead(), SF_OpenWrite()


sndfile.library/SF_ReadRaw                         sndfile.library/SF_ReadRaw

   NAME
	SF_ReadRaw - Read raw data from file.

   SYNOPSIS
	length = SF_ReadRaw(sndfile, ptr, bytes)
	                    A0       A1   D0

	size_t SF_ReadRaw(SNDFILE *, void *, size_t);

   FUNCTION
	Read raw data (don't expect this to be audio) from file. The number of
	bytes read must always be an integer multiple of the number of channels
	multiplied by the number of bytes required to represent one	sample from
	one channel.

   NOTE

   EXAMPLE

   INPUTS
	sndfile - previously allocated SNDFILE pointer.
	ptr - pointer to a buffer that the data will be put in.
	bytes - number of bytes to read (size of buffer).

   RESULT
	length - number of bytes read or -1 if an error occurred.

   SEE ALSO
	SF_WriteRaw()


sndfile.library/SF_WriteRaw                       sndfile.library/SF_WriteRaw

   NAME
	SF_WriteRaw - Write raw data to file.

   SYNOPSIS
	length = SF_WriteRaw(sndfile, ptr, bytes)
	                     A0       A1   D0

	size_t SF_WriteRaw(SNDFILE *, void *, size_t);

   FUNCTION
	Write raw data to file. The number of bytes written must always be an
	integer multiple of the number of channels multiplied by the number of
	bytes required to represent one sample from one channel.

   NOTE

   EXAMPLE

   INPUTS
	sndfile - previously allocated SNDFILE pointer.
	ptr - pointer to a buffer that contains the data to be written.
	bytes - number of bytes to write (size of buffer).

   RESULT
	length - number of bytes read or -1 if an error occurred.

   SEE ALSO
	SF_ReadRaw()


sndfile.library/SF_ReadChar                       sndfile.library/SF_ReadChar

   NAME
	SF_ReadChar - Not implemented yet.

   SEE ALSO
	SF_WriteChar(), SF_ReadFChar(), SF_WriteFChar()


sndfile.library/SF_WriteChar                     sndfile.library/SF_WriteChar

   NAME
	SF_WriteChar - Not implemented yet.

   SEE ALSO
	SF_ReadChar(), SF_ReadFChar(), SF_WriteFChar()


sndfile.library/SF_ReadShort                     sndfile.library/SF_ReadShort

   NAME
	SF_ReadShort - Read audio data from file.

   SYNOPSIS
	length = SF_ReadShort(sndfile, ptr, items)
	                      A0       A1   D0

	size_t SF_ReadShort(SNDFILE *, short *, size_t);

   FUNCTION
	Reads audio data and fills buffer with signed 16bit values.

   NOTE
	The items parameter must be an integer product of the number of channels
	or an error will occur.

   EXAMPLE

   INPUTS
	sndfile - previously allocated SNDFILE pointer.
	ptr - pointer to a signed short array that the data will be put in.
	items - number of items to read (size of buffer (in 16bit)).

   RESULT
	length - number of items read or -1 if an error occurred.

   BUGS
	Version 1 of the library does not return values from files with another
	bitwidth correctly, this will be fixed in version 2.

	In the meantime I suggest a kludge (see sfplay.c)...

   SEE ALSO
	SF_WriteShort(), SF_ReadFShort(), SF_WriteFShort()


sndfile.library/SF_WriteShort                   sndfile.library/SF_WriteShort

   NAME
	SF_WriteShort - Write audio data to file.

   SYNOPSIS
	length = SF_WriteShort(sndfile, ptr, items)
	                       A0       A1   D0

	size_t SF_WriteShort(SNDFILE *, short *, size_t);

   FUNCTION
	Writes audio data to file from buffer with signed 16bit values.

   NOTE

   EXAMPLE

   INPUTS
	sndfile - previously allocated SNDFILE pointer.
	ptr - pointer to a signed short array that contains the data to be written.
	items - number of items to write (size of buffer (in 16bit)).

   RESULT
	length - number of items written or -1 if an error occurred.

   SEE ALSO
	SF_ReadShort(), SF_ReadFShort(), SF_WriteFShort()


sndfile.library/SF_ReadInt                         sndfile.library/SF_ReadInt

   NAME
	SF_ReadInt - Read audio data from file.

   SYNOPSIS
	length = SF_ReadInt(sndfile, ptr, items)
	                    A0       A1   D0

	size_t SF_ReadInt(SNDFILE *, int *, size_t);

   FUNCTION
	Reads audio data and fills buffer with signed 32bit values.

   NOTE
	The items parameter must be an integer product of the number of channels
	or an error will occur.

   EXAMPLE

   INPUTS
	sndfile - previously allocated SNDFILE pointer.
	ptr - pointer to a signed int array that the data will be put in.
	items - number of items to read (size of buffer (in 32bit)).

   RESULT
	length - number of items read or -1 if an error occurred.

   BUGS
	Version 1 of the library does not return values from files with another
	bitwidth correctly, this will be fixed in version 2.

   SEE ALSO
	SF_WriteInt(), SF_ReadFInt(), SF_WriteFInt()


sndfile.library/SF_WriteInt                       sndfile.library/SF_WriteInt

   NAME
	SF_WriteInt - Write audio data to file.

   SYNOPSIS
	length = SF_WriteInt(sndfile, ptr, items)
	                     A0       A1   D0

	size_t SF_WriteInt(SNDFILE *, int *, size_t);

   FUNCTION
	Writes audio data to file from buffer with signed 32bit values.

   NOTE

   EXAMPLE

   INPUTS
	sndfile - previously allocated SNDFILE pointer.
	ptr - pointer to a signed int array that contains the data to be written.
	items - number of items to write (size of buffer (in 32bit)).

   RESULT
	length - number of items written or -1 if an error occurred.

   SEE ALSO
	SF_ReadInt(), SF_ReadFInt(), SF_WriteFInt()


sndfile.library/SF_ReadDouble                   sndfile.library/SF_ReadDouble

   NAME
	SF_ReadDouble - Read audio data from file.

   SYNOPSIS
	length = SF_ReadDouble(sndfile, ptr, items, normalize)
	                       A0       A1   D0     D1

	size_t SF_ReadDouble(SNDFILE *, double *, size_t, int);

   FUNCTION
	Reads audio data and fills buffer with 64bit float values.

	If normalize is 1, the read operation will return data that is normalized
	so that the maximum possible full scale sample value of the file on disk
	will result in a sample value of 1.0 in the array, with all other sample
	values scaled accordingly.

   NOTE
	The items parameter must be an integer product of the number of channels
	or an error will occur.

   EXAMPLE

   INPUTS
	sndfile - previously allocated SNDFILE pointer.
	ptr - pointer to a double array that the data will be put in.
	items - number of items to read (size of buffer (in 64bit)).
	normalize - boolean to select normalization.

   RESULT
	length - number of items read or -1 if an error occurred.

   BUGS
	Version 1 of the library does not return values from files with another
	bitwidth correctly, this will be fixed in version 2.

   SEE ALSO
	SF_WriteDouble(), SF_ReadFDouble(), SF_WriteFDouble()


sndfile.library/SF_WriteDouble                 sndfile.library/SF_WriteDouble

   NAME
	SF_WriteDouble - Write audio data to file.

   SYNOPSIS
	length = SF_WriteDouble(sndfile, ptr, items, normalize)
	                        A0       A1   D0      D1

	size_t SF_WriteDouble(SNDFILE *, double *, size_t, int);

   FUNCTION
	Writes audio data to file from buffer with 64bit float values.

	If normalize is 1, the write operation will assume that data in the array
	is normalize so that all values are between -1 and 1 and will scale the
	samples to fill the bitwidth of the disk file format. If normalize is
	zero, no scaling will take place and the samples will be truncated and
	written to disk as integers of 8, 16, 24 or 32 bits.

   NOTE

   EXAMPLE

   INPUTS
	sndfile - previously allocated SNDFILE pointer.
	ptr - pointer to a double array that contains the data to be written.
	items - number of items to write (size of buffer (in 64bit)).
	normalize - boolean to select normalization.

   RESULT
	length - number of items written or -1 if an error occurred.

   SEE ALSO
	SF_ReadDouble(), SF_ReadFDouble(), SF_WriteFDouble()


sndfile.library/SF_ReadFChar                     sndfile.library/SF_ReadFChar

   NAME
	SF_ReadFChar - Not implemented yet.

   SEE ALSO
	SF_WriteFChar(), SF_ReadChar(), SF_WriteChar()


sndfile.library/SF_WriteFChar                   sndfile.library/SF_WriteFChar

   NAME
	SF_WriteFChar - Not implemented yet.

   SEE ALSO
	SF_ReadFChar(), SF_ReadChar(), SF_WriteChar()


sndfile.library/SF_ReadFShort                   sndfile.library/SF_ReadFShort

   NAME
	SF_ReadFShort - Read audio data from file.

   SYNOPSIS
	length = SF_ReadFShort(sndfile, ptr, frames)
	                       A0       A1   D0

	size_t SF_ReadFShort(SNDFILE *, short *, size_t);

   FUNCTION
	Reads audio data and fills buffer with signed 16bit values.

   NOTE
	The array must be large enough to hold the product of frames and the
	number of channels.

   EXAMPLE

   INPUTS
	sndfile - previously allocated SNDFILE pointer.
	ptr - pointer to a signed short array that the data will be put in.
	frames - number of frames to read (size of buffer (in 16bit) / channels).

   RESULT
	length - number of frames read or -1 if an error occurred.

   BUGS
	Version 1 of the library does not return values from files with another
	bitwidth correctly, this will be fixed in version 2.

   SEE ALSO
	SF_WriteFShort(), SF_ReadShort(), SF_WriteShort()


sndfile.library/SF_WriteFShort                 sndfile.library/SF_WriteFShort

   NAME
	SF_WriteFShort - Write audio data to file.

   SYNOPSIS
	length = SF_WriteFShort(sndfile, ptr, frames)
	                        A0       A1   D0

	size_t SF_WriteFShort(SNDFILE *, short *, size_t);

   FUNCTION
	Writes audio data to file from buffer with signed 16bit values.

   NOTE

   EXAMPLE

   INPUTS
	sndfile - previously allocated SNDFILE pointer.
	ptr - pointer to a signed short array that contains the data to be written.
	frames - number of frames to write (size of buffer (in 16bit) / channels).

   RESULT
	length - number of frames written or -1 if an error occurred.

   SEE ALSO
	SF_ReadFShort(), SF_ReadShort(), SF_WriteShort()


sndfile.library/SF_ReadFInt                       sndfile.library/SF_ReadFInt

   NAME
	SF_ReadFInt - Read audio data from file.

   SYNOPSIS
	length = SF_ReadFInt(sndfile, ptr, frames)
	                     A0       A1   D0

	size_t SF_ReadFInt(SNDFILE *, int *, size_t);

   FUNCTION
	Reads audio data and fills buffer with signed 32bit values.

   NOTE
	The array must be large enough to hold the product of frames and the
	number of channels.

   EXAMPLE

   INPUTS
	sndfile - previously allocated SNDFILE pointer.
	ptr - pointer to a signed int array that the data will be put in.
	frames - number of frames to read (size of buffer (in 32bit) / channels).

   RESULT
	length - number of frames read or -1 if an error occurred.

   BUGS
	Version 1 of the library does not return values from files with another
	bitwidth correctly, this will be fixed in version 2.

   SEE ALSO
	SF_WriteFInt(), SF_ReadInt(), SF_WriteInt()


sndfile.library/SF_WriteFInt                     sndfile.library/SF_WriteFInt

   NAME
	SF_WriteFInt - Write audio data to file.

   SYNOPSIS
	length = SF_WriteFInt(sndfile, ptr, frames)
	                      A0       A1   D0

	size_t SF_WriteFInt(SNDFILE *, int *, size_t);

   FUNCTION
	Writes audio data to file from buffer with signed 32bit values.

   NOTE

   EXAMPLE

   INPUTS
	sndfile - previously allocated SNDFILE pointer.
	ptr - pointer to a signed int array that contains the data to be written.
	frames - number of frames to write (size of buffer (in 32bit) / channels).

   RESULT
	length - number of frames written or -1 if an error occurred.

   SEE ALSO
	SF_ReadFInt(), SF_ReadInt(), SF_WriteInt()


sndfile.library/SF_ReadFDouble                 sndfile.library/SF_ReadFDouble

   NAME
	SF_ReadFDouble - Read audio data from file.

   SYNOPSIS
	length = SF_ReadFDouble(sndfile, ptr, frames, normalize)
	                        A0       A1   D0      D1

	size_t SF_ReadFDouble(SNDFILE *, double *, size_t, int);

   FUNCTION
	Reads audio data and fills buffer with 64bit float values.

	If normalize is 1, the read operation will return data that is normalized
	so that the maximum possible full scale sample value of the file on disk
	will result in a sample value of 1.0 in the array, with all other sample
	values scaled accordingly.

   NOTE
	The array must be large enough to hold the product of frames and the
	number of channels.

   EXAMPLE

   INPUTS
	sndfile - previously allocated SNDFILE pointer.
	ptr - pointer to a double array that the data will be put in.
	frames - number of frames to read (size of buffer (in 64bit) / channels).
	normalize - boolean to select normalization.

   RESULT
	length - number of frames read or -1 if an error occurred.

   BUGS
	Version 1 of the library does not return values from files with another
	bitwidth correctly, this will be fixed in version 2.

   SEE ALSO
	SF_WriteFDouble(), SF_ReadDouble(), SF_WriteDouble()


sndfile.library/SF_WriteFDouble               sndfile.library/SF_WriteFDouble

   NAME
	SF_WriteFDouble - Write audio data to file.

   SYNOPSIS
	length = SF_WriteFDouble(sndfile, ptr, frames, normalize)
	                         A0       A1   D0      D1

	size_t SF_WriteFDouble(SNDFILE *, double *, size_t, int);

   FUNCTION
	Writes audio data to file from buffer with 64bit float values.

	If normalize is 1, the write operation will assume that data in the array
	is normalize so that all values are between -1 and 1 and will scale the
	samples to fill the bitwidth of the disk file format. If normalize is
	zero, no scaling will take place and the samples will be truncated and
	written to disk as integers of 8, 16, 24 or 32 bits.

   NOTE

   EXAMPLE

   INPUTS
	sndfile - previously allocated SNDFILE pointer.
	ptr - pointer to a double array that contains the data to be written.
	frames - number of frames to write (size of buffer (in 64bit) / channels).
	normalize - boolean to select normalization.

   RESULT
	length - number of frames written or -1 if an error occurred.

   SEE ALSO
	SF_ReadFDouble(), SF_ReadDouble(), SF_WriteDouble()


sndfile.library/SF_Seek                               sndfile.library/SF_Seek

   NAME
	SF_Seek - Seek within the waveform data of file.

   SYNOPSIS
	offset = SF_Seek(sndfile, frames, whence)
	                 A0       D0      D1

	off_t SF_Seek(SNDFILE *, off_t, int);

   FUNCTION
	The file seek functions work much like lseek in stdio.h with the exception
	that the non-audio data is ignored and the seek only moves within the audio
	data section of the file. In addition, seeks are defined in number of
	(multichannel) samples or frames. Therefore, for a seek in a stereo file
	from the current position forward with an offset of 1 would skip forward by
	one sample of both channels.

	Valid values for the whence parameter are defined to be the same as the
	lseek function and behave as follows:

		SEEK_SET - The offset is set to the start of the audio data plus offset (multichannel) samples.
		SEEK_CUR - The offset is set to its current location plus offset (multichannel) samples.
		SEEK_END - The offset is set to the end of the data plus offset (multichannel) samples.

   NOTE
	Frames offset can be negative and in fact should be when SEEK_END is used
	for the whence parameter.

   EXAMPLE

   INPUTS
	sndfile - previously allocated SNDFILE pointer.
	frames - number of audio frames to seek.
	whence - position to seek from.

   RESULT
	offset - offset in (multichannel) samples from the start of the audio data
	         or -1 if an error occurred (f.ex. seeking past file limits).

   SEE ALSO


sndfile.library/SF_FormatCheck                 sndfile.library/SF_FormatCheck

   NAME
	SF_FormatCheck - Check if SF_INFO structure is valid.

   SYNOPSIS
	valid = SF_FormatCheck(info)
	                       A0

	int SF_FormatCheck(const SF_INFO *);

   FUNCTION
	Check if combination of values in SF_INFO structure field are valid.

   NOTE

   EXAMPLE

   INPUTS
	info - pointer to a filled in SF_INFO structure.

   RESULT
	valid - TRUE if valid.

   SEE ALSO


sndfile.library/SF_SignalMax                     sndfile.library/SF_SignalMax

   NAME
	SF_SignalMax - Scan file for maximum absolute sample value.

   SYNOPSIS
	maxval = SF_SignalMax(sndfile)
	                      A0

	double* SF_SignalMax(SNDFILE *);

   FUNCTION
	Scan file for maximum absolute sample value.

   NOTE

   EXAMPLE

   INPUTS
	sndfile - previously allocated SNDFILE pointer.

   RESULT
	maxval - maximum absolute sample value.

   SEE ALSO


sndfile.library/SF_GetHeaderInfo             sndfile.library/SF_GetHeaderInfo

   NAME
	SF_GetHeaderInfo - Get info on file.

   SYNOPSIS
	length = SF_GetHeaderInfo(sndfile, buffer, bufferlen, offset)
	                          A0       A1      D0         D1

	size_t SF_GetHeaderInfo(SNDFILE *, char *, size_t, size_t);

   FUNCTION
	Fill in the provided buffer with info on the audio file.

   NOTE

   EXAMPLE
		len = SF_GetHeaderInfo(sndfile, buf, sizeof(buf), 0);

   INPUTS
	sndfile - previously allocated SNDFILE pointer.
	buffer - pointer to a buffer that the version string will be put in.
	bufferlen - maximum length of version string (size of buffer).
	offset - offset in info to copy from

   RESULT
	length - length of actual string returned.

   SEE ALSO


sndfile.library/SF_ErrorStr                       sndfile.library/SF_ErrorStr

   NAME
	SF_ErrorStr - Get current error-message.

   SYNOPSIS
	error = SF_ErrorStr(sndfile, buffer, bufferlen)
	                    A0       A1      D0

	int SF_ErrorStr(SNDFILE *, char *, size_t);

   FUNCTION
	Fill in the provided buffer with current error-message.

   NOTE

   EXAMPLE
	int	sf_perror(SNDFILE *sndfile)
	{
		int ret;
		char str[256];

		ret = SF_ErrorStr(sndfile, str, sizeof(str));
		printf("%s\n", str);
		return ret;
	}

   INPUTS
	sndfile - previously allocated SNDFILE pointer.
	buffer - pointer to a buffer that the error-message will be put in.
	bufferlen - maximum length of error-message (size of buffer).

   RESULT
	error - SFE_NO_ERROR if everything went well.

   SEE ALSO
	SF_ErrorNumber()


sndfile.library/SF_ErrorNumber                 sndfile.library/SF_ErrorNumber

   NAME
	SF_ErrorNumber - Get error-message related to number.

   SYNOPSIS
	error = SF_ErrorNumber(errnum, buffer, bufferlen)
	                       D1       A1      D0

	int SF_ErrorStr(int, char *, size_t);

   FUNCTION
	Fill in the provided buffer with error-message related to number.

   NOTE

   EXAMPLE

   INPUTS
	errnum - error number.
	buffer - pointer to a buffer that the error-message will be put in.
	bufferlen - maximum length of error-message (size of buffer).

   RESULT
	error - SFE_NO_ERROR if everything went well.

   SEE ALSO
	SF_ErrorStr()


