LuaSTG-x Core API
audio::Engine Class Reference

Public Member Functions

function getActiveEffects ()
 
function getActiveSourceCount ()
 
function getDistanceModel ()
 
function getDopplerScale ()
 
function getEffect (local name)
 
function getEffectID (local name, local id)
 
function getFormat (local bitDepth, local channels)
 
function getLastError ()
 
function getMaxEffectCount ()
 
function getMaxSourceCount ()
 
function getMaxSourceEffectCount ()
 
function getOrientation ()
 
function getPosition ()
 
function getRecordingDevices ()
 
function getVelocity ()
 
function getVolume ()
 
function isEffectSupported ()
 
function isValid ()
 
function onEnterBackground ()
 
function onEnterForeground ()
 
function pause (local sources)
 
function play (local sources)
 
function removeEffect (local name)
 
function setDistanceModel (local distanceModel)
 
function setDopplerScale (local scale)
 
function setEffect (local name, local params)
 
function setOrientation (local forward, local up)
 
function setPosition (local v)
 
function setVelocity (local v)
 
function setVolume (local volume)
 
function stop (local sources)
 

Member Function Documentation

◆ getActiveEffects()

function getActiveEffects ( )

Gets list of EFX effect names.

return List of EFX names to fill.

Returns
array_table

◆ getActiveSourceCount()

function getActiveSourceCount ( )

Gets the current number of simultaneous playing sources.

return The current number of simultaneous playing sources.

Returns
number

◆ getDistanceModel()

function getDistanceModel ( )

Gets the distance model used for attenuation.

return Distance model.

Returns
number

◆ getDopplerScale()

function getDopplerScale ( )
Returns
number

◆ getEffect()

function getEffect ( local  name)

Gets scene EFX effect.

param name Effect name to get data from.

return Effect description table.

Parameters
namestring
Returns
table

◆ getEffectID()

function getEffectID ( local  name,
local  id 
)
Parameters
namestring
idnumber
Returns
boolean

◆ getFormat()

function getFormat ( local  bitDepth,
local  channels 
)

Gets the OpenAL format identifier based on number of

channels and bits.

param channels

param bitDepth Either 8-bit samples, or 16-bit samples.

return One of AL_FORMAT_*, or AL_NONE if unsupported format.

Parameters
bitDepthnumber
channelsnumber
Returns
number

◆ getLastError()

function getLastError ( )
Returns
string

◆ getMaxEffectCount()

function getMaxEffectCount ( )

Gets maximum number of scene EFX effects.

return number of effects.

Returns
number

◆ getMaxSourceCount()

function getMaxSourceCount ( )

Gets the maximum supported number of simultaneous playing sources.

return The maximum supported number of simultaneous playing sources.

Returns
number

◆ getMaxSourceEffectCount()

function getMaxSourceEffectCount ( )

Gets maximum number of source EFX effects.

return number of effects.

Returns
number

◆ getOrientation()

function getOrientation ( )

Gets the orientation of the listener.

return A vector array of size 2 containing the forward

vector and the up vector.

Returns
array_table

◆ getPosition()

function getPosition ( )

Gets the position of the listener.

Returns
vec3_table

◆ getRecordingDevices()

function getRecordingDevices ( )

return Reference to a vector of pointers to recording devices. May be empty.

Returns
array_table

◆ getVelocity()

function getVelocity ( )

Gets the velocity of the listener.

Returns
vec3_table

◆ getVolume()

function getVolume ( )

Gets the master volume.

return The current master volume.

Returns
number

◆ isEffectSupported()

function isEffectSupported ( )

Gets EFX (or analog) availability.

return true if supported.

Returns
boolean

◆ isValid()

function isValid ( )
Returns
boolean

◆ onEnterBackground()

function onEnterBackground ( )
Returns
audio.Engine

◆ onEnterForeground()

function onEnterForeground ( )
Returns
audio.Engine

◆ pause()

function pause ( local  sources)

Pauses all audio.

Parameters
sourcesarray_table
Returns
audio.Engine
重载
fun(self:audio.Engine):audio.Engine

◆ play()

function play ( local  sources)

Play the specified Sources.

param sources The Sources to play.

Parameters
sourcesarray_table
Returns
boolean

◆ removeEffect()

function removeEffect ( local  name)

Removes scene EFX effect.

param name Effect name to clear.

return true if successful, false otherwise.

Parameters
namestring
Returns
boolean

◆ setDistanceModel()

function setDistanceModel ( local  distanceModel)

Sets the distance model used for attenuation.

param distanceModel Distance model.

Parameters
distanceModelnumber
Returns
audio.Engine

◆ setDopplerScale()

function setDopplerScale ( local  scale)
Parameters
scalenumber
Returns
audio.Engine

◆ setEffect()

function setEffect ( local  name,
local  params 
)

Sets scene EFX effect.

param name Effect name to use.

param params Effect description table.

return true if successful, false otherwise.

Parameters
namestring
paramstable
Returns
boolean

◆ setOrientation()

function setOrientation ( local  forward,
local  up 
)

Sets the orientation of the listener.

param forward the forward vector

param up the up vector.

Parameters
forwardvec3_table
upvec3_table
Returns
audio.Engine

◆ setPosition()

function setPosition ( local  v)

Sets the position of the listener.

Parameters
vvec3_table
Returns
audio.Engine

◆ setVelocity()

function setVelocity ( local  v)

Sets the velocity of the listener.

Parameters
vvec3_table
Returns
audio.Engine

◆ setVolume()

function setVolume ( local  volume)

Sets the master volume, where 0.0f is min (off) and 1.0f is max.

param volume The new master volume.

Parameters
volumenumber
Returns
audio.Engine

◆ stop()

function stop ( local  sources)

Stops all playing audio.

Parameters
sourcesarray_table
Returns
audio.Engine
重载
fun(self:audio.Engine):audio.Engine

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