Provides an interface to output sound to the user's speakers.
More...
Provides an interface to output sound to the user's speakers.
- See also
- love.sound
◆ getVolume()
float love::audio::getVolume |
( |
| ) |
|
Returns the master volume.
- Returns
- The current master volume between 0.0f and 1.0f.
- See also
- setVolume
◆ newSource()
SoundData* love::audio::newSource |
( |
const std::string & |
filename, |
|
|
const std::string & |
type |
|
) |
| |
Creates a new audio source from a file.
- Parameters
-
filename | The .wav file to load. |
type | ("static") The type of audio source to load ("static", "stream"). Optional. |
- Returns
- The new SoundData if it loaded correctly, NULL otherwise.
- See also
- love.sound.newSoundData
◆ play()
bool love::audio::play |
( |
SoundData * |
soundData | ) |
|
Plays the specified sound.
- Parameters
-
soundData | The sound to play. |
- Returns
- True or false, depending on whether or not the sound data successfully played.
◆ setVolume()
audio& love::audio::setVolume |
( |
float |
volume | ) |
|
Set the master volume.
- Parameters
-
volume | 1.0f is max and 0.0f is off. |
- Returns
- The audio module, to allow method chaining.
- See also
- getVolume