#ifndef LIBRARIES_SNDFILE_H
#define LIBRARIES_SNDFILE_H

#ifndef SNDFILE_H

/* The following file types can be read and written.
** A file type would consist of a major type (ie SF_FORMAT_WAV) bitwise
** ORed with a minor type (ie SF_FORMAT_PCM). SF_FORMAT_TYPEMASK and
** SF_FORMAT_SUBMASK can be used to separate the major and minor file
** types.
*/

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_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
} ;

#define	SF_FORMAT_RAW_BE	SF_FORMAT_PCM_BE
#define	SF_FORMAT_RAW_LE	SF_FORMAT_PCM_LE
#define	SF_FORMAT_RAW_S8	SF_FORMAT_PCM_S8
#define	SF_FORMAT_RAW_U8	SF_FORMAT_PCM_U8

/* A SNDFILE* pointer can be passed around much like stdio.h's FILE* pointer. */

typedef	void	SNDFILE ;

/* A pointer to a SF_INFO structure is passed to SF_OpenRead() and filled in. 
** On write, the SF_INFO structure is filled in by the user and passed into  
** SF_OpenWrite().
*/

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


#endif	/* SNDFILE_H */
#endif	/* LIBRARIES_SNDFILE_H */
