SOUND

SOUND freq, dur [, vol] [BG]

Plays a sound with the frequency freg in Hz for a duration dur in milliseconds. The optional parameter vol controls the volume of the sound. Volume is in the range from 0 to 100, where 100 is maximum volume. If the optional parameter BG is given, the sound will play in the background: SmallBASIC will not wait with program execution until the sound has finished.

Example1 : Play sound

Sound 1000, 800, 50             ' 1000 Hz, 800 ms, 50% volume

Example 2: Play sound in background

Sound 1000, 800, 50 BG          ' 1000 Hz, 800 ms, 50% volume
print "This line will be printed immediately"
pause
Console
If there is insufficient information on this page and you wish learn more about SOUND, please send an email to smallbasic@gmail.com. You can help to improve information about SOUND by submitting a pull request, click View Source for details. Note, an offline language reference text file is also available - see the Download section.