PDA

View Full Version : DirectX 9 SDK


dalf
12-24-2002, 12:29 AM
I'm trying to program a simple MP3 player using DirectShow. But I'm having troubles. The following interfaces don't seem to be present. I did a search of all the includes in the SDK and I did not find...
IGraphBuffer IMediaSeeker IMediaEventEx

Am I missing an include or..what. If there's a simpler way of playing an MP3 file with another library, by all means lead me to it. And yes, I read the Slashdot article that MP3 has closed their license.

------------------
"A wizard is never late, Frodo Baggins. Nor is he early. He arrives pricisely when he means to!" --Gandalf

SithGhost
12-24-2002, 07:58 AM
You might be able to play an MP3 with a Windows API function...not sure if it will be any faster:


PlaySound("Sound.mp3", NULL, SND_FILENAME | SND_ASYNC | SND_LOOP);


First argument is the sound file, the second is the executable module to play from (in this case it's NULL), the 3rd argument are some flags:

SND_FILENAME - The sound is a filename, because of this the module will be NULL.
SND_ASYNC - The function will return after the sound event completes.
SND_LOOP - The sound will play repeatedly.

Hope that's usefull, for more info, you'll probably want to look up PlaySound on the msdn library.

[This message has been edited by SG1_129 (edited December 24, 2002).]

Aaron
12-24-2002, 09:28 AM
The only one of those interfaces I could find any information on was the IMediaEventEx. If this existed in previous versions, they will exist in 9, everything is always backwards compatiable. On the download page I saw a package that contained multimedia samples for VB, it shouldn't be too difficult to convert them to C.

Also, SG1, that function works great to just play a sound, but it doesn't provide any control over its execution. I don't know either if that will play an MP3.

dalf
12-24-2002, 11:16 AM
To SG1: I tried PlaySound function and it only played WAV files.

To Aaron: Yeah, I'm looking up VB DirectShow. I know some VB to the point where I might be able to play an MP3.

------------------
"A wizard is never late, Frodo Baggins. Nor is he early. He arrives pricisely when he means to!" --Gandalf