Play Sound

Plays a sound and allows volume and balance to be specified.

Syntax

Play Sound sound
Play Sound sound,balance,volume,priority

Description

Plays the sound at the specified volume.

sound is the index of the sound in the currently loaded sound bank.

balance is a number between 0 and 100. 0 signifies all the sound will come from the left speaker, 100 signifies all the sound will come from the right speaker.

volume is the amplitude of the sound. This can be between 0 (silent) and 255 (maximum).

priority be any number between 0 and 65535. TNT Basic can only play 4 sounds at any one time. The higher the priority of a sound, the more likely it will be get played. This is because it will be able to override lower priority sounds (i.e. the lower priority sound will be stopped and this will be played instead.)

Once the command has finished the sound being played will be allocated a channel. To get the id of this channel call the function Sound Result.


Table of contents