Hello everybody,
I want to play midi file when opening a file
How do i do this?
Thanks in advance,
ERAN
Printable View
Hello everybody,
I want to play midi file when opening a file
How do i do this?
Thanks in advance,
ERAN
One easy way to play a midi file is to use the Microsoft Multimedia Control.
'CLOSE file that is playing
mmControl.Command = "Close"
'ENABLE
mmControl.PlayEnabled = True
'SET file name
mmControl.FileName = "C:\Music\song.mid"
'OPEN file
mmControl.Command = "Open"
'PLAY file
mmControl.Command = "Play"
Or use the mciSendString API.
VB Code:
'Open the midi mciSendString "open C:\MyFile.mid type sequencer alias midi", 0, 0, 0 'Play the midi mciSendString "play midi", 0, 0, 0 'Stop the midi mciSendString "stop midi", 0,0,0 'Close the midi mciSendString "close midi", 0, 0, 0