ElementSoundPlayer Class
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Represents a player for XAML control sounds.
public ref class ElementSoundPlayer sealed
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 196608)]
/// [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(Windows.Foundation.UniversalApiContract), 196608)]
[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
- Attributes
Device family |
Windows 10 Anniversary Edition (introduced in 10.0.14393.0)
|
API contract |
Windows.Foundation.UniversalApiContract (introduced in v3.0)
|
Tip
For more info, design guidance, and code examples, see Sound.
If you have the WinUI 2 Gallery app installed, click here to open the app and see the ElementSoundPlayer in action.
For more info, see Sound in UWP apps.
Windows version | SDK version | Value added |
---|---|---|
1803 | 17134 | SpatialAudioMode |
Spatial |
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. |
Play(Element |
Plays the specified sound. |
Product | Versions |
---|---|
WinRT | Build 14383, Build 15063, Build 16299, Build 17134, Build 17763, Build 18362, Build 19041, Build 20348, Build 22000, Build 22621, Build 26100 |