# Re: How to play MID

Posted by Kavin on September 06, 1998 at 16:34:24:

In Reply to: Re: How to play MID posted by Honey on September 06, 1998 at 13:41:57:

ThX you first.
o甘可唔可以依家首歌的时间..

: : 请问如何play mid file ...

: 可以用Multimedia控制项 或者用mciSendString函式
: mciSendString宣告方式如下
: Private Declare Function mciSendString Lib _
: "winmm.dll" Alias "mciSendStringA" _
: (ByVal lpstrCommand As String, ByVal _
: lpstrReturnString As String, ByVal _
: uReturnLength As Long, ByVal _
: hwndCallback As Long) As Long
: '若在模组宣告 private 得去掉

:
: 使用方法如下
: Call mciSendString("open C:\untitled.mid type sequencer _
: alias e", 0, 0, 0)
: '开启档案"C:\untitled.mid",取名为另一个别名 e
: 'type sequencer 指使用的设备

: Call mciSendString("play e wait", 0, 0, 0)
: '播放别名e所代表的档案 ,加入wait代表声档播放 _
: 完毕时才将使用权交回

: Call mciSendString("close e ", 0, 0, 0)
: '关闭档案

Follow Ups:

- Re: How to play MID Honey 18:55:51 9/08/98 (1)
  - Re: How to play MID Kavin 23:30:33 9/11/98 (0)