AudioCore

Photon’s core for audio manipulation/control.  Defines the interface through which all audio related functions are performed.

Summary
Photon’s core for audio manipulation/control.
Initialize underlying APIs and setup Task internals.
Shutdown underlying APIs.
Get name of active audio device.
Checks for OpenAL internal errors, returning a descriptive string if the OpenAL error state is currently set.
Checks for OpenAL internal errors, throwing an APIError if the OpenAL error state is set and doing nothing if not.

(Con/ De)structors

AudioCore

AudioCore(const std::string &deviceName)

Initialize underlying APIs and setup Task internals.  AudioCore();

~AudioCore

~AudioCore()

Shutdown underlying APIs.

Accessors

getAudioDeviceName

std::string getAudioDeviceName() const

Get name of active audio device.

Returns

Name of audio device currently in use.

Error Checking

checkOpenALError

static std::string checkOpenALError()

Checks for OpenAL internal errors, returning a descriptive string if the OpenAL error state is currently set.  Will return an empty string if there is no error set.

Returns

String describing OpenAL error, empty string if no error exists.

throwOpenALError

static void throwOpenALError(const std::string &func)

Checks for OpenAL internal errors, throwing an APIError if the OpenAL error state is set and doing nothing if not.  Optionally makes the thrown exception more descriptive by adding in a function string that describes then the OpenAL error was flagged.

Parameters

funcFunction in/after which the check for an OpenAL error takes place

Throws

APIError if an OpenAL error state has been set.

AudioCore(const std::string &deviceName)
Initialize underlying APIs and setup Task internals.
~AudioCore()
Shutdown underlying APIs.
std::string getAudioDeviceName() const
Get name of active audio device.
static std::string checkOpenALError()
Checks for OpenAL internal errors, returning a descriptive string if the OpenAL error state is currently set.
static void throwOpenALError(const std::string &func)
Checks for OpenAL internal errors, throwing an APIError if the OpenAL error state is set and doing nothing if not.
APIError should be thrown if an error occurs in code which is not part of Photon.