Soloud core class.

Static methods

@:has_untypedstaticinlinecreate():Soloud

Methods

@:has_untypedinlinedestroy():Void

@:value({ channels : 2, bufferSize : 0, samplerate : 0, backend : AUTO, flags : 0 })init(flags:SoloudFlags = 0, backend:SoloudBackends = AUTO, samplerate:UInt32 = 0, bufferSize:UInt32 = 0, channels:UInt32 = 2):Result

Initialize SoLoud. Must be called before SoLoud can be used.

deinit():Void

Deinitialize SoLoud. Must be called before shutting down.

getVersion():UInt32

Query SoLoud version number (should equal to SOLOUD_VERSION macro)

getErrorString(aErrorCode:SoloudErrors):ConstCharStar

Translate error number to an asciiz string

getBackendId():SoloudBackends

Returns current backend ID (BACKENDS enum)

getBackendString():ConstCharStar

Returns current backend string. May be NULL.

getBackendChannels():UInt32

Returns current backend channel count (1 mono, 2 stereo, etc)

getBackendSamplerate():UInt32

Returns current backend sample rate

getBackendBufferSize():UInt32

Returns current backend buffer size

setSpeakerPosition(aChannel:UInt32, aX:Float32, aY:Float32, aZ:Float32):Result

Set speaker position in 3d space

getSpeakerPosition(aChannel:UInt32, aX:Reference<Float32>, aY:Reference<Float32>, aZ:Reference<Float32>):Result

Get speaker position in 3d space

@:value({ aBus : 0, aPaused : false, aPan : 0.0, aVolume : -1.0 })inlineplay(aSound:AudioSource, aVolume:Float32 = -1.0, aPan:Float32 = 0.0, aPaused:Bool = false, aBus:UInt32 = 0):Handle

Start playing a sound. Returns voice handle, which can be ignored or used to alter the playing sound's parameters. Negative volume means to use default.

@:value({ aBus : 0, aPan : 0.0, aVolume : -1.0 })inlineplayClocked(aSoundTime:Time, aSound:AudioSource, aVolume:Float32 = -1.0, aPan:Float32 = 0.0, aBus:UInt32 = 0):Handle

Start playing a sound delayed in relation to other sounds called via this function. Negative volume means to use default.

@:value({ aBus : 0, aPaused : false, aVolume : 1.0, aVelZ : 0.0, aVelY : 0.0, aVelX : 0.0 })inlineplay3d(aSound:AudioSource, aPosX:Float32, aPosY:Float32, aPosZ:Float32, aVelX:Float32 = 0.0, aVelY:Float32 = 0.0, aVelZ:Float32 = 0.0, aVolume:Float32 = 1.0, aPaused:Bool = false, aBus:UInt32 = 0):Handle

Start playing a 3d audio source

@:value({ aBus : 0, aVolume : 1.0, aVelZ : 0.0, aVelY : 0.0, aVelX : 0.0 })inlineplay3dClocked(aSoundTime:Time, aSound:AudioSource, aPosX:Float32, aPosY:Float32, aPosZ:Float32, aVelX:Float32 = 0.0, aVelY:Float32 = 0.0, aVelZ:Float32 = 0.0, aVolume:Float32 = 1.0, aBus:UInt32 = 0):Handle

Start playing a 3d audio source, delayed in relation to other sounds called via this function.

@:value({ aBus : 0, aPaused : false, aVolume : -1.0 })inlineplayBackground(aSound:AudioSource, aVolume:Float32 = -1.0, aPaused:Bool = false, aBus:UInt32 = 0):Handle

Start playing a sound without any panning. It will be played at full volume.

seek(aVoiceHandle:Handle, aSeconds:Time):Result

Seek the audio stream to certain point in time. Some streams can't seek backwards. Relative play speed affects time.

stop(aVoiceHandle:Handle):Void

Stop the sound.

stopAll():Void

Stop all voices.

inlinestopAudioSource(aSound:AudioSource):Void

Stop all voices that play this sound source

inlinecountAudioSource(aSound:AudioSource):Int32

Count voices that play this audio source

setFilterParameter(aVoiceHandle:Handle, aFilterId:UInt32, aAttributeId:UInt32, aValue:Float32):Void

Set a live filter parameter. Use 0 for the global filters.

getFilterParameter(aVoiceHandle:Handle, aFilterId:UInt32, aAttributeId:UInt32):Float32

Get a live filter parameter. Use 0 for the global filters.

fadeFilterParameter(aVoiceHandle:Handle, aFilterId:UInt32, aAttributeId:UInt32, aTo:Float32, aTime:Time):Void

Fade a live filter parameter. Use 0 for the global filters.

oscillateFilterParameter(aVoiceHandle:Handle, aFilterId:UInt32, aAttributeId:UInt32, aFrom:Float32, aTo:Float32, aTime:Time):Void

Oscillate a live filter parameter. Use 0 for the global filters.

getStreamTime(aVoiceHandle:Handle):Time

Get current play time, in seconds.

getStreamPosition(aVoiceHandle:Handle):Time

Get current sample position, in seconds.

getPause(aVoiceHandle:Handle):Bool

Get current pause state.

getVolume(aVoiceHandle:Handle):Float32

Get current volume.

getOverallVolume(aVoiceHandle:Handle):Float32

Get current overall volume (set volume * 3d volume)

getPan(aVoiceHandle:Handle):Float32

Get current pan.

getSamplerate(aVoiceHandle:Handle):Float32

Get current sample rate.

getProtectVoice(aVoiceHandle:Handle):Bool

Get current voice protection state.

getActiveVoiceCount():UInt32

Get the current number of busy voices.

getVoiceCount():UInt32

Get the current number of voices in SoLoud

isValidVoiceHandle(aVoiceHandle:Handle):Bool

Check if the handle is still valid, or if the sound has stopped.

getRelativePlaySpeed(aVoiceHandle:Handle):Float32

Get current relative play speed.

getPostClipScaler():Float32

Get current post-clip scaler value.

getGlobalVolume():Float32

Get current global volume

getMaxActiveVoiceCount():UInt32

Get current maximum active voice setting

getLooping(aVoiceHandle:Handle):Bool

Query whether a voice is set to loop.

getLoopPoint(aVoiceHandle:Handle):Time

Get voice loop point value

setLoopPoint(aVoiceHandle:Handle, aLoopPoint:Time):Void

Set voice loop point value

setLooping(aVoiceHandle:Handle, aLooping:Bool):Void

Set voice's loop state

setMaxActiveVoiceCount(aVoiceCount:UInt32):Result

Set current maximum active voice setting

setInaudibleBehavior(aVoiceHandle:Handle, aMustTick:Bool, aKill:Bool):Void

Set behavior for inaudible sounds

setGlobalVolume(aVolume:Float32):Void

Set the global volume

setPostClipScaler(aScaler:Float32):Void

Set the post clip scaler value

setPause(aVoiceHandle:Handle, aPause:Bool):Void

Set the pause state

setPauseAll(aPause:Bool):Void

Pause all voices

setRelativePlaySpeed(aVoiceHandle:Handle, aSpeed:Float32):Result

Set the relative play speed

setProtectVoice(aVoiceHandle:Handle, aProtect:Bool):Void

Set the voice protection state

setSamplerate(aVoiceHandle:Handle, aSamplerate:Float32):Void

Set the sample rate

setPan(aVoiceHandle:Handle, aPan:Float32):Void

Set panning value; -1 is left, 0 is center, 1 is right

@:value({ aSVolume : 0, aCVolume : 0, aRBVolume : 0, aLBVolume : 0 })setPanAbsolute(aVoiceHandle:Handle, aLVolume:Float32, aRVolume:Float32, aLBVolume:Float32 = 0, aRBVolume:Float32 = 0, aCVolume:Float32 = 0, aSVolume:Float32 = 0):Void

Set absolute left/right volumes

setVolume(aVoiceHandle:Handle, aVolume:Float32):Void

Set overall volume

setDelaySamples(aVoiceHandle:Handle, aSamples:UInt32):Void

Set delay, in samples, before starting to play samples. Calling this on a live sound will cause glitches.

fadeVolume(aVoiceHandle:Handle, aTo:Float32, aTime:Time):Void

Set up volume fader

fadePan(aVoiceHandle:Handle, aTo:Float32, aTime:Time):Void

Set up panning fader

fadeRelativePlaySpeed(aVoiceHandle:Handle, aTo:Float32, aTime:Time):Void

Set up relative play speed fader

fadeGlobalVolume(aTo:Float32, aTime:Time):Void

Set up global volume fader

schedulePause(aVoiceHandle:Handle, aTime:Time):Void

Schedule a stream to pause

scheduleStop(aVoiceHandle:Handle, aTime:Time):Void

Schedule a stream to stop

oscillateVolume(aVoiceHandle:Handle, aFrom:Float32, aTo:Float32, aTime:Time):Void

Set up volume oscillator

oscillatePan(aVoiceHandle:Handle, aFrom:Float32, aTo:Float32, aTime:Time):Void

Set up panning oscillator

oscillateRelativePlaySpeed(aVoiceHandle:Handle, aFrom:Float32, aTo:Float32, aTime:Time):Void

