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

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

  
'from: Ben Laws  Sat, 01 May 2004 13:40:34 -0000
' mp3 play monitor
'Q:
' Is there a way to monitor when a mp3 file has come to an end
' so that a new file can be started?
'A:
'There is a way, but it took me quite a while to find it. You set up a
'timer, and get it to frequently check what the track status mode is.
'I presume you are using mciSendString:

     FUNCTION StatusMode (ALIAS AS STRING) AS STRING
      DIM Mode AS STRING
      Mode = SPACE$(30)
      mciSendString("Status " + ALIAS + " Mode", _
       VARPTR(Mode), LEN(Mode) - 1, 0)
      Mode = RTRIM$(Mode)
      Mode = Mode - CHR$(0)
      Result = Mode
     END FUNCTION

'Alias is whatever you're open mp3 is called (the 'alias' you gave it -
' if you gave it one)

'The function will return the status - I've dealt
'with "playing", "paused" and "stopped" in the past. I used:

     Mode$ = StatusMode ("MyMP3")

     IF Mode$ <> "playing" AND Mode$ <> "paused" THEN

    'This is done presuming the track WAS playing, but is not now
    'therefore it has stopped for some reason (probably finished)

     END IF
掌柜推荐
 
 
 
 
 
 
 
 
 
 
 
 
© Thu 2024-5-30  Guidance Laboratory Inc.
Email:webmaster1g.yi.org Hits:0 Last modified:2004-05-02 11:14:40