LuaSTG-x Core API
audio::Source Class Reference
Inheritance diagram for audio::Source:

Public Member Functions

function clone ()
 
function create (local sampleRate, local bitDepth, local channels, local buffers)
 
function createFromDecoder (local decoder)
 
function createFromSoundData (local soundData)
 
function getActiveEffects ()
 Gets a list of the Source's active effect names. More...
 
function getAirAbsorptionFactor ()
 
function getBitDepth ()
 
function getBytesPerFrame ()
 
function getChannelCount ()
 
function getCone ()
 
function getDirection ()
 
function getEffect (local name)
 Gets the filter settings associated to a specific effect. More...
 
function getFilter ()
 Gets the filter settings currently applied to the Source. More...
 
function getFreeBufferCount ()
 Gets the number of free buffer slots in a queueable Source. More...
 
function getLastError ()
 
function getLoopingEnd ()
 
function getLoopingStart ()
 
function getMaxDistance ()
 
function getMaxVolume ()
 
function getMinVolume ()
 
function getPitch ()
 
function getPosition ()
 
function getReferenceDistance ()
 
function getRolloffFactor ()
 
function getSampleRate ()
 
function getTime ()
 
function getTotalFrames ()
 
function getTotalTime ()
 
function getVelocity ()
 
function getVolume ()
 
function isFinished ()
 
function isLooping ()
 
function isPlaying ()
 
function isRelative ()
 
function isSupportLoopingPoint ()
 
function pause ()
 
function pauseAll ()
 
function pauseBatch (local sources)
 
function play ()
 
function playBatch (local sources)
 
function queue (local data, local offset, local length)
 Queues SoundData for playback in a queueable Source. More...
 
function removeEffect (local name)
 Disables the effect. More...
 
function removeFilter ()
 Disables filtering on this Source. More...
 
function seek (local offset)
 
function setAirAbsorptionFactor (local value)
 
function setCone (local innerAngle, local outerAngle, local outerVolume, local outerHighGain)
 
function setDirection (local v)
 
function setEffect (local name, local filterParams)
 Applies the given previously defined effect to this Source,
More...
 
function setFilter (local params)
 Sets a low-pass, high-pass, or band-pass filter to apply when playing the Source. More...
 
function setLooping (local enable)
 
function setLoopingPoint (local tStart, local tEnd)
 
function setMaxDistance (local value)
 
function setMaxVolume (local value)
 
function setMinVolume (local value)
 
function setPitch (local value)
 
function setPosition (local v)
 
function setReferenceDistance (local value)
 
function setRelative (local enable)
 
function setRolloffFactor (local value)
 
function setTime (local seconds)
 
function setVelocity (local v)
 
function setVolume (local value)
 
function stop ()
 
function stopAll ()
 
function stopBatch (local sources)
 
function tell ()
 

Member Function Documentation

◆ clone()

function clone ( )
Returns
audio.Source

◆ create()

function create ( local  sampleRate,
local  bitDepth,
local  channels,
local  buffers 
)
Parameters
sampleRatenumber
bitDepthnumber
channelsnumber
buffersnumber
Returns
audio.Source

◆ createFromDecoder()

function createFromDecoder ( local  decoder)
Parameters
decoderaudio.Decoder
Returns
audio.Source

◆ createFromSoundData()

function createFromSoundData ( local  soundData)
Parameters
soundDataaudio.SoundData
Returns
audio.Source

◆ getActiveEffects()

function getActiveEffects ( )

Gets a list of the Source's active effect names.

Returns
A list of the source's active effect names.
array_table

◆ getAirAbsorptionFactor()

function getAirAbsorptionFactor ( )
Returns
number

◆ getBitDepth()

function getBitDepth ( )
Returns
number

◆ getBytesPerFrame()

function getBytesPerFrame ( )
Returns
number

◆ getChannelCount()

function getChannelCount ( )
Returns
number

◆ getCone()

function getCone ( )
Returns
array_table

◆ getDirection()

function getDirection ( )
Returns
vec3_table

◆ getEffect()

function getEffect ( local  name)

Gets the filter settings associated to a specific effect.

This function returns empty map if the effect was applied with no filter settings associated to it.

Parameters
nameThe name of the effect.
Returns
The settings for the filter associated to this effect.
Parameters
namestring
Returns
map_table

◆ getFilter()

function getFilter ( )

Gets the filter settings currently applied to the Source.

Returns
The filter settings to use for this Source, or empty map if the Source has no active filter.
map_table

◆ getFreeBufferCount()

function getFreeBufferCount ( )

Gets the number of free buffer slots in a queueable Source.

If the queueable Source is playing, this value will increase up to the amount the Source was created with.

If the queueable Source is stopped, it will process all of its internal buffers first, in which case this

function will always return the amount it was created with.

Returns
How many more SoundData objects can be queued up.
number

◆ getLastError()

function getLastError ( )
Returns
string

◆ getLoopingEnd()

function getLoopingEnd ( )
Returns
number

◆ getLoopingStart()

function getLoopingStart ( )
Returns
number

◆ getMaxDistance()

function getMaxDistance ( )
Returns
number

◆ getMaxVolume()

function getMaxVolume ( )
Returns
number

◆ getMinVolume()

function getMinVolume ( )
Returns
number

◆ getPitch()

function getPitch ( )
Returns
number

