Results 1 to 4 of 4

Thread: Playing music thru API (mciSendMessage)

  1. #1

    Thread Starter
    New Member
    Join Date
    Mar 2002
    Posts
    5

    Playing music thru API (mciSendMessage)

    I use the windows API (mciSemdMessage) to play music. for example:

    rc = mciSendString("play myfile", 0, 0, 0)

    How can I tell when the current file is finished so I can process another. I want to play a list of files one at a time.

  2. #2
    Addicted Member Bazza81's Avatar
    Join Date
    Apr 2001
    Location
    Nottingham, UK
    Posts
    203

    Talking Have a look...

    Here have a look at my MP3 player. Its a seperate DLL file with FULL documentation included and a sample program on how to use it

    Heres the link:
    http://homepage.ntlworld.com/bazza81/vbamp2source.zip
    Who needs rhetorical questions anyway?


    Bazza NET - The place you want to be!

  3. #3

    Thread Starter
    New Member
    Join Date
    Mar 2002
    Posts
    5
    I'm having trouble getting the total number of frames for the mp3 file. Can anyone help.
    Here is my code.

    Dim lngRC As Long
    Dim sTotal As String * 255
    Dim sMySong as String

    sMySong = "c:\temp\abc.mp3"

    sCommand = "open " & sMySong & " type MPEGVideo"
    lngRC = mciSendString(sCommand & " type MPEGVideo", 0, 0, 0)

    lngRC = mciSendString("set MPEGVideo time format frames", sTotal, Len(sTotal), 0)
    lngRC = mciSendString("status MPEGVideo length", sTotal, Len(sTotal), 0)

    ' here I get and error: lngRC = 274

    giTotalFrames = Val(sTotal)


    Here is my declare:

    Public Declare Function mciSendString Lib "winmm.dll" _
    Alias "mciSendStringA" (ByVal lpstrCommand As String, _
    ByVal lpstrReturnString As String, ByVal uReturnLength As Long, _
    ByVal hwndback As Long) As Long

  4. #4
    Lively Member formulav8's Avatar
    Join Date
    Mar 2002
    Location
    Orlando
    Posts
    116
    The mci device doesn't support getting frames via a mp3 file. Only movie files.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width