Share via


Audio.FromFile(String,Boolean) Method (Microsoft.DirectX.AudioVideoPlayback)

Creates an Audio object from a file.

Definition

Visual Basic Public Shared Function FromFile( _
    ByVal filename As String, _
    ByVal autorun As Boolean _
) As Audio
C# public static Audio FromFile(
    string filename,
    bool autorun
);
C++ public:
static AudioFromFile(
    StringLeave Sitefilename,
    bool autorun
);
JScript public static function FromFile(
    filename : String,
    autorun : boolean
) : Audio;

Parameters

filename System.String
The path to the audio file.
autorun System.Boolean
Set to true to automatically start playback. Set to false to open the file but not play it.

Return Value

Microsoft.DirectX.AudioVideoPlayback.Audio
Returns the Audio object from filename.

Remarks

Exceptions

DirectXException

For more information on the cause of this exception, reference the DirectXException.ErrorCode and DirectXException.ErrorString properties to the AudioVideoPlayback error code table.