sound

The souind library provides methods to create create and play sound effects and background music.

Summary
soundThe souind library provides methods to create create and play sound effects and background music.
Functions
sound.newSoundCreates a simple sound effect using a Sprite Kit action.
sound.newAudioPlayerCreates an AVAuidoPlayer object that can be used to play sounds or background music.
sound.playPlay a previously created sound.

Functions

sound.newSound

function sound.newSound(filename,
wait)

Creates a simple sound effect using a Sprite Kit action.

Parameters

filenameThe name of the sound file.
waitWhether or not to wait for a sound to complete once it starts playing - defaults to false.

Returns

The created sound action.

See Also

sound.play

sound.newAudioPlayer

function sound.newAudioPlayer(filename)

Creates an AVAuidoPlayer object that can be used to play sounds or background music.

Parameters

filenameThe name of the sound file with which to initialize the sound player.

Returns

The created audio player.

See Also

<audioplayer>

sound.play

function sound.play(sound)

Play a previously created sound.

Parameters

soundA sound object created with the sound.newSound function.

Returns

nothing

function sound.newSound(filename,
wait)
Creates a simple sound effect using a Sprite Kit action.
function sound.newAudioPlayer(filename)
Creates an AVAuidoPlayer object that can be used to play sounds or background music.
function sound.play(sound)
Play a previously created sound.
The souind library provides methods to create create and play sound effects and background music.
Close