ElementSoundPlayer
ElementSoundPlayer
ElementSoundPlayer
ElementSoundPlayer
Class
Definition
Represents a player for XAML control sounds.
public : sealed class ElementSoundPlayer : IElementSoundPlayerpublic sealed class ElementSoundPlayer : IElementSoundPlayerPublic NotInheritable Class ElementSoundPlayer Implements IElementSoundPlayer// This API is not available in Javascript.
- Attributes
| 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 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// This API is not available in Javascript.
- Value
- ElementSoundPlayerState 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 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// This API is not available in Javascript.
- Value
- double 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) 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// This API is not available in Javascript.
A value of the enumeration that specifies the sound to play.
Remarks
For more info, see Sound in UWP apps.