Commands

tone

Supported By

Syntax

tone frequency [for duration [unit]]

Frequency and duration yield numbers. Unit is hour, hours, min, mins, minute, minutes, sec, secs, second, seconds, tick, ticks, milli, millis, millisecond, or milliseconds.

Description

The tone command plays a tone of a single frequency (in Hz) for a specified duration. Unless specified, the default unit for the duration is ticks, or sixtieths of a second. The volume of the generated tone is determined by the toneVolume property.

Note

The tone command is asynchronous: it will return immediately while the tone keeps playing in the background. If there is already a tone playing on the current toneChannel, the next tone to be played will be added to a queue. The stop tone command will stop all currently-playing and pending tones on all toneChannels.

See Also

stop, tone, toneVolume, toneChannel