Sound::Load
Defined in: C4Sound.h
Loads a sound resource into a Sound object.
Prototype
SoundResult Load(const char *name);
Parameters
name |
The name of the sound resource.
|
Description
The Load function loads the sound resource specified by the name parameter into memory. The WAV resource must be stored in uncompressed 16-bit PCM WAV format (mono or stereo). Otherwise, the result code kSoundFormatInvalid is be returned.
A sound resource loaded into memory with the Load function must contain fewer than 221 frames of audio data. For a mono sound, this means that the audio data must be smaller than 4 MB in size, and for a stereo sound, the audio data must be smaller than 8 MB in size. If this limit is exceeded, then the Load function returns kSoundTooLarge.
A sound is made nonpersistent when the Load function is called, meaning that it will destroy itself once it has finished playing.
See Also
Sound::Stream
|