#include <lib_snd.h>
A class for playing sounds.
Normally one want to use the BaseSound class for the actual sound, as in this example:
Private Member Functions | |
| GePlaySnd () | |
| ~GePlaySnd () | |
Alloc/Free | |
| static GePlaySnd * | Alloc () |
| static void | Free (GePlaySnd *&data) |
Miscellaneous | |
| Bool | Open (const BaseSound *snd) |
| Bool | Open (Int32 stream_cnt, const BaseSound **streams, const Float *start_offsets, Float max_length) |
| void | Close () |
| void | StartAt (Float64 start) |
| void | Scrub (Float64 start, Float64 duration) |
| void | Stop () |
| Bool | IsPlaying () |
| Float64 | GetPositionEstimate () |
| void | SetScale (Float64 scale) |
| Float64 | GetScale () |
|
private |
|
private |
|
static |
|
static |
| Bool Open | ( | Int32 | stream_cnt, |
| const BaseSound ** | streams, | ||
| const Float * | start_offsets, | ||
| Float | max_length | ||
| ) |
Opens an audio device with multiple BaseSounds that will be mixed. The audio data referenced by the BaseSounds will be kept in memory until Close() is called.
| [in] | stream_cnt | The number of sounds to be mixed. |
| [in] | streams | The array with the sounds. |
| [in] | start_offsets | The array with start time offsets in seconds (this is the audible sound data when StartAt(0) is called). |
| [in] | max_length | The maximum length of the audio data in seconds (relative to StartAt(0)). |
| void Close | ( | ) |
Closes the audio device.
| void StartAt | ( | Float64 | start | ) |
Starts audio output.
| [in] | start | The position relative to the start of the audio data in seconds. |
| [in] | start | The position relative to the start of the audio data in seconds. |
| [in] | duration | The scrub duration in seconds after which the audio device will be stopped. |
| void Stop | ( | ) |
Stops audio output.
| Bool IsPlaying | ( | ) |
Checks if the audio device is running.
| Float64 GetPositionEstimate | ( | ) |
Gets an estimate audio position.
| void SetScale | ( | Float64 | scale | ) |
Sets the playback time scale.
| [in] | scale | The playback scale value: 1.0 means real time, 2.0 means twice as fast, 0.5 means half the speed, 0.0 is invalid. |
| Float64 GetScale | ( | ) |
Gets the current playback time scale.