◆ getPosition()

function getPosition ( )
Returns
vec3_table

◆ getReferenceDistance()

function getReferenceDistance ( )
Returns
number

◆ getRolloffFactor()

function getRolloffFactor ( )
Returns
number

◆ getSampleRate()

function getSampleRate ( )
Returns
number

◆ getTime()

function getTime ( )
Returns
number

◆ getTotalFrames()

function getTotalFrames ( )
Returns
number

◆ getTotalTime()

function getTotalTime ( )
Returns
number

◆ getVelocity()

function getVelocity ( )
Returns
vec3_table

◆ getVolume()

function getVolume ( )
Returns
number

◆ isFinished()

function isFinished ( )
Returns
boolean

◆ isLooping()

function isLooping ( )
Returns
boolean

◆ isPlaying()

function isPlaying ( )
Returns
boolean

◆ isRelative()

function isRelative ( )
Returns
boolean

◆ isSupportLoopingPoint()

function isSupportLoopingPoint ( )
Returns
boolean

◆ pause()

function pause ( )
Returns
audio.Source

◆ pauseAll()

function pauseAll ( )
Returns
array_table

◆ pauseBatch()

function pauseBatch ( local  sources)
Parameters
sourcesarray_table
Returns
audio.Source

◆ play()

function play ( )
Returns
boolean

◆ playBatch()

function playBatch ( local  sources)
Parameters
sourcesarray_table
Returns
boolean

◆ queue()

function queue ( local  data,
local  offset,
local  length 
)

Queues SoundData for playback in a queueable Source.

Parameters
dataThe data to queue. The SoundData's sample rate, bit depth, and channel count must match the Source's.
offset
length
Returns
True if the data was successfully queued for playback, false if there were no available buffers to use for queueing.
Parameters
dataaudio.SoundData
offsetnumber
lengthnumber
Returns
boolean

◆ removeEffect()

function removeEffect ( local  name)

Disables the effect.

Parameters
nameThe name of the effect previously set up with Engine::setEffect.
namestring
Returns
boolean

◆ removeFilter()

function removeFilter ( )

Disables filtering on this Source.

Returns
boolean

◆ seek()

function seek ( local  offset)
Parameters
offsetnumber
Returns
audio.Source

◆ setAirAbsorptionFactor()

function setAirAbsorptionFactor ( local  value)
Parameters
valuenumber
Returns
audio.Source

◆ setCone()

function setCone ( local  innerAngle,
local  outerAngle,
local  outerVolume,
local  outerHighGain 
)
Parameters
innerAnglenumber
outerAnglenumber
outerVolumenumber
outerHighGainnumber
Returns
audio.Source
重载
fun(self:audio.Source, param:array_table):audio.Source

◆ setDirection()

function setDirection ( local  v)
Parameters
vvec3_table
Returns
audio.Source

◆ setEffect()

function setEffect ( local  name,
local  filterParams 
)

Applies the given previously defined effect to this Source,

Parameters
namestring
filterParamsmap_table
Returns
boolean
重载
fun(self:audio.Source, name:string):boolean

◆ setFilter()

function setFilter ( local  params)

Sets a low-pass, high-pass, or band-pass filter to apply when playing the Source.

Parameters
paramsThe filter settings to use for this Source.
Returns
Whether the filter was successfully applied to the Source.
Note
Audio filter functionality is not supported on iOS.

While the cutoff frequency cannot be set directly, changing high/lowgain has the effect of altering the cutoff.

Parameters
paramsmap_table
Returns
boolean

◆ setLooping()

function setLooping ( local  enable)
Parameters
enableboolean
Returns
audio.Source

◆ setLoopingPoint()

function setLoopingPoint ( local  tStart,
local  tEnd 
)
Parameters
tStartnumber
tEndnumber
Returns
audio.Source

◆ setMaxDistance()

function setMaxDistance ( local  value)
Parameters
valuenumber
Returns
audio.Source

◆ setMaxVolume()

function setMaxVolume ( local  value)
Parameters
valuenumber
Returns
audio.Source

◆ setMinVolume()

function setMinVolume ( local  value)
Parameters
valuenumber
Returns
audio.Source

◆ setPitch()

function setPitch ( local  value)
Parameters
valuenumber
Returns
audio.Source

◆ setPosition()

function setPosition ( local  v)
Parameters
vvec3_table
Returns
audio.Source

◆ setReferenceDistance()

function setReferenceDistance ( local  value)
Parameters
valuenumber
Returns
audio.Source

◆ setRelative()

function setRelative ( local  enable)
Parameters
enableboolean
Returns
audio.Source

◆ setRolloffFactor()

function setRolloffFactor ( local  value)
Parameters
valuenumber
Returns
audio.Source

◆ setTime()

function setTime ( local  seconds)
Parameters
secondsnumber
Returns
audio.Source

◆ setVelocity()

function setVelocity ( local  v)
Parameters
vvec3_table
Returns
audio.Source

◆ setVolume()

function setVolume ( local  value)
Parameters
valuenumber
Returns
audio.Source

◆ stop()

function stop ( )
Returns
audio.Source

◆ stopAll()

function stopAll ( )
Returns
audio.Source

◆ stopBatch()

function stopBatch ( local  sources)
Parameters
sourcesarray_table
Returns
audio.Source

◆ tell()

function tell ( )
Returns
number

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