SOUND

SOUND N

CREATES A SYSTEM OBJECT SOUND AND ALLOCATES IT NUMBER N AS REFERENCE

  • Type: Command
  • Parameter: 1
  • Group: System Objects Creation

ACTION

The command creates a system object SOUND, and allocates it a number N. The number N will be used to designate the SOUND.

The created SOUND can then be used through the appropriated commands (PLAY, STOP, ...), but is not visible.

A SOUND plays a sound file loaded by FILE_LOAD.

A SOUND cannot generate an event.

Remark: by default, the SOUND is created on the FORM number 0, but another FORM can be used. For that, create a FORM by FORM N, and send it all the commands by COMMAND_TARGET_IS N before creating the SOUND.

SYNTAX: SOUND N

  • N = system object number (integer or real). Must be greater than 0 and less than or equal to the allowed maximum number of system objects.

USE

  • A SOUND is used to play a sound file (WAV, MP3).
  • The sound file must be loaded first by FILE_LOAD.

ERROR

  • If number N is not a correct expression.
  • If number N exceeds the allowed maximum number of system objects.
  • If number N is less than or equal to 0.
  • If number N is already used for a system object number.

EXAMPLE

rem Create a Sound

sound 1

rem Load a sound file

file_load 1,"crack.wav"

rem Play the sound

play 1

SEE ALSO

FILE_LOAD

PLAY