Set up relative play speed oscillator

oscillateGlobalVolume(aFrom:Float32, aTo:Float32, aTime:Time):Void

Set up global volume oscillator

setGlobalFilter(aFilterId:UInt32, aFilter:Filter):Void

Set global filters. Set to NULL to clear the filter.

setVisualizationEnable(aEnable:Bool):Void

Enable or disable visualization data gathering

calcFFT():Pointer<Float32>

Calculate and get 256 floats of FFT data for visualization. Visualization has to be enabled before use.

getWave():Pointer<Float32>

Get 256 floats of wave data for visualization. Visualization has to be enabled before use.

getApproximateVolume(aChannel:UInt32):Float32

Get approximate output volume for a channel for visualization. Visualization has to be enabled before use.

getLoopCount(aVoiceHandle:Handle):UInt32

Get current loop count. Returns 0 if is:Handle not valid. (All audio sources may not update loop count)

getInfo(aVoiceHandle:Handle, aInfoKey:UInt32):Float32

Get audiosource-specific information from a voice.

createVoiceGroup():Handle

Create a voice group. Returns 0 if unable (out of voice groups / out of memory)

destroyVoiceGroup(aVoiceGroupHandle:Handle):Result

Destroy a voice group.

addVoiceToGroup(aVoiceGroupHandle:Handle, aVoiceHandle:Handle):Result

Add a voice to:Handle a voice group

isVoiceGroup(aVoiceGroupHandle:Handle):Bool

Is this a:Handle valid voice group?

isVoiceGroupEmpty(aVoiceGroupHandle:Handle):Bool

Is this voice group empty?

update3dAudio():Void

Perform 3d audio parameter update

set3dSoundSpeed(aSpeed:Float32):Result

Set the speed of sound constant for doppler

get3dSoundSpeed():Float32

Get the current speed of sound constant for doppler

@:value({ aVelocityZ : 0.0, aVelocityY : 0.0, aVelocityX : 0.0 })set3dListenerParameters(aPosX:Float32, aPosY:Float32, aPosZ:Float32, aAtX:Float32, aAtY:Float32, aAtZ:Float32, aUpX:Float32, aUpY:Float32, aUpZ:Float32, aVelocityX:Float32 = 0.0, aVelocityY:Float32 = 0.0, aVelocityZ:Float32 = 0.0):Void

Set 3d listener parameters

set3dListenerPosition(aPosX:Float32, aPosY:Float32, aPosZ:Float32):Void

Set 3d listener position

set3dListenerAt(aAtX:Float32, aAtY:Float32, aAtZ:Float32):Void

Set 3d listener "at" vector

set3dListenerUp(aUpX:Float32, aUpY:Float32, aUpZ:Float32):Void

set 3d listener "up" vector

set3dListenerVelocity(aVelocityX:Float32, aVelocityY:Float32, aVelocityZ:Float32):Void

Set 3d listener velocity

@:value({ aVelocityZ : 0.0, aVelocityY : 0.0, aVelocityX : 0.0 })set3dSourceParameters(aVoiceHandle:Handle, aPosX:Float32, aPosY:Float32, aPosZ:Float32, aVelocityX:Float32 = 0.0, aVelocityY:Float32 = 0.0, aVelocityZ:Float32 = 0.0):Void

Set 3d audio source parameters

set3dSourcePosition(aVoiceHandle:Handle, aPosX:Float32, aPosY:Float32, aPosZ:Float32):Void

Set 3d audio source position

set3dSourceVelocity(aVoiceHandle:Handle, aVelocityX:Float32, aVelocityY:Float32, aVelocityZ:Float32):Void

Set 3d audio source velocity

set3dSourceMinMaxDistance(aVoiceHandle:Handle, aMinDistance:Float32, aMaxDistance:Float32):Void

Set 3d audio source min/max distance (distance < min means max volume)

set3dSourceAttenuation(aVoiceHandle:Handle, aAttenuationModel:UInt32, aAttenuationRolloffFactor:Float32):Void

Set 3d audio source attenuation parameters

set3dSourceDopplerFactor(aVoiceHandle:Handle, aDopplerFactor:Float32):Void

Set 3d audio source doppler factor to reduce or enhance doppler effect. Default = 1.0

mix(aBuffer:Pointer<Float32>, aSamples:UInt32):Void

Returns mixed samples:cpp.Float32 in buffer. Called by the back-end, or user with null driver.

mixSigned16(aBuffer:Pointer<UInt16>, aSamples:UInt32):Void

Returns mixed 16-bit signed integer samples in buffer. Called by the back-end, or user with null driver.