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
意見反應
https://aka.ms/ContentUserFeedback。
即將登場:在 2024 年,我們將逐步淘汰 GitHub 問題作為內容的意見反應機制,並將它取代為新的意見反應系統。 如需詳細資訊,請參閱:提交並檢視相關的意見反應