Ember
A C++ 20 'game engine' built with SDL3 with wide platform support.
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
Audio Class Reference

Audio struct. More...

#include <ember_audio.h>

Public Member Functions

void SetVolume (float vol)
 Change the audio volume. More...
 
void Pause ()
 Pause audio and fade out. More...
 
void Play (bool loop=false)
 Play audio. More...
 
bool IsPlaying ()
 
void SetLoop (bool loop)
 
void Destroy ()
 Unload Audio allocated memory. More...
 
 Audio (const Audio &)=delete
 
Audiooperator= (Audio &)=delete
 
 Audio (Audio &&)=delete
 

Static Public Member Functions

static AudioLoad (const std::string &file_Path)
 Load Audio and keep track of it. More...
 

Public Attributes

float volume = 1.0f
 
float duration = 0.0f
 

Detailed Description

Audio struct.

Version
0.0.9

Constructor & Destructor Documentation

◆ Audio() [1/2]

Audio::Audio ( const Audio )
delete

◆ Audio() [2/2]

Audio::Audio ( Audio &&  )
delete

Member Function Documentation

◆ Destroy()

void Audio::Destroy ( )

Unload Audio allocated memory.

  • Manually clear allocated audio or at the end will be freed
    • automatically
See also
CloseAudio
Version
0.0.3
Returns
void

◆ IsPlaying()

bool Audio::IsPlaying ( )

◆ Load()

Audio * Audio::Load ( const std::string &  file_Path)
static

Load Audio and keep track of it.

Parameters
file_PathPath to the audio file
Version
0.0.3
  • Returns
    Audio allocated audio memory struct

◆ operator=()

Audio& Audio::operator= ( Audio )
delete

◆ Pause()

void Audio::Pause ( )

Pause audio and fade out.

Version
0.0.3
Returns
void

◆ Play()

void Audio::Play ( bool  loop = false)

Play audio.

Parameters
loopPlay audio in loop or not
Version
0.0.3
Returns
void

◆ SetLoop()

void Audio::SetLoop ( bool  loop)

◆ SetVolume()

void Audio::SetVolume ( float  vol)

Change the audio volume.

Parameters
volAudio volume from 0.0 to 1.0
Version
0.0.3
Returns
  * void

Member Data Documentation

◆ duration

float Audio::duration = 0.0f

◆ volume

float Audio::volume = 1.0f

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