Beep

From VLECK
Jump to: navigation, search

Beeps a sound through the speaker. Program execution is suspended until silence returns.

Syntax

return = Beep(frequency; duration);

Return Value

Returns 1 if the function was succesful, i.e. the frequency in the range [37; 32767] and duration in the range [1; →>. If either parameter is within the range [-1; +1] the function returns null; Otherwise the function returns null. Beware: negative numbers for duration are interpreted as very large positive integers!

Parameters

frequency frequency of the sound in Hz
duration duration of the sound in msec

Example

// sounds an A for 3 seconds:

beep(440; 3000)
1