Sample::play returns a Channel that represents the sound being played.
More...
Sample::play returns a Channel that represents the sound being played.
This object can be used to stop sounds dynamically, or to check whether playback has finished.
Definition at line 17 of file Audio.hpp.
◆ Channel() [1/2]
Gosu::Channel::Channel |
( |
| ) |
|
This creates an "empty" Channel which is expired and cannot be resumed.
◆ Channel() [2/2]
Gosu::Channel::Channel |
( |
int |
channel, |
|
|
int |
token |
|
) |
| |
◆ current_channel()
int Gosu::Channel::current_channel |
( |
| ) |
const |
◆ pause()
void Gosu::Channel::pause |
( |
| ) |
|
Pauses this instance to be resumed afterwards.
Avoid leaving samples paused for too long, as they will still occupy one of Gosu's limited channels.
◆ paused()
bool Gosu::Channel::paused |
( |
| ) |
const |
◆ playing()
bool Gosu::Channel::playing |
( |
| ) |
const |
◆ resume()
void Gosu::Channel::resume |
( |
| ) |
|
◆ set_pan()
void Gosu::Channel::set_pan |
( |
double |
pan | ) |
|
- Parameters
-
pan | Can be anything from -1.0 (left) to 1.0 (right). |
◆ set_speed()
void Gosu::Channel::set_speed |
( |
double |
speed | ) |
|
- Parameters
-
speed | Use 1.0 for normal playback speed. |
◆ set_volume()
void Gosu::Channel::set_volume |
( |
double |
volume | ) |
|
- Parameters
-
volume | Can be anything from 0.0 (silence) to 1.0 (full volume). |
◆ stop()
void Gosu::Channel::stop |
( |
| ) |
|
Stops this channel if the sample is still being played.
If this method is called when playback has finished, it has no effect.
The documentation for this class was generated from the following file: