#ifndef AUFILE_H #define AUFILE_H #include using namespace std; //============================================================ // File Name: sound.h // Date: February 15, 2007 Programmer: Pluf // // Function Descriptions: // Functions will read audio data from an .au file and // play PCM samples using the speaker. // // Assumptions: // Must have a speaker, must have audio library installed // /usr/X11R6/lib/libaudio.a //============================================================ //==readAuFile================================================= // pre: fileName is a string that contains an .au file name, // samples[] is a short array with maxSize elements // post: samples[] will contain numSamples elements of PCM // audio from fileName //============================================================= bool readAuFile(string fileName, short samples[], int maxSize, int& numSamples); //==playPCMsamples============================================= // pre: samples[] is a short array containing numSamples // elements of PCM audio // post: samples[] elements are sent to the speaker //============================================================= void playPCMsamples(short samples[], int numSamples); #endif