Skip to main content

Sound

Sound (Statement)

Format

sound frequency, duration
sound ( frequency, duration )
sound array[]
sound ( array[] )
sound { frequency1, duration1, frequency2, duration2, ... }
sound filename
sound url
sound resource
sound player#

Polyphonic Sounds

sound array[,]
sound ( array[,] )
sound { { frequency1, duration1 }, { frequency2, duration2 }, ... }

Description

Play a sound from the computer’s speakers.Frequency is expressed in Hz and duration is expressed in milliseconds (1000 in a second). An array or list containing frequency and duration may also be passed. This eliminates any clicking between sounds when more than one is being output sequentially.

One dimensional arrays and lists must have an even number of values. A two dimensional array may have any number of rows but must have two columns.

A media filename or url, a resource string from SoundLoad, or a player# from SoundPlayer may also be passed. Sound is the blocking twin of SoundPlay — same arguments, but it waits for playback to finish before the next line runs.

See Also

Say, SoundLength, SoundLoad, SoundPause, SoundPlay, SoundPlayer, SoundPosition, SoundSeek, SoundState, SoundStop, SoundVolume, SoundWait, Volume

History

0.9.5gSound support for LINUX systems was added
0.9.5hWindows sound was changed to use the default sound device
1.99.99.55two dimensional list support was added
1.99.99.72polyphonic sounds were added and the [] on array variables is now required