A SERVICE OF

logo

Specifying Audio Files
175
csAudioSamples has the following elds:
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() elds have corresponding get() elds. Table 15-2 describes how these elds
are used.
Table 15-2 Fields of csSoundSamples
Field Description
setFileName Attaches the csAudioSample node to a specic sound source le.
setNumFrames Is the equivalent to the sampling rate of the sound sample, for example,
44 KHz.
setSampleRate Species the sampling rate of the sound sample.
setSampleSize Species the size of the source sound les.
setSampleType Species the format of the sampling rate. Valid values include
UNSIGNED_INT_SAMPLE_TYPE or FLOAT_SAMPLE_TYPE.
setNumChannels Species 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 le so that its volume matches that of the other
sound les.
setLoadStatus Returns the status of whether or not the sound le loaded; valid values
include LOAD_NEEDED, LOAD_FAILED, LOAD_PENDING, and
LOAD_COMPLETE.
samples Returns the multivalued array eld that contains the actual audio
samples.