ElementSoundPlayer Class

Definition

Represents a player for XAML control sounds.

public ref class ElementSoundPlayer sealed
/// [Windows.Foundation.Metadata.ContractVersion(Microsoft.UI.Xaml.WinUIContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
class ElementSoundPlayer final
[Windows.Foundation.Metadata.ContractVersion(typeof(Microsoft.UI.Xaml.WinUIContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
public sealed class ElementSoundPlayer
Public NotInheritable Class ElementSoundPlayer
Inheritance
Object Platform::Object IInspectable ElementSoundPlayer
Attributes

Examples

Tip

For more info, design guidance, and code examples, see Sound.

The WinUI 3 Gallery app includes interactive examples of most WinUI 3 controls, features, and functionality. Get the app from the Microsoft Store or get the source code on GitHub.

Remarks

For more info, see Sound design guidance.

Properties

SpatialAudioMode

Gets or sets a value that indicates whether spatial audio is on, off, or handled automatically.

State

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

Volume

Gets or sets the volume of the sounds played by the Play method.

Methods

Play(ElementSoundKind)

Plays the specified sound.

Applies to