SoundPlayer Constructeurs

Définition

Initialise une nouvelle instance de la classe SoundPlayer.

Surcharges

SoundPlayer()

Initialise une nouvelle instance de la classe SoundPlayer.

SoundPlayer(Stream)

Initialise une nouvelle instance de la classe SoundPlayer et attache le fichier .wav au Stream spécifié.

SoundPlayer(String)

Initialise une nouvelle instance de la classe SoundPlayer et attache le fichier .wav spécifié.

SoundPlayer(SerializationInfo, StreamingContext)
Obsolète.

Initialise une nouvelle instance de la classe SoundPlayer.

SoundPlayer()

Source:
SoundPlayer.cs
Source:
SoundPlayer.cs
Source:
SoundPlayer.cs

Initialise une nouvelle instance de la classe SoundPlayer.

public:
 SoundPlayer();
public SoundPlayer ();
Public Sub New ()

Remarques

Ce constructeur initialise un SoundPlayer sans source audio. Tant qu’il n’est pas configuré avec un chemin de source audio, le SoundPlayer diffuse un signal sonore lorsque l’une de ses méthodes de lecture est appelée.

Voir aussi

S’applique à

SoundPlayer(Stream)

Source:
SoundPlayer.cs
Source:
SoundPlayer.cs
Source:
SoundPlayer.cs

Initialise une nouvelle instance de la classe SoundPlayer et attache le fichier .wav au Stream spécifié.

public:
 SoundPlayer(System::IO::Stream ^ stream);
public SoundPlayer (System.IO.Stream stream);
public SoundPlayer (System.IO.Stream? stream);
new System.Media.SoundPlayer : System.IO.Stream -> System.Media.SoundPlayer
Public Sub New (stream As Stream)

Paramètres

stream
Stream

Stream dans un fichier .wav.

Remarques

Passé Stream au stream paramètre doit être un Stream contenant un fichier .wav. Les données retournées par la Read méthode de doivent Stream être les données d’un fichier .wav.

Voir aussi

S’applique à

SoundPlayer(String)

Source:
SoundPlayer.cs
Source:
SoundPlayer.cs
Source:
SoundPlayer.cs

Initialise une nouvelle instance de la classe SoundPlayer et attache le fichier .wav spécifié.

public:
 SoundPlayer(System::String ^ soundLocation);
public SoundPlayer (string soundLocation);
new System.Media.SoundPlayer : string -> System.Media.SoundPlayer
Public Sub New (soundLocation As String)

Paramètres

soundLocation
String

Emplacement d'un fichier .wav à charger.

Exceptions

La valeur URL spécifiée par soundLocation ne peut pas être résolue.

Remarques

La chaîne passée au soundLocation paramètre peut être un chemin d’accès de fichier ou une URL vers un fichier .wav. Si le chemin d’accès ou l’URL n’est pas valide, le SoundPlayer est toujours construit, mais les appels suivants à une méthode de chargement ou de lecture échouent.

Voir aussi

S’applique à

SoundPlayer(SerializationInfo, StreamingContext)

Source:
SoundPlayer.cs
Source:
SoundPlayer.cs
Source:
SoundPlayer.cs

Attention

This API supports obsolete formatter-based serialization. It should not be called or extended by application code.

Initialise une nouvelle instance de la classe SoundPlayer.

protected:
 SoundPlayer(System::Runtime::Serialization::SerializationInfo ^ serializationInfo, System::Runtime::Serialization::StreamingContext context);
protected SoundPlayer (System.Runtime.Serialization.SerializationInfo serializationInfo, System.Runtime.Serialization.StreamingContext context);
[System.Obsolete("This API supports obsolete formatter-based serialization. It should not be called or extended by application code.", DiagnosticId="SYSLIB0051", UrlFormat="https://aka.ms/dotnet-warnings/{0}")]
protected SoundPlayer (System.Runtime.Serialization.SerializationInfo serializationInfo, System.Runtime.Serialization.StreamingContext context);
new System.Media.SoundPlayer : System.Runtime.Serialization.SerializationInfo * System.Runtime.Serialization.StreamingContext -> System.Media.SoundPlayer
[<System.Obsolete("This API supports obsolete formatter-based serialization. It should not be called or extended by application code.", DiagnosticId="SYSLIB0051", UrlFormat="https://aka.ms/dotnet-warnings/{0}")>]
new System.Media.SoundPlayer : System.Runtime.Serialization.SerializationInfo * System.Runtime.Serialization.StreamingContext -> System.Media.SoundPlayer
Protected Sub New (serializationInfo As SerializationInfo, context As StreamingContext)

Paramètres

serializationInfo
SerializationInfo

SerializationInfo à utiliser pour la désérialisation.

context
StreamingContext

Destination à utiliser pour la désérialisation.

Attributs

Exceptions

Le SoundLocation spécifié dans serializationInfo ne peut pas être résolu.

Voir aussi

S’applique à