enableSound()

Switches the sound of a wave file during runtime (see Configuration file).

Synopsis

bool enableSound(int type, bool enable [, string fileName]);

Parameters

Parameter Meaning
type

Type of the event that starts the sound:

SOUND_CLICK (1)

SOUND_RIGHTCLICK (2)

SOUND_DBLCLICK (3)

enable State (enable 1, disable 0)
fileName Name of the wave file (searched for in the directory <PROJ_PATH>/data/sounds or <wincc_oa_path>/data/sounds).

Return value

1 with sound, 0 without sound.

Error

Missing arguments, incorrect arguments.

Description

Switches the sound of a wave file during runtime (see Configuration file).

Example

The following script plays the sound of the file "police.wav" provided with the WinCC OA installation.

main()
{
   enableSound( 1, TRUE, "police.wav" );
}

Assignment

Miscellaneous functions

Availability

UI

See also

Configuration file, startSound(), stopSound()