#include <AudioEngine.h>
Classes | |
struct | AudioInfo |
struct | ProfileHelper |
Public Types | |
enum | AudioState { ERROR = -1, INITIALZING, PLAYING, PAUSED } |
Static Public Member Functions | |
static bool | lazyInit () |
var | lazyInit () |
local | lazyInit () |
static void | end () |
Release related objects. More... | |
local | end () |
Release related objects. More... | |
static AudioProfile * | getDefaultProfile () |
Gets the default profile of audio instances. More... | |
local | getDefaultProfile () |
Gets the default profile of audio instances. More... | |
static int | play2d (const std::string &filePath, bool loop=false, float volume=1.0f, const AudioProfile *profile=nullptr) |
Play 2d sound. More... | |
var | play2d ( var filePath, var false, var 0f, var nullptr) |
Play 2d sound. More... | |
local | play2d ( local filePath, local false, local 0f, local nullptr) |
Play 2d sound. More... | |
static void | setLoop (int audioID, bool loop) |
Sets whether an audio instance loop or not. More... | |
local | setLoop ( local audioID, local loop) |
Sets whether an audio instance loop or not. More... | |
static bool | isLoop (int audioID) |
Checks whether an audio instance is loop. More... | |
static void | setVolume (int audioID, float volume) |
Sets volume for an audio instance. More... | |
var | setVolume ( var audioID, var volume) |
Sets volume for an audio instance. More... | |
local | setVolume ( local audioID, local volume) |
Sets volume for an audio instance. More... | |
static float | getVolume (int audioID) |
Gets the volume value of an audio instance. More... | |
static void | pause (int audioID) |
Pause an audio instance. More... | |
local | pause ( local audioID) |
Pause an audio instance. More... | |
static void | pauseAll () |
Pause all playing audio instances. More... | |
var | pauseAll () |
Pause all playing audio instances. More... | |
local | pauseAll () |
Pause all playing audio instances. More... | |
static void | resume (int audioID) |
Resume an audio instance. More... | |
static void | resumeAll () |
Resume all suspended audio instances. More... | |
var | resumeAll () |
Resume all suspended audio instances. More... | |
local | resumeAll () |
Resume all suspended audio instances. More... | |
static void | stop (int audioID) |
Stop an audio instance. More... | |
static void | stopAll () |
Stop all audio instances. More... | |
var | stopAll () |
Stop all audio instances. More... | |
local | stopAll () |
Stop all audio instances. More... | |
static bool | setCurrentTime (int audioID, float time) |
Sets the current playback position of an audio instance. More... | |
static float | getCurrentTime (int audioID) |
Gets the current playback position of an audio instance. More... | |
local | getCurrentTime ( local audioID) |
Gets the current playback position of an audio instance. More... | |
static float | getDuration (int audioID) |
Gets the duration of an audio instance. More... | |
local | getDuration ( local audioID) |
Gets the duration of an audio instance. More... | |
static AudioState | getState (int audioID) |
Returns the state of an audio instance. More... | |
local | getState ( local audioID) |
Returns the state of an audio instance. More... | |
static void | setFinishCallback (int audioID, const std::function< void(int, const std::string &)> &callback) |
Register a callback to be invoked when an audio instance has completed playing. More... | |
static int | getMaxAudioInstance () |
var | getMaxAudioInstance () |
static bool | setMaxAudioInstance (int maxInstances) |
local | setMaxAudioInstance ( local maxInstances) |
static void | uncache (const std::string &filePath) |
Uncache the audio data from internal buffer. More... | |
var | uncache ( var filePath) |
Uncache the audio data from internal buffer. More... | |
local | uncache ( local filePath) |
Uncache the audio data from internal buffer. More... | |
static void | uncacheAll () |
Uncache all audio data from internal buffer. More... | |
var | uncacheAll () |
Uncache all audio data from internal buffer. More... | |
local | uncacheAll () |
Uncache all audio data from internal buffer. More... | |
static AudioProfile * | getProfile (int audioID) |
Gets the audio profile by id of audio instance. More... | |
var | getProfile ( var audioID) |
Gets the audio profile by id of audio instance. More... | |
local | getProfile ( local audioID) |
Gets the audio profile by id of audio instance. More... | |
static AudioProfile * | getProfile (const std::string &name) |
Gets the audio profile by name. More... | |
local | getProfile ( local name) |
Gets the audio profile by name. More... | |
Static Public Attributes | |
static const int | INVAILD_AUDIO_ID |
var | INVAILD_AUDIO_ID |
local | INVAILD_AUDIO_ID |
static const float | TIME_UNKNOWN |
var | TIME_UNKNOWN |
local | TIME_UNKNOWN |
Static Protected Member Functions | |
static void | remove (int audioID) |
var | remove ( var audioID) |
local | remove ( local audioID) |
Static Protected Attributes | |
static std::unordered_map< int, AudioInfo > | _audioIDInfoMap |
static std::unordered_map < std::string, std::list< int > > | _audioPathIDMap |
static std::unordered_map < std::string, ProfileHelper > | _audioPathProfileHelperMap |
static int | _maxInstances |
local | _maxInstances |
static ProfileHelper * | _defaultProfileHelper |
var | _defaultProfileHelper |
local | _defaultProfileHelper |
static AudioEngineImpl * | _audioEngineImpl |
var | _audioEngineImpl |
local | _audioEngineImpl |
Friends | |
class | AudioEngineImpl |
|
strong |
|
strong |
|
strong |
|
static |
Release related objects.
|
static |
Release related objects.
|
static |
Release related objects.
|
static |
Gets the current playback position of an audio instance.
audioID | an audioID returned by the play2d function |
|
static |
Gets the current playback position of an audio instance.
audioID | an audioID returned by the play2d function |
|
static |
Gets the current playback position of an audio instance.
audioID | an audioID returned by the play2d function |
|
static |
Gets the default profile of audio instances.
|
static |
Gets the default profile of audio instances.
|
static |
Gets the default profile of audio instances.
|
static |
Gets the duration of an audio instance.
audioID | an audioID returned by the play2d function |
|
static |
Gets the duration of an audio instance.
audioID | an audioID returned by the play2d function |
|
static |
Gets the duration of an audio instance.
audioID | an audioID returned by the play2d function |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
static |
Gets the audio profile by id of audio instance.
audioID | an audioID returned by the play2d function |
|
static |
Gets the audio profile by id of audio instance.
audioID | an audioID returned by the play2d function |
|
static |
Gets the audio profile by id of audio instance.
audioID | an audioID returned by the play2d function |
|
static |
Gets the audio profile by name.
name | name of audio profile |
|
static |
Gets the audio profile by name.
name | name of audio profile |
|
static |
Gets the audio profile by name.
name | name of audio profile |
|
static |
Returns the state of an audio instance.
audioID | an audioID returned by the play2d function |
|
static |
Returns the state of an audio instance.
audioID | an audioID returned by the play2d function |
|
static |
Returns the state of an audio instance.
audioID | an audioID returned by the play2d function |
|
static |
Gets the volume value of an audio instance.
audioID | an audioID returned by the play2d function |
|
static |
Gets the volume value of an audio instance.
audioID | an audioID returned by the play2d function |
|
static |
Gets the volume value of an audio instance.
audioID | an audioID returned by the play2d function |
|
static |
Checks whether an audio instance is loop.
audioID | an audioID returned by the play2d function |
|
static |
Checks whether an audio instance is loop.
audioID | an audioID returned by the play2d function |
|
static |
Checks whether an audio instance is loop.
audioID | an audioID returned by the play2d function |
|
static |
|
static |
|
static |
|
static |
Pause an audio instance.
audioID | an audioID returned by the play2d function |
|
static |
Pause an audio instance.
audioID | an audioID returned by the play2d function |
|
static |
Pause an audio instance.
audioID | an audioID returned by the play2d function |
|
static |
Pause all playing audio instances.
|
static |
Pause all playing audio instances.
|
static |
Pause all playing audio instances.
|
static |
Play 2d sound.
filePath | The path of an audio file |
loop | Whether audio instance loop or not |
volume | volume value (range from 0.0 to 1.0) |
profile | a profile for audio instance |
|
static |
Play 2d sound.
filePath | The path of an audio file |
loop | Whether audio instance loop or not |
volume | volume value (range from 0.0 to 1.0) |
profile | a profile for audio instance |
|
static |
Play 2d sound.
filePath | The path of an audio file |
loop | Whether audio instance loop or not |
volume | volume value (range from 0.0 to 1.0) |
profile | a profile for audio instance |
|
staticprotected |
|
staticprotected |
|
staticprotected |
|
static |
Resume an audio instance.
audioID | an audioID returned by the play2d function |
|
static |
Resume an audio instance.
audioID | an audioID returned by the play2d function |
|
static |
Resume an audio instance.
audioID | an audioID returned by the play2d function |
|
static |
Resume all suspended audio instances.
|
static |
Resume all suspended audio instances.
|
static |
Resume all suspended audio instances.
|
static |
Sets the current playback position of an audio instance.
audioID | an audioID returned by the play2d function |
|
static |
Sets the current playback position of an audio instance.
audioID | an audioID returned by the play2d function |
|
static |
Sets the current playback position of an audio instance.
audioID | an audioID returned by the play2d function |
|
static |
Register a callback to be invoked when an audio instance has completed playing.
audioID | an audioID returned by the play2d function |
callback |
|
static |
Register a callback to be invoked when an audio instance has completed playing.
audioID | an audioID returned by the play2d function |
callback |
|
static |
Register a callback to be invoked when an audio instance has completed playing.
audioID | an audioID returned by the play2d function |
callback |
|
static |
Sets whether an audio instance loop or not.
audioID | an audioID returned by the play2d function |
loop | Whether audio instance loop or not |
|
static |
Sets whether an audio instance loop or not.
audioID | an audioID returned by the play2d function |
loop | Whether audio instance loop or not |
|
static |
Sets whether an audio instance loop or not.
audioID | an audioID returned by the play2d function |
loop | Whether audio instance loop or not |
|
static |
|
static |
|
static |
|
static |
Sets volume for an audio instance.
audioID | an audioID returned by the play2d function |
volume | volume value (range from 0.0 to 1.0) |
|
static |
Sets volume for an audio instance.
audioID | an audioID returned by the play2d function |
volume | volume value (range from 0.0 to 1.0) |
|
static |
Sets volume for an audio instance.
audioID | an audioID returned by the play2d function |
volume | volume value (range from 0.0 to 1.0) |
|
static |
Stop an audio instance.
audioID | an audioID returned by the play2d function |
|
static |
Stop an audio instance.
audioID | an audioID returned by the play2d function |
|
static |
Stop an audio instance.
audioID | an audioID returned by the play2d function |
|
static |
Stop all audio instances.
|
static |
Stop all audio instances.
|
static |
Stop all audio instances.
|
static |
Uncache the audio data from internal buffer.
AudioEngine cache audio data on ios platform
filePath | The path of an audio file |
|
static |
Uncache the audio data from internal buffer.
AudioEngine cache audio data on ios platform
filePath | The path of an audio file |
|
static |
Uncache the audio data from internal buffer.
AudioEngine cache audio data on ios platform
filePath | The path of an audio file |
|
static |
Uncache all audio data from internal buffer.
|
static |
Uncache all audio data from internal buffer.
|
static |
Uncache all audio data from internal buffer.
|
friend |
|
friend |
|
friend |
|
staticprotected |
|
staticprotected |
|
staticprotected |
|
staticprotected |
|
staticprotected |
|
staticprotected |
|
staticprotected |
|
staticprotected |
|
staticprotected |
|
staticprotected |
|
staticprotected |
|
staticprotected |
|
staticprotected |
|
staticprotected |
|
staticprotected |
|
staticprotected |
|
staticprotected |
|
staticprotected |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |