class TcAudioPlayer

AudioPlayer Class

Public Methods

TcAudioPlayer(const TcUtString &soundDir)
Constructor
~TcAudioPlayer()
Destructor
void playSound(const TcUtString &name, int isLooped)
Starts play of a sound clip
void forwardSound()
Stops the currently playing sound clip and plays the next clip
void backSound()
Stops the currently playing sound clip and plays the previous clip
void addSound(const TcUtString &path, const TcUtString &filename)
Adds a new playable clip to the list of sound files
void playFirstSound()
Start playing the first sound in the list as determined by an ascending alphabetical sorting of the sound file names
void stopSound(const TcUtString &name)
Stops the sound from playing
void stopCurrentSound()
Stops the last sound clip in which play was initiated.
void rewindSound(const TcUtString &name)
Rewind the sound file

Documentation

AudioPlayer Class. This class is currently implemented using Dave Pape's Bergen Sound Server. A directory of .aiff files is read at class instantiation. Offers similar functionality to a CD player. Client's can play, loop, stop/pause, rewind, add and delete sound clips. The server is assumed to be running on the machine on which this class is instantiated.
TcAudioPlayer(const TcUtString &soundDir)
Constructor
Parameters:
soundDir - This is the full path name of the directory containing the .aiff files.

~TcAudioPlayer()
Destructor. This will kill all currently playing sounds.

void playSound(const TcUtString &name, int isLooped)
Starts play of a sound clip. This works similar to the function of a CD player in that will resume play from the point the clip was paused, or start from the beginning if it was not previously playing. If a sound has already been played it must be rewound before it can be heard again.
Parameters:
The - name of the soundfile to be played. This must have been read in at class instantiation or by an explicit call to add sound.
isLooped - If the value is 0 the sound will be played once. Otherwise it will be looped.

void forwardSound()
Stops the currently playing sound clip and plays the next clip. The order is sorted alphabetically determined by ascii values.

void backSound()
Stops the currently playing sound clip and plays the previous clip. The order is sorted alphabetically determined by ascii values.

void addSound(const TcUtString &path, const TcUtString &filename)
Adds a new playable clip to the list of sound files. This sound file be inserted alphabetically into the list determined by ascii value. String literals are accepted as arguments.
Parameters:
path - This is the absolute path not including the file name of the file to be added.
filename - This is the file name to be added.

void playFirstSound()
Start playing the first sound in the list as determined by an ascending alphabetical sorting of the sound file names

void stopSound(const TcUtString &name)
Stops the sound from playing. If the sound is currently playing it serves as a pause. If the sound has reached the end it serves as a rewind.
Parameters:
name - The name of the sound file that one wishes to stop.

void stopCurrentSound()
Stops the last sound clip in which play was initiated.

void rewindSound(const TcUtString &name)
Rewind the sound file. Exactly the same behavior as stopSound. Provided only as a naming convenience, to maintain coherency. Whenever a sound is played it is a good idea to call rewindSound to ensure that is not already at the end from a previous play.


This class has no child classes.

alphabetic index hierarchy of classes


this page has been generated automatically by doc++

(c)opyright by Malte Zöckler, Roland Wunderling
contact: doc++@zib.de