ElementSoundPlayer ElementSoundPlayer ElementSoundPlayer Class

Definition

Represents a player for XAML control sounds.

public : sealed class ElementSoundPlayer : IElementSoundPlayer
public sealed class ElementSoundPlayer : IElementSoundPlayer
Public NotInheritable Class ElementSoundPlayer Implements IElementSoundPlayer
Attributes
Windows 10 requirements
Device family
Windows 10 Anniversary Edition (introduced v10.0.14393.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v3)

Remarks

For more info, see Sound in UWP apps.

Properties

State State State

Gets or sets a value that specifies whether the system plays control sounds.

public : static ElementSoundPlayerState State { get; set; }
public static ElementSoundPlayerState State { get; set; }
Public Static ReadWrite Property State As ElementSoundPlayerState
Value
ElementSoundPlayerState ElementSoundPlayerState ElementSoundPlayerState

A value of the enumeration that specifies whether the system plays control sounds. The default is Auto.

Remarks

By default, control sounds are played on the Xbox, and are not played on other devices families. You can set ElementSoundPlayerState to On to make your app play sounds on all device families, or set it to Off to disable sounds on all device families.

For more info, see Sound in UWP apps.

Volume Volume Volume

Gets or sets the volume of the sounds played by controls.

public : static double Volume { get; set; }
public static double Volume { get; set; }
Public Static ReadWrite Property Volume As double
Value
double double double

The volume of the sounds played by controls. The default is 1.0.

Remarks

You can set the Volume property to reduce the volume relative to the system volume. 1.0 is the maximum and is equal to the system volume. 0.0 is the minimum and is the same as muted.

For more info, see Sound in UWP apps.

Methods

Play(ElementSoundKind) Play(ElementSoundKind) Play(ElementSoundKind)

Plays the specified sound.

public : static void Play(ElementSoundKind sound)
public static void Play(ElementSoundKind sound)
Public Static Function Play(sound As ElementSoundKind) As void
Parameters
sound
ElementSoundKind ElementSoundKind ElementSoundKind

A value of the enumeration that specifies the sound to play.

Remarks

For more info, see Sound in UWP apps.

See Also