Previous Book Contents Book Index Next

Inside Macintosh: Sound /
Chapter 1 - Introduction to Sound on the Macintosh / Sound Reference
Routines / Playing Sounds


Legacy Documentclose button

Important: Inside Macintosh: Sound is deprecated as of Mac OS X v10.5. For new audio development in Mac OS X, use Core Audio. See the Audio page in the ADC Reference Library.

SysBeep

You can use the SysBeep procedure to play the system alert sound.

PROCEDURE SysBeep (duration: Integer);
duration
The duration (in ticks) of the resulting sound. This parameter is ignored except on a Macintosh Plus, Macintosh SE, or Macintosh Classic when the system alert sound is the Simple Beep. The recommended duration is 30 ticks, which equals one-half second.
DESCRIPTION
The SysBeep procedure causes the Sound Manager to play the system alert sound at its current volume. If necessary, the Sound Manager loads into memory the sound resource containing the system alert sound and links it to a sound channel. The user selects a system alert sound in the Alert Sounds subpanel of the Sound control panel.

The volume of the sound produced depends on the current setting of the system alert sound volume, which the user can adjust in the Alert Sounds subpanel of the Sound control panel. The system alert sound volume can also be read and set by calling the GetSysBeepVolume and SetSysBeepVolume routines. If the volume is set to 0 (silent) and the system alert sound is enabled, calling SysBeep causes the menu bar to blink once.

SPECIAL CONSIDERATIONS
Because the SysBeep procedure moves memory, you should not call it at interrupt time.

SEE ALSO
For information on enabling and disabling the system alert sound or for information on reading and adjusting the system alert sound volume, see the chapter "Sound Manager" in this book.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
2 JUL 1996