SoundBeep

Emits a tone from the PC speaker.

SoundBeep Frequency, Duration

Note: On Linux and macOS, the requested tone is synthesized and played through an audio player. On Linux, if none of the players listed under SoundPlay is installed, an error is thrown.

Parameters

Frequency

Type: Integer

If omitted, it defaults to 523. Otherwise, specify the frequency of the sound, a number from 37 through 32767. A value outside that range throws a ValueError.

Duration

Type: Integer

If omitted or negative, it defaults to 150. Otherwise, specify the duration of the sound, in milliseconds. Zero produces no sound.

Remarks

The script waits for the sound to finish before continuing. In addition, system responsiveness might be reduced during sound production.

If the computer lacks a sound card, a standard beep is played through the PC speaker.

To produce the standard system sounds instead of beeping the PC Speaker, see the asterisk mode of SoundPlay.

SoundPlay

Examples

Plays the default pitch and duration.

SoundBeep

Plays a higher pitch for half a second.

SoundBeep 750, 500