SoundPlayer Constructeurs

Définition

Initialise une nouvelle instance de la classe SoundPlayer.

Surcharges

Nom Description
SoundPlayer()

Initialise une nouvelle instance de la classe SoundPlayer.

SoundPlayer(Stream)

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

SoundPlayer(String)

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

SoundPlayer(SerializationInfo, StreamingContext)

Initialise une nouvelle instance de la classe SoundPlayer.

SoundPlayer()

Initialise une nouvelle instance de la classe SoundPlayer.

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

Remarques

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

Voir aussi

S’applique à

SoundPlayer(Stream)

Initialise une nouvelle instance de la SoundPlayer classe et attache le fichier .wav dans le fichier spécifié 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 un fichier .wav.

Remarques

Le Stream paramètre passé stream doit contenir Stream un fichier .wav. Les données retournées par la Read méthode du Stream fichier doivent être les données dans un fichier .wav.

Voir aussi

S’applique à

SoundPlayer(String)

Initialise une nouvelle instance de la SoundPlayer classe et joint 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 d’URL spécifiée par soundLocation ne peut pas être résolue.

Remarques

La chaîne transmise 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 sera toujours construit, mais les appels suivants à une méthode de chargement ou de lecture échoueront.

Voir aussi

S’applique à

SoundPlayer(SerializationInfo, StreamingContext)

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);
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.

Exceptions

Impossible de résoudre le SoundLocation paramètre serializationInfo spécifié.

Voir aussi

S’applique à