|
| bool | preload (const std::string &path, const std::string &key, AudioType type) |
| | Preloads an audio file for future use.
|
| |
| Audio | playEffect (const std::string &key, AudioSettings settings=AudioSettings()) |
| | Plays a sound effect. Sound effects are short, one-off sounds.
|
| |
| Audio | playMusic (const std::string &key, AudioSettings settings=AudioSettings()) |
| | Plays a music track. Music tracks are long, and in case of background repeating sounds.
|
| |
|
void | destroyAll () |
| |
|
void | updatePositionalAudio (glm::vec3 listenerPos, glm::vec3 listenerDir, glm::vec3 listenerVel) |
| |
◆ playEffect()
Plays a sound effect. Sound effects are short, one-off sounds.
- Parameters
-
| key | The identifier of the audio to play (specified in preload). |
| settings | The settings for the sound effect. |
- Returns
- The audio object for the sound effect.
- Exceptions
-
| std::runtime_error | if the audio file is not preloaded. |
◆ playMusic()
Plays a music track. Music tracks are long, and in case of background repeating sounds.
- Parameters
-
| key | The identifier of the audio to play (specified in preload). |
| settings | The settings for the music track. |
- Returns
- The audio object for the music track.
- Exceptions
-
| std::runtime_error | if the audio file is not preloaded. |
- Note
- If the audio is already playing, it will start from the beginning.
◆ preload()
| bool AudioManager::preload |
( |
const std::string & |
path, |
|
|
const std::string & |
key, |
|
|
AudioType |
type |
|
) |
| |
Preloads an audio file for future use.
- Parameters
-
| path | The path to the audio file. |
| key | The identifier for this audio for future use. |
| type | The type of audio file. |
- Returns
- True if the audio file was preloaded successfully, false if the key already exists.
- Exceptions
-
| std::runtime_error | if the audio file cannot be loaded. |
The documentation for this class was generated from the following files: