By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,190 Members | 1,469 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,190 IT Pros & Developers. It's quick & easy.

midi revisited

P: n/a
This has probably been covered many times and I apologize for losing the
code.

I am looking for code to play a midi file and at the same time, report back
(or be able to status check), whether or not it has completed playing the
file.

Thanks for any help!
Jul 17 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a

"Raoul Watson" <Wa*****@IntelligenCIA.com> wrote in message
news:I%hMd.4222$ya6.2218@trndny01...
This has probably been covered many times and I apologize for losing the
code.

I am looking for code to play a midi file and at the same time, report back (or be able to status check), whether or not it has completed playing the
file.

Thanks for any help!


OK.. I suppose I should have shown some code (for those thinking I am just
looking for someone to write the code;) and I probably ought to rephrase "Is
there a way using mciSend.. to detect end of the play?" Or perhaps another
way? Any advise is appreciated.

Public Sub PlayMIDI(sFilename As String)
Dim I%, a&
Dim CommandString As String
Dim ReturnString As String * 128
ReturnString = Space(128)

For I% = 1 To 3
Select Case I%
Case 1
CommandString = "close mymid"
Case 2
CommandString = "open " & sFilename & _
" type sequencer alias mymid"
Case 3
CommandString = "play mymid from 1"
End Select

a& = mciSendString _
(CommandString, ReturnString, Len(ReturnString), 0)

Next I%
End Sub
Jul 17 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.