9#include <aegis/manager.hpp>
13class AudioManager :
public ae::Manager,
public ae::Singleton<AudioManager>
29 void registerAudio(std::string path, ae::q20_12_t loopStartTime, ae::q20_12_t loopEndTime);
60 void playSFX(
SFX sfx,
int volume,
int panning);
111 void setLoop(ae::q20_12_t startTime, ae::q20_12_t endTime);
137 uint32_t
decode(
short* sample_data,
int num_samples);
147 static mm_word
audioCallback(mm_word length, mm_addr dest, mm_stream_formats format);
157 mm_word
processStream(mm_word length, mm_addr dest, mm_stream_formats format);
static mm_word audioCallback(mm_word length, mm_addr dest, mm_stream_formats format)
Callback for maxmod audio streaming, acting as a wrapper for processStream.
void stopSFX()
Stop all currently playing SFXs.
void setLoop(ae::q20_12_t startTime, ae::q20_12_t endTime)
Set the audio looping points.
void registerSFX(SFX sfx)
Register the SFX to be played.
void stopAudio()
Deregister the currently registered audio.
void pauseAudio()
Pause the currently registered audio, if playing.
ae::q20_12_t getDuration()
Get the total duration of the audio.
mm_word processStream(mm_word length, mm_addr dest, mm_stream_formats format)
Processes the next audio data to play.
void rewind()
Move to the start of the audio track.
ae::q20_12_t getTime()
Get the current time of the audio.
void seekFrame(int frame)
Move to the specified audio frame.
void loop()
Looping logic.
void registerAudio(std::string path, ae::q20_12_t loopStartTime, ae::q20_12_t loopEndTime)
Sets up the audio track to be played.
uint32_t decodeFrame()
Decode the current audio frame.
void playSFX(SFX sfx, int volume, int panning)
Play the specified registered SFX.
int getFrame()
Get the current audio frame.
uint32_t decode(short *sample_data, int num_samples)
Decode the given audio sample based on the current frame.
void playAudio()
Play the currently registered audio, if paused.