Share via


System.Sound.beep Method

Plays a simple waveform sound.

Syntax

System.Sound.beep()

Parameters

This method has no parameters.

Return Value

This method does not return a value.

Remarks

After queuing the sound, control is returned to the calling function and the sound plays asynchronously.

Muting and volume control have no effect on System.Sound.beep.

Examples

The following example demonstrates how to play the beep sound every second.

var tHours;
var tMinutes;
var tSeconds;
var oSelectedTimeZone = System.Time.currentTimeZone;

// --------------------------------------------------------------------
// Initialize the gadget.
// --------------------------------------------------------------------
function Init()
{    
    // Initialize the time display.
    DisplayTime();
    setInterval("DisplayTime()",1000);
}

// --------------------------------------------------------------------
// Display the system time based on selected time zone.
// --------------------------------------------------------------------
function DisplayTime()
{
    // Retrieve the local time.
    var sTimeInfo = System.Time.getLocalTime(oSelectedTimeZone);
    if (sTimeInfo != "")
    {
        System.Sound.beep();
        var dDateInfo = new Date(Date.parse(sTimeInfo));   
        tHours = dDateInfo.getHours();
        tMinutes = dDateInfo.getMinutes();
        tMinutes = ((tMinutes < 10) ? ":0" : ":") + tMinutes
        tSeconds = dDateInfo.getSeconds();
        tSeconds = ((tSeconds < 10) ? ":0" : ":") + tSeconds;
        timeDisplay.innerHTML = tHours + tMinutes + tSeconds;
    }
    else
    {
        // Display something else.
    }
}

Requirements

Minimum supported client Windows Vista
Minimum supported server Windows Server 2008
IDL Sidebar.idl
DLL Sidebar.Exe version 1.00 or later

See Also

System.Sound

 

 

Send comments about this topic to Microsoft

Build date: 2/24/2010

Build type: SDK