Guidance
指路人
g.yi.org
software / rapidq / Examples / Audio & Video / midi / playmidi.bas

Register 
注册
Search 搜索
首页 
Home Home
Software
Upload

  
     DECLARE FUNCTION mciExecute LIB "WINMM.DLL" ALIAS "mciExecute" _
      (StrCommand AS STRING) AS INTEGER
     DECLARE FUNCTION mciSendString LIB "WINMM.DLL" ALIAS "mciSendStringA" _
      (StrCommand AS STRING, ReturnString AS STRING, _
      ReturnLength AS LONG, hwndCallBack AS LONG) AS INTEGER

     DIM MusicFile AS STRING

     MusicFile = "c:\windows\media\passport.mid"

     IF mciExecute("Open "+MusicFile) THEN
      CLS
      mciSendString("Play "+MusicFile,"",0,0)
      PRINT "Playing "+Musicfile
      PRINT "Press 'P' to pause, 'R' to resume playing, ESC to quit"

      DO
       DO
        A$ = UCASE$(INKEY$)
       LOOP UNTIL LEN(A$)

       IF A$ = "P" THEN
        mciSendString("Pause "+Musicfile,"",0,0)
       ELSEIF A$ = "R" THEN
        mciSendString("Play "+Musicfile,"",0,0)
       END IF
      LOOP UNTIL A$=CHR$(27)
     END IF

     mciExecute("Close "+MusicFile)
掌柜推荐
 
 
¥289.00 ·
 
 
¥1,080.00 ·
 
 
¥1,380.00 ·
 
 
¥638.00 ·
 
 
¥1,290.00 ·
 
 
¥1,420.00 ·
© Sun 2024-11-24  Guidance Laboratory Inc.
Email:webmaster1g.yi.org Hits:0 Last modified:2013-06-19 07:42:53