C4 Engine
C4 Engine API Documentation

AudioStreamer::AddComponent

Defined in:  C4Sound.h
Adds a component to an audio streamer.
Prototype

SoundResult AddComponent(const char *name);

Parameters
name The name of the sound resource.
Description
The AddComponent function adds the resource specified by the name parameter to the list of sound resources that will be streamed. If the resource cannot be opened, then an error is returned. If the resource is successfully opened, then the return value is kSoundOkay.

Sounds will be played in the order in which they are specified through calls to AddComponent. When the end of one resource is reached, the stream continues immediately at the beginning of the next resource. The same resource name can be specified for multiple calls to the AddComponent function, if desired.

Each sound resource specified for an AudioStreamer object must be stored in compressed format (mono or stereo). Otherwise, the result code kSoundFormatInvalid is returned.