Sound

Struct representing a single sound effect to be played via a SoundComponent or the SoundSystem.

Summary
SoundStruct representing a single sound effect to be played via a SoundComponent or the SoundSystem.
Functions
NKPlay3DGlobalPlays this sound as a 3D global effect.
NKPlayMenuSoundPlays this sound effect in the menu.
NKPlay3DSoundPlay this 3D sound at a specific location.
NKPlayAmbientPlays this sound as an ambient effect.
NKStopSoundStop an instance of this Sound playing on a specific audio buffer.
NKStopAllStops all instances of this Sound.
NKSetVolumeSets the volume for this sound on a scale of 0 to 1.
NKIsPlayingReturns the playing status of this Sound on a specific audio buffer.

Functions

NKPlay3DGlobal

Plays this sound as a 3D global effect.  This sound will only be audible in the playing game state.

Parameters

boolIf true, this sound will loop until explicitly stopped.

Returns

intThe audio buffer index this sound is playing on.  The audio buffer index is used for querying and stopping this instance of the Sound effect.

NKPlayMenuSound

Plays this sound effect in the menu.  Note that this sound will be muted if this is called while the user is not in the menu.

Parameters

boolIf true, this sound will loop until explicitly stopped.

Returns

intThe audio buffer index this sound is playing on.  The audio buffer index is used for querying and stopping this instance of the Sound effect.

NKPlay3DSound

Play this 3D sound at a specific location.  This sound will only be audible in the playing game state.

Parameters

boolIf true, this sound will loop until explicitly stopped.
vec3The location in the world to play this sound at.
vec3The velocity of the sound.
floatThe minimum distance before the fall-off will be applied.
floatThe maximum distance before the audio has fully fallen-off.

NKPlayAmbient

Plays this sound as an ambient effect.  This sound will only be audible in the playing game state.

Parameters

boolIf true, this sound will loop until explicitly stopped.
floatHow long to fade this sound in over.  This parameter is optional.

Returns

intThe audio buffer index this sound is playing on.  The audio buffer index is used for querying and stopping this instance of the Sound effect.

NKStopSound

Stop an instance of this Sound playing on a specific audio buffer.

Parameters

intThe audio buffer index to stop this Sound on.

NKStopAll

Stops all instances of this Sound.

Parameters

floatHow long to fade this sound out over.  This parameter is optional.

NKSetVolume

Sets the volume for this sound on a scale of 0 to 1.

Parameters

floatThe volume level, on a scale of 0 to 1.

NKIsPlaying

Returns the playing status of this Sound on a specific audio buffer.

Parameters

intThe audio buffer index to check.

Returns

booltrue if the this sound is playing on the provided audio buffer.
Close