Editar

Compartilhar via


SoundPlayer.SoundLocation Property

Definition

Gets or sets the file path or URL of the .wav file to load.

public:
 property System::String ^ SoundLocation { System::String ^ get(); void set(System::String ^ value); };
public string SoundLocation { get; set; }
member this.SoundLocation : string with get, set
Public Property SoundLocation As String

Property Value

The file path or URL from which to load a .wav file, or Empty if no file path is present. The default is Empty.

Examples

The following code example demonstrates the use of the SoundLocation property to assign the .wav file source to an instance of the SoundPlayer class. This code example is part of a larger example provided for the SoundPlayer class.

try
{
   
   // Assign the selected file's path to 
   // the SoundPlayer object.  
   player->SoundLocation = filepathTextbox->Text;
   
   // Load the .wav file.
   player->Load();
}
catch ( Exception^ ex ) 
{
   ReportStatus( ex->Message );
}
try
{
    // Assign the selected file's path to 
    // the SoundPlayer object.  
    player.SoundLocation = filepathTextbox.Text;

    // Load the .wav file.
    player.Load();
}
catch (Exception ex)
{
    ReportStatus(ex.Message);
}
Try
    ' Assign the selected file's path to the SoundPlayer object.
    player.SoundLocation = filepathTextbox.Text

    ' Load the .wav file.
    player.Load()
Catch ex As Exception
    ReportStatus(ex.Message)
End Try

Remarks

This property is set to String.Empty when the Stream property is set to a Stream.

Applies to

See also