System.Sound.beep method

[ The Windows Gadget Platform/Sidebar is available for use in the operating systems specified in the Requirements section. It may be altered or unavailable in subsequent versions. ]

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 [desktop apps only]
Minimum supported server
Windows Server 2008 [desktop apps only]
End of client support
Windows 7
End of server support
Windows Server 2008
Header
Utilapiset.h
IDL
Sidebar.idl
DLL
Sidebar.Exe (version 1.00 or later)