My Project
Loading...
Searching...
No Matches
Engine::MiniAudioSystem Class Referencefinal

Audio system implementation using MiniAudio. Handles loading, playing, and managing audio resources in the engine. Implements the IAudioSystem interface. More...

#include <MiniAudioSystem.hpp>

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

Public Member Functions

 MiniAudioSystem ()=default
 Default constructor.
 ~MiniAudioSystem () override=default
 Destructor.
bool Init () override
 Initializes the MiniAudio engine.
void Shutdown () override
 Shuts down the MiniAudio engine and frees all resources.
void Update (float deltaTime) override
 Updates the MiniAudio engine (streaming, spatialization, etc.).
EI::SoundHandle LoadSound (const std::string &path, const EI::SoundDesc &desc={}) override
 Loads a sound file into the audio system.
void UnloadSound (EI::SoundHandle sound) override
 Unloads a previously loaded sound resource.
EI::VoiceHandle Play (EI::SoundHandle sound, const EI::VoiceParams &params={}) override
 Plays a sound with the specified parameters.
void Stop (EI::VoiceHandle voice) override
 Stops a currently playing sound instance.
void SetMasterVolume (float volume) override
 Sets the global master volume for all sounds.
Public Member Functions inherited from Engine::IAudioSystem
virtual ~IAudioSystem ()=default
 Virtual destructor.

Detailed Description

Audio system implementation using MiniAudio. Handles loading, playing, and managing audio resources in the engine. Implements the IAudioSystem interface.

Constructor & Destructor Documentation

◆ MiniAudioSystem()

Engine::MiniAudioSystem::MiniAudioSystem ( )
default

Default constructor.

◆ ~MiniAudioSystem()

Engine::MiniAudioSystem::~MiniAudioSystem ( )
overridedefault

Destructor.

Member Function Documentation

◆ Init()

bool Engine::MiniAudioSystem::Init ( )
overridevirtual

Initializes the MiniAudio engine.

Returns
True if initialization succeeded

Implements Engine::IAudioSystem.

◆ LoadSound()

EI::SoundHandle Engine::MiniAudioSystem::LoadSound ( const std::string & path,
const EI::SoundDesc & desc = {} )
overridevirtual

Loads a sound file into the audio system.

Parameters
pathPath to the audio file
descSound description (streaming, spatial, etc.)
Returns
Handle referencing the loaded sound

Implements Engine::IAudioSystem.

◆ Play()

EI::VoiceHandle Engine::MiniAudioSystem::Play ( EI::SoundHandle sound,
const EI::VoiceParams & params = {} )
overridevirtual

Plays a sound with the specified parameters.

Parameters
soundSound handle to play
paramsPlayback parameters (volume, pitch, loop, pan)
Returns
Handle of the active sound instance (voice)

Implements Engine::IAudioSystem.

◆ SetMasterVolume()

void Engine::MiniAudioSystem::SetMasterVolume ( float volume)
overridevirtual

Sets the global master volume for all sounds.

Parameters
volumeVolume value (0..1+)

Implements Engine::IAudioSystem.

◆ Shutdown()

void Engine::MiniAudioSystem::Shutdown ( )
overridevirtual

Shuts down the MiniAudio engine and frees all resources.

Implements Engine::IAudioSystem.

◆ Stop()

void Engine::MiniAudioSystem::Stop ( EI::VoiceHandle voice)
overridevirtual

Stops a currently playing sound instance.

Parameters
voiceVoice handle to stop

Implements Engine::IAudioSystem.

◆ UnloadSound()

void Engine::MiniAudioSystem::UnloadSound ( EI::SoundHandle sound)
overridevirtual

Unloads a previously loaded sound resource.

Parameters
soundHandle of the sound to unload

Implements Engine::IAudioSystem.

◆ Update()

void Engine::MiniAudioSystem::Update ( float deltaTime)
overridevirtual

Updates the MiniAudio engine (streaming, spatialization, etc.).

Parameters
deltaTimeTime elapsed since last frame

Implements Engine::IAudioSystem.


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