#ifndef _OTI_LIBAUDIO_H
#define	_OTI_LIBAUDIO_H

#ifdef __cplusplus
extern "C" {
#endif

/*  
 * The following set of routines replace the standard "Device
 * Control Routines" of libaudio. For the Osprey-1x00 product
 * line, these calls must be used. Internally, if the file
 * descriptor does not refer to an Osprey Device, the standard
 * libaudio call will be made. Otherwise, the call will be handled
 * in an Osprey specific way. Refer to the Osprey-1x00 documentation
 * for further information.
 */
  
extern int   oti_audio_getinfo(int fildes, Audio_info*);
extern int   oti_audio_setinfo(int fildes, Audio_info*);
extern int   oti_audio__setplayhdr(int fildes, Audio_hdr*, unsigned);
extern int   oti_audio__setval(int fildes, unsigned*, unsigned);
extern int   oti_audio__setgain(int fildes, double*, unsigned);
extern int   oti_audio__setpause(int fildes, unsigned);
extern int   oti_audio__flush(int fildes, unsigned int);
extern int   oti_audio_drain(int fildes, int);
extern int   oti_audio_play_eof(int fildes);

/*
 * The following set of routines replace the standard system
 * call routines. For the Osprey-1x00 product line, these
 * calls must be used. Internally, if the file descriptor does
 * not refer to an Osprey Device, the standard system call will
 * be made. Otherwise, the call will be handled in an Osprey
 * specific way. Refer to the Osprey-1x00 documentation for
 * further information.
 */

extern int     oti_open(const char *path, int oflag);
extern int     oti_close(int fildes);
extern ssize_t oti_read(int fildes, void *buf, size_t nbyte);
extern ssize_t oti_write(int fildes, const void *buf, size_t nbyte);
extern int     oti_ioctl(int fildes, int request, void *val);
extern int     oti_fcntl(int fildes, int cmd, void *val);

/*
 * The following routine should be called before once before 
 * any other oti_libaudio calls. It is typically called with
 * two NULL parameters.
 */
extern int oti_audio_init(char* vcp_ucode_desired, char* dsp_ucode_desired);

extern int oti_audio_write_filehdr(int fd, Audio_hdr* hp, char* infop, unsigned ilen);
extern int oti_audio_isaudiofile(char* name);
extern int oti_audio_read_filehdr(int fd, Audio_hdr* hp, char* infop, unsigned ilen);

/*
 * Define the possible encoding types.
 */
#define	AUDIO_ENCODING_G728	      (728)	
#define	AUDIO_FILE_ENCODING_G728  (728)	

#ifdef __cplusplus
}
#endif

#endif 
