|
|
Title | Play a MIDI audio file by using DirectX in VB .NET |
Description | This example shows how to play a MIDI audio file by using DirectX in VB .NET. It uses an Audio object. |
Keywords | MIDI, DirectX, Audio, multimedia, VB .NET |
Categories | Multimedia, VB.NET |
|
|
First add a reference to the Microsoft.DirectX.AudioVideoPlayback library.
To play an audio file, create a new Audio object, passing its constructor the name of the audio file. Then call the object's Play method.
|
|
Imports Microsoft.DirectX.AudioVideoPlayback
Private Sub btnPlay_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles btnPlay.Click
Dim audio_player As New Audio(txtFile.Text)
audio_player.Play()
End Sub
|
|
|
|
|
|