Public Member Functions | |
Sample (const std::wstring &filename) | |
Constructs a sample that can be played on the specified audio system and loads the sample from a file. | |
Sample (Reader reader) | |
Constructs a sample that can be played on the specified audio system and loads the sample data from a stream. | |
SampleInstance | play (double volume=1, double speed=1, bool looping=false) const |
Plays the sample without panning. | |
SampleInstance | playPan (double pan, double volume=1, double speed=1, bool looping=false) const |
Plays the sample with panning. | |
GOSU_DEPRECATED | Sample (Audio &audio, const std::wstring &filename) |
GOSU_DEPRECATED | Sample (Audio &audio, Reader reader) |
Use samples for everything that's not music.
Definition at line 62 of file Audio.hpp.
Gosu::Sample::Sample | ( | const std::wstring & | filename | ) | [explicit] |
Constructs a sample that can be played on the specified audio system and loads the sample from a file.
Gosu::Sample::Sample | ( | Reader | reader | ) | [explicit] |
Constructs a sample that can be played on the specified audio system and loads the sample data from a stream.
GOSU_DEPRECATED Gosu::Sample::Sample | ( | Audio & | audio, | |
const std::wstring & | filename | |||
) |
GOSU_DEPRECATED Gosu::Sample::Sample | ( | Audio & | audio, | |
Reader | reader | |||
) |
SampleInstance Gosu::Sample::play | ( | double | volume = 1 , |
|
double | speed = 1 , |
|||
bool | looping = false | |||
) | const |
Plays the sample without panning.
volume | Can be anything from 0.0 (silence) to 1.0 (full volume). | |
speed | Playback speed is only limited by the underlying audio library, and can accept very high or low values. Use 1.0 for normal playback speed. |
SampleInstance Gosu::Sample::playPan | ( | double | pan, | |
double | volume = 1 , |
|||
double | speed = 1 , |
|||
bool | looping = false | |||
) | const |
Plays the sample with panning.
Even if pan is 0.0, the sample will not be as loud as if it were played by calling play() due to the way the panning works.
pan | Can be anything from -1.0 (left) to 1.0 (right). | |
volume | Can be anything from 0.0 (silence) to 1.0 (full volume). | |
speed | Playback speed is only limited by by the underlying audio library, and can accept very high or low values. Use 1.0 for normal playback speed. |