SoundHeader class public functions

SoundHeader
~SoundHeader
getBitsPerSample
getBytesPerSample
getBlockAlign
getChannels
getComment
getCommentSize
getDataByteOffset
getDataByteSize
getInputType
getNextFormat
getOutputType
getSamples
getSrate
operator=
setChannels
setComment
setHeader
setHighMono
setHighStereo
setNextFormat
setOutputType
setSamples
setSrate
print

SoundHeader(void);
Sets output to DEFAULT_FORMAT, mono, 44100 srate, 0 samples, 16 bits per sample.
SoundHeader(char* aFilename);
Read the soundfile to set the soundfile header data. The output format of the object will be the same as the soundfile being read.
SoundHeader(SoundHeader& aHeader);
Copies all of the objects data.

~SoundHeader();
Frees comment string allocation space.

int getBitsPerSample(void) const;
Returns the number of bits in each sound sample.

int getBlockAlign(void) const;
Returns the number of bytes in each sound sample for all channels.

int getBytesPerSample(void) const;
Returns the number of bytes in each sound sample.

int getChannels(void) cosnt;
Returns the number of channels. 1=mono, 2=stero, etc.

const char* getComment(void) const;
Returns the header comment.

int getCommentSize(void) const;
Returns the length of the comment string.

int getDataByteOffset(int format = NONE_FORMAT) const;
Return the starting point of the sound data in a soundfile after the header.

int getDataByteSize(void) const;
Returns the size of the soundfile's data in bytes.

int getInputType(void) const;
Return the type of file which was read in order to set up the header data inside the object.

int getNextFormat(void) const;
Return the NeXT/Sun soundfile format

int getOutputType(void) const;
Returns the output format that will be used when using the operator<<.

int getSamples(void) const;
Returns the number of samples in the header. The sample count is the number of samples in a single channel for the duration of the soundfile.

int getSrate(void) const;
Returns the sampling rate in the header.

SoundHeader& operator=(const SoundHeader& h);
Allows copying headers with the operator=.

void setChannels(int numChannels);
Sets the number of channels in the header.

void setComment(const char* aString);
Sets the soundfile comment. Not used for Wave soundfiles.

void setHeader(char *filename);
Read header data from the specified soundfile.

void setHighMono(char* comment = "");
Sets the header to sampling rate 44100, 1 channel, 16 bits per sample.

void setHighStereo(char* comment = "");
Sets the header to sampling rate 44100, 2 channels, 16 bits per sample.

void setNextFormat(int format = SND_FORMAT_LINEAR_16);
Sets the NeXT/Sun format type.

int setOutputType(int format = DEFAULT_FORMAT);
Sets the output format for use with operator<<.

void setSamples(int numSamples);
Sets the number of samples in the sound header. Samples for multiple channels are grouped together as one unit of sample.

void setSrate(int aSrate);
Sets the sampling rate of the header.

void print(void);
Print the header contents to standart error.

Another related function

ostream& operator<<(ostream& output, SoundHeader& aSoundHeader);
Outputs the header according to the output format of the header which can be:
Next/Sun soundfile SND_FORMAT (1)
Wave soundfile WAV_FORMAT (2)
Text TXT_FORMAT (3)