//#include <signal.h>
//#include <termcap.h>
//#include <sys/soundcard.h>

#include <linux/types.h>
#include <unistd.h>

#define TRUE	1
#define FALSE	0

typedef struct {
	int32_t	   srate;
	int16_t	   chans;
	int16_t	   depth;
	int32_t	   bps;
	int16_t	   blkalign;
	int32_t	   len;
	int32_t	   sofar;
	int	      handle;
   const char *name; /* You are responsible for this pointer */
	char   	   head[44];
} wav_sig;

/* byteme
   buffmem_desc	binfo;
   count_info	cinfo;
   int 	dsp_fd;
   int 	*buffer;
*/

// defined in wav_read.c
int16_t get_wav_format		(wav_sig *info);
int 	open_wav		(char *header, const char *file_name);
int	init_wav_read		(const char *file_name, wav_sig *info);
int     fin_wav_read            (wav_sig *info);

// defined in wav_write.c
int	fin_wav_write		(wav_sig *info);
int     init_wav_write          (const char *file_name, int32_t sps, int16_t bps, int16_t channels,  wav_sig *info);
void	init_head		(wav_sig *info);

/* byteme
int 	init_parm		(int argc, char *argv[], wav_sig *file_info);

int bsize;
*/

// defined by wav_mux.c
unsigned int demuxSingle(wav_sig *from, int8_t * to, unsigned long bsize, int channelNum );
unsigned int demux(wav_sig *from, int8_t ** to, unsigned long bsize);
unsigned int mux(wav_sig *to, int8_t ** from, unsigned long bsize);
