#include <casoundeffect.h>
Public Member Functions | |
| CASoundEffect (CL_SoundBuffer *sample, int maxPlays=1) | |
| Constructor. | |
| ~CASoundEffect () | |
| Destructor. | |
| void | play (int num=1) |
| Plays the sample if it isn't played already too often at once. | |
| void | setVolume (float v) |
| Sets a new volume for all instances of this sample which are currently played. | |
| float | getVolume (int ind=0) |
| Gets the volume of sample with index 'ind'. | |
| void | setFrequency (int f) |
| Sets a new frequency for all instances of this sample which are currently played. | |
| int | getFrequency (int ind=0) |
| Gets the frequency of sample with index 'ind'. | |
Static Public Member Functions | |
| static void | playBackgroundMelody () |
| Plays a background melody. | |
However, it's necessary to avoid playing the same sample too often at the same time.
| CASoundEffect::CASoundEffect | ( | CL_SoundBuffer * | sample, | |
| int | maxPlays = 1 | |||
| ) |
Constructor.
| resource | The sample to play. | |
| maxPlays | Maximal number the sound can be played at once. |
| void CASoundEffect::play | ( | int | num = 1 |
) |
Plays the sample if it isn't played already too often at once.
| num | Play this sample 'num' times at once (makes it louder than 100%). | |
| loop | Loop the sample (default false) |
1.5.0