Skip to content

class Sound (client-side)

Available since version: 0.1.2

This class represents 2d sound.

Constructor

string fileName

Parameters:

  • string fileName: the name of the WAV audio file.

Properties

float playingTime (read-only)

Available since version: 0.1.2

Represents the sound playing time in miliseconds.


float volume

Available since version: 0.1.2

Represents the sound volume scale in range 0.0 to 1.0.


bool looping

Available since version: 0.1.2

Represents the sound looping feature.


float balance

Available since version: 0.1.2

Represents the sound balance between left speaker and right speaker in range -1.0 to 1.0.


Methods

play

Available since version: 0.1.2

This method will play the sound.

void play()

stop

Available since version: 0.1.2

This method will stop the sound.

void stop()

isPlaying

Available since version: 0.1.10

This method is used to check whether the sound is currently playing.

bool isPlaying()

Returns bool:

true if the sound is currently playing, otherwise false.