SoundPlayer.SoundLocation プロパティ

定義

読み込む .wav ファイルのファイル パスまたは URL を取得または設定します。

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

プロパティ値

.wav ファイルの読み込み元のファイル パスまたは URL。ファイル パスが存在しない場合は Empty。 既定値は、Empty です。

次のコード例では、 プロパティを SoundLocation 使用して、.wav ファイル ソースを クラスのインスタンスに割り当てる方法を SoundPlayer 示します。 このコード例は、SoundPlayer クラスのために提供されている大規模な例の一部です。

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

注釈

プロパティが に String.Empty 設定されている場合、 Stream このプロパティは に Stream設定されます。

適用対象

こちらもご覧ください