Interface representing the core audio system of the engine. Defines the API used to initialize the audio backend, manage sound resources, and control audio playback. Implementations can use different audio libraries (MiniAudio, FMOD, Wwise, etc.).
More...
#include <IAudioSystem.hpp>
|
| virtual | ~IAudioSystem ()=default |
| | Virtual destructor.
|
| virtual bool | Init ()=0 |
| | Initializes the audio system and underlying audio backend.
|
| virtual void | Shutdown ()=0 |
| | Shuts down the audio system and releases all audio resources.
|
| virtual void | Update (float dt)=0 |
| | Updates the audio system. Typically called once per frame to process streaming, spatialization, and internal audio updates.
|
| virtual EI::SoundHandle | LoadSound (const std::string &path, const EI::SoundDesc &desc={})=0 |
| | Loads a sound resource from a file.
|
| virtual void | UnloadSound (EI::SoundHandle sound)=0 |
| | Unloads a previously loaded sound resource.
|
| virtual EI::VoiceHandle | Play (EI::SoundHandle sound, const EI::VoiceParams ¶ms={})=0 |
| | Plays a sound using the specified playback parameters.
|
| virtual void | Stop (EI::VoiceHandle voice)=0 |
| | Stops a currently playing sound instance.
|
| virtual void | SetMasterVolume (float volume)=0 |
| | Sets the global master volume for the entire audio system.
|
Interface representing the core audio system of the engine. Defines the API used to initialize the audio backend, manage sound resources, and control audio playback. Implementations can use different audio libraries (MiniAudio, FMOD, Wwise, etc.).
◆ ~IAudioSystem()
| virtual Engine::IAudioSystem::~IAudioSystem |
( |
| ) |
|
|
virtualdefault |
◆ Init()
| virtual bool Engine::IAudioSystem::Init |
( |
| ) |
|
|
pure virtual |
Initializes the audio system and underlying audio backend.
- Returns
- True if initialization succeeded
Implemented in Engine::MiniAudioSystem.
◆ LoadSound()
Loads a sound resource from a file.
- Parameters
-
| path | Path to the audio file |
| desc | Sound loading description |
- Returns
- Handle referencing the loaded sound
Implemented in Engine::MiniAudioSystem.
◆ Play()
Plays a sound using the specified playback parameters.
- Parameters
-
| sound | Handle of the sound to play |
| params | Playback parameters (volume, pitch, loop, etc.) |
- Returns
- Handle of the active sound instance
Implemented in Engine::MiniAudioSystem.
◆ SetMasterVolume()
| virtual void Engine::IAudioSystem::SetMasterVolume |
( |
float | volume | ) |
|
|
pure virtual |
Sets the global master volume for the entire audio system.
- Parameters
-
| volume | Master volume value |
Implemented in Engine::MiniAudioSystem.
◆ Shutdown()
| virtual void Engine::IAudioSystem::Shutdown |
( |
| ) |
|
|
pure virtual |
◆ Stop()
Stops a currently playing sound instance.
- Parameters
-
| voice | Handle of the voice to stop |
Implemented in Engine::MiniAudioSystem.
◆ UnloadSound()
Unloads a previously loaded sound resource.
- Parameters
-
| sound | Handle of the sound to unload |
Implemented in Engine::MiniAudioSystem.
◆ Update()
| virtual void Engine::IAudioSystem::Update |
( |
float | dt | ) |
|
|
pure virtual |
Updates the audio system. Typically called once per frame to process streaming, spatialization, and internal audio updates.
- Parameters
-
| dt | Delta time since the last frame |
Implemented in Engine::MiniAudioSystem.
The documentation for this class was generated from the following file: