Specifying Audio Files
175
csAudioSamples has the following fields:
void setFileName(const csString& fileName);
void setNumFrames(csInt numFrames);
void setSampleRate(csFloat sampleRate);
void setSampleSize(csInt sampleSize);
void setSampleType(SampleTypeEnum sampleType);
void setNumChannels(csInt numChannels);
void setSampleScale(csFloat scale);
void setLoadStatus(LoadStatusEnum loadStatus);
LoadStatusEnum getLoadStatus();
csMFByte* samples() const;
These set() fields have corresponding get() fields. Table 15-2 describes how these fields
are used.
Table 15-2 Fields of csSoundSamples
Field Description
setFileName Attaches the csAudioSample node to a specific sound source file.
setNumFrames Is the equivalent to the sampling rate of the sound sample, for example,
44 KHz.
setSampleRate Specifies the sampling rate of the sound sample.
setSampleSize Specifies the size of the source sound files.
setSampleType Specifies the format of the sampling rate. Valid values include
UNSIGNED_INT_SAMPLE_TYPE or FLOAT_SAMPLE_TYPE.
setNumChannels Specifies the number of channels for each sound, for example, stereo has
two channels, quad sound has four channels.
setSampleScale Scales the overall volume of the sound sample. If if sound sample was
recorded to loud or soft compared to other sound samples, you can scale
the volume of the sound file so that its volume matches that of the other
sound files.
setLoadStatus Returns the status of whether or not the sound file loaded; valid values
include LOAD_NEEDED, LOAD_FAILED, LOAD_PENDING, and
LOAD_COMPLETE.
samples Returns the multivalued array field that contains the actual audio
samples.