My Project
Loading...
Searching...
No Matches
Engine::IAudioSystem Class Referenceabstract

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>

Inheritance diagram for Engine::IAudioSystem:
Engine::MiniAudioSystem

Public Member Functions

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 &params={})=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.

Detailed Description

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.).

Constructor & Destructor Documentation

◆ ~IAudioSystem()

virtual Engine::IAudioSystem::~IAudioSystem ( )
virtualdefault

Virtual destructor.

Member Function Documentation

◆ 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()

virtual EI::SoundHandle Engine::IAudioSystem::LoadSound ( const std::string & path,
const EI::SoundDesc & desc = {} )
pure virtual

Loads a sound resource from a file.

Parameters
pathPath to the audio file
descSound loading description
Returns
Handle referencing the loaded sound

Implemented in Engine::MiniAudioSystem.

◆ Play()

virtual EI::VoiceHandle Engine::IAudioSystem::Play ( EI::SoundHandle sound,
const EI::VoiceParams & params = {} )
pure virtual

Plays a sound using the specified playback parameters.

Parameters
soundHandle of the sound to play
paramsPlayback 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
volumeMaster volume value

Implemented in Engine::MiniAudioSystem.

◆ Shutdown()

virtual void Engine::IAudioSystem::Shutdown ( )
pure virtual

Shuts down the audio system and releases all audio resources.

Implemented in Engine::MiniAudioSystem.

◆ Stop()

virtual void Engine::IAudioSystem::Stop ( EI::VoiceHandle voice)
pure virtual

Stops a currently playing sound instance.

Parameters
voiceHandle of the voice to stop

Implemented in Engine::MiniAudioSystem.

◆ UnloadSound()

virtual void Engine::IAudioSystem::UnloadSound ( EI::SoundHandle sound)
pure virtual

Unloads a previously loaded sound resource.

Parameters
soundHandle 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
dtDelta time since the last frame

Implemented in Engine::MiniAudioSystem.


The documentation for this class was generated from the following file: