Play MP3 file

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Play MP3 file

Mark Wilden
How would one go about playing an MP3 file from Dolphin, with notification
that it's finished? I looked at ST3D, but I don't need a full graphics
framework--I just want to write a WinAmp-type of program.


Reply | Threaded
Open this post in threaded view
|

Re: Play MP3 file

Bill Schwab-2
Mark,

> How would one go about playing an MP3 file from Dolphin, with notification
> that it's finished? I looked at ST3D, but I don't need a full graphics
> framework--I just want to write a WinAmp-type of program.

The Windows Media Player has an Automation interface, and Dolphin's ActiveX
Component Wizard should happily generate interface classes for you.  That's
the good news.  The bad news is that, at least when I last looked at it, the
Media Player's Automation interface is, at best, an exercise in reverse
engineering, and the MS documentation was silent on many salient points.
It's probably worth a look though.

Good luck!

Bill

--
Wilhelm K. Schwab, Ph.D.
[hidden email]


Reply | Threaded
Open this post in threaded view
|

Re: Play MP3 file

Chris Hayes-4
In reply to this post by Mark Wilden
Mark,

One approach would be to use the Dolphin's WinMMLibrary and use the "send
string" interface.

For example, open an mp3 file:
WinMMLibrary default

    mciSendString: 'open "filename" type MPEGVideo alias currentFile

    lpszReturnString: nil

    cchReturn: nil

    hwndCallback: nil.

Play the file you just opened:

WinMMLibrary default

    mciSendString: 'play ', currentFile

    lpszReturnString: nil

    cchReturn: nil

    hwndCallback: nil.

You don't get any notification when the file is finished playing though.
You might be able to use hwndCallback parameter for this.  I haven't
investigated that myself.

The other option, as Bill suggested, would be to wrap the Windows Media
Player control.  That approach does provide event-based notification.

ST3D uses the WinMMLibrary for playing MP3s.

VideoDoc, another Dolphin app, makes use of the Windows Media Player
control:

http://www.creative-computing-inc.com/VideoDoc/VideoDoc.htm









"Mark Wilden" <[hidden email]> wrote in message
news:[hidden email]...
> How would one go about playing an MP3 file from Dolphin, with notification
> that it's finished? I looked at ST3D, but I don't need a full graphics
> framework--I just want to write a WinAmp-type of program.
>
>