#ifndef	V_WAVLIB_H
#define V_WAVLIB_H

#ifndef	mmioFOURCC
#define	mmioFOURCC(c0,c1,c2,c3) \
		(((u32_t)((u8_t)(c0))) | (((u32_t)((u8_t)(c1))) << 8) | \
		(((u32_t)((u8_t)(c2))) << 16) | (((u32_t)((u8_t)(c3))) << 24))
#endif	/* !mmioFOURCC */

#ifndef	mmioFOURCS
#define	mmioFOURCS(str)	mmioFOURCC((str)[0],(str)[1],(str)[2],(str)[3])
#endif	/* !mmioFOURCS */

#ifdef	__cplusplus
extern "C" {
#endif	/* __cplusplus */
	/*	Opens WAV file for input. Returns wave handle of NULL on error. */
	vhandle_t V_GLOBAL	wavOpenRead(char *name);
	/*	Starts writing of wav file. Returned handle must be later */
	vhandle_t V_GLOBAL	wavOpenWrite(char *name,
		u32_t num_channels,u32_t sampling_frequency,u32_t bits_per_sample);
	/*	Loads entire file, stores data memAlloc()'ed buffer.
	 *	Optionally stores audio parameters to *XXX_ret's.
	 */
	void_p	V_GLOBAL	wavLoadFile(char *name, u32_t *nsamples_ret,
		u32_t *nchannels_ret,u32_t *freq_ret,u32_t *bps_ret);
	/*	Helper functions. ============================================= */
	u32_t	V_GLOBAL	wavNumChannels(vhandle_t handle);
	u32_t	V_GLOBAL	wavSamplingFrequency(vhandle_t handle);
	u32_t	V_GLOBAL	wavBitsPerSample(vhandle_t handle);
	u32_t	V_GLOBAL	wavNumSamples(vhandle_t handle);
#ifdef	CONFIG_AUDIO_MP3
	/*
	 *	Opens MPEG-3 audio file for input.
	 *	To get decompressed data, call fileRead().
	 */
	file_t V_GLOBAL	mp3Open(char *name);
#endif	/* CONFIG_AUDIO_MP3 */

#ifdef	__cplusplus
}
#endif	/* __cplusplus */

#endif	/* V_WAVLIB_H */
