home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.lang.visual.basic      MS Visual Basic discussions, NOT dot-net      10,840 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 9,197 of 10,840   
   Raoul Watson to Raoul Watson   
   Re: midi revisited   
   05 Feb 05 02:57:07   
   
   From: WatsonR@IntelligenCIA.com   
      
   "Raoul Watson"  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   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca