SoundPlayer.SoundLocation Property
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
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
Feedback
https://aka.ms/ContentUserFeedback.
Kommer snart: I hele 2024 udfaser vi GitHub-problemer som feedbackmekanisme for indhold og erstatter det med et nyt feedbacksystem. Du kan få flere oplysninger under:Indsend og få vist feedback om