SoundPlayer SoundPlayer SoundPlayer SoundPlayer Constructors

Definition

Overloads

SoundPlayer() SoundPlayer() SoundPlayer()

Initializes a new instance of the SoundPlayer class.

SoundPlayer(Stream) SoundPlayer(Stream) SoundPlayer(Stream)

Initializes a new instance of the SoundPlayer class, and attaches the .wav file within the specified Stream.

SoundPlayer(String) SoundPlayer(String) SoundPlayer(String) SoundPlayer(String)

Initializes a new instance of the SoundPlayer class, and attaches the specified .wav file.

SoundPlayer(SerializationInfo, StreamingContext) SoundPlayer(SerializationInfo, StreamingContext) SoundPlayer(SerializationInfo, StreamingContext)

Initializes a new instance of the SoundPlayer class.

SoundPlayer() SoundPlayer() SoundPlayer()

Initializes a new instance of the SoundPlayer class.

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

Remarks

This constructor initializes a SoundPlayer with no audio source. Until it is configured with an audio source path, the SoundPlayer will play a beep sound when one of its playback methods is called.

See also

SoundPlayer(Stream) SoundPlayer(Stream) SoundPlayer(Stream)

Initializes a new instance of the SoundPlayer class, and attaches the .wav file within the specified Stream.

public:
 SoundPlayer(System::IO::Stream ^ stream);
public SoundPlayer (System.IO.Stream stream);
new System.Media.SoundPlayer : System.IO.Stream -> System.Media.SoundPlayer

Parameters

stream
Stream Stream Stream Stream

A Stream to a .wav file.

Remarks

The Stream passed to the stream parameter should be a Stream containing a .wav file. The data returned by the Read method of the Stream should be the data within a .wav file.

See also

SoundPlayer(String) SoundPlayer(String) SoundPlayer(String) SoundPlayer(String)

Initializes a new instance of the SoundPlayer class, and attaches the specified .wav file.

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

Parameters

soundLocation
String String String String

The location of a .wav file to load.

Exceptions

The URL value specified by soundLocation cannot be resolved.

Remarks

The string passed to the soundLocation parameter can be either a file path or a URL to a .wav file. If the path or URL is not valid, the SoundPlayer will still be constructed, but subsequent calls to a load or play method will fail.

See also

SoundPlayer(SerializationInfo, StreamingContext) SoundPlayer(SerializationInfo, StreamingContext) SoundPlayer(SerializationInfo, StreamingContext)

Initializes a new instance of the SoundPlayer class.

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

Parameters

serializationInfo
SerializationInfo SerializationInfo SerializationInfo SerializationInfo

The SerializationInfo to be used for deserialization.

context
StreamingContext StreamingContext StreamingContext StreamingContext

The destination to be used for deserialization.

Exceptions

The SoundLocation specified in serializationInfo cannot be resolved.

See also

Applies to