Share via


ElementSoundPlayer Classe

Définition

Représente un lecteur pour les sons de contrôle XAML.

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
Héritage
Object Platform::Object IInspectable ElementSoundPlayer
Attributs

Exemples

Conseil

Pour plus d’informations, des conseils de conception et des exemples de code, consultez Sound.

L’application WinUI 3 Gallery comprend des exemples interactifs de la plupart des contrôles et des fonctionnalités WinUI 3. Procurez-vous l’application sur le Microsoft Store ou le code source sur GitHub.

Remarques

Pour plus d’informations, consultez Guide de conception sonore.

Propriétés

SpatialAudioMode

Obtient ou définit une valeur qui indique si l’audio spatial est activé, désactivé ou géré automatiquement.

State

Obtient ou définit une valeur qui spécifie si le système lit les sons de contrôle.

Volume

Obtient ou définit le volume des sons joués par la méthode Play.

Méthodes

Play(ElementSoundKind)

Lit le son spécifié.

S’applique à