SoundPlayer Konstruktory

Definicja

Inicjuje nowe wystąpienie klasy SoundPlayer.

Przeciążenia

SoundPlayer()

Inicjuje nowe wystąpienie klasy SoundPlayer.

SoundPlayer(Stream)

Inicjuje SoundPlayer nowe wystąpienie klasy i dołącza plik .wav w określonym Streampliku .

SoundPlayer(String)

Inicjuje SoundPlayer nowe wystąpienie klasy i dołącza określony plik .wav.

SoundPlayer(SerializationInfo, StreamingContext)
Przestarzałe.

Inicjuje nowe wystąpienie klasy SoundPlayer.

SoundPlayer()

Źródło:
SoundPlayer.cs
Źródło:
SoundPlayer.cs
Źródło:
SoundPlayer.cs

Inicjuje nowe wystąpienie klasy SoundPlayer.

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

Uwagi

Ten konstruktor inicjuje element SoundPlayer bez źródła audio. Dopóki nie zostanie skonfigurowana przy użyciu ścieżki źródłowej dźwięku, SoundPlayer zostanie odtworzeny dźwięk sygnału dźwiękowego, gdy zostanie wywołana jedna z metod odtwarzania.

Zobacz też

Dotyczy

SoundPlayer(Stream)

Źródło:
SoundPlayer.cs
Źródło:
SoundPlayer.cs
Źródło:
SoundPlayer.cs

Inicjuje SoundPlayer nowe wystąpienie klasy i dołącza plik .wav w określonym Streampliku .

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)

Parametry

stream
Stream

A Stream do pliku .wav.

Uwagi

Przekazany Stream do parametru stream powinien być Stream plikiem .wav. Dane zwrócone przez metodę ReadStream metody powinny być danymi w pliku .wav.

Zobacz też

Dotyczy

SoundPlayer(String)

Źródło:
SoundPlayer.cs
Źródło:
SoundPlayer.cs
Źródło:
SoundPlayer.cs

Inicjuje SoundPlayer nowe wystąpienie klasy i dołącza określony plik .wav.

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

Parametry

soundLocation
String

Lokalizacja pliku .wav do załadowania.

Wyjątki

Nie można rozpoznać wartości adresu URL określonej przez soundLocation program .

Uwagi

Ciąg przekazywany do parametru soundLocation może być ścieżką pliku lub adresem URL do pliku .wav. Jeśli ścieżka lub adres URL nie są prawidłowe, nadal zostanie skonstruowana, SoundPlayer ale kolejne wywołania metody ładowania lub odtwarzania zakończy się niepowodzeniem.

Zobacz też

Dotyczy

SoundPlayer(SerializationInfo, StreamingContext)

Źródło:
SoundPlayer.cs
Źródło:
SoundPlayer.cs
Źródło:
SoundPlayer.cs

Przestroga

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

Inicjuje nowe wystąpienie klasy 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)

Parametry

serializationInfo
SerializationInfo

Element SerializationInfo , który ma być używany do deserializacji.

context
StreamingContext

Miejsce docelowe, które ma być używane do deserializacji.

Atrybuty

Wyjątki

Nie można rozpoznać określonego SoundLocation elementu w serializationInfo .

Zobacz też

Dotyczy