Jump to content
  • Advertisement
Sign in to follow this  
mc30900

length of file in mci

This topic is 4488 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

hello all i got a question about mci: after opening a file, how can i know the file length without playing it? like 50 seconds and etc?? thanks in advance

Share this post


Link to post
Share on other sites
Advertisement
thanks
and another question:
how do i know where the file is now??
i started playing it.... and after a few minuts i want to see where is it
how do i do that???
should i set a timer or somthing?? or there is a command?

thanks in advance

Share this post


Link to post
Share on other sites
ok thanks.
how do i get the information??
int a = mcisendstring(...) ??

what is the data which coming back?? integer???

thanks in advance

Share this post


Link to post
Share on other sites
No, read the documentation.

Quote:

MCIERROR mciSendString(
LPCTSTR lpszCommand,
LPTSTR lpszReturnString,
UINT cchReturn,
HANDLE hwndCallback
);

lpszReturnString

Pointer to a buffer that receives return information. If no return information is needed, this parameter can be NULL.

cchReturn

Size, in characters, of the return buffer specified by the lpszReturnString parameter.

Share this post


Link to post
Share on other sites
MCI is really quite old. I suggest either rolling your own player on top of WAV or OGG and DirectSound, or using DirectShow to play the file. Once XACT starts supporting better compressed audio banks, that'll probably be the best tool to use for game audio on Windows.

Share this post


Link to post
Share on other sites
well.. i tried to do somthing... that it gets it and give it to me in a msg box so i'll see it.
but instead of doing that.. it just gives me an empty msg box...
here is the code: (i'm working in C++ btw)


char ms[6];
char loc[260];
strcpy(loc, "status \"");
strcat(loc,p);
strcat(loc,"\" length");
mciSendString(loc,ms,6,0);
MessageBox(NULL,ms,"ERROR",MB_OK|MB_ICONEXCLAMATION);



anyone has any idea whats wrong here and how to fix this?? thanks in advance

Share this post


Link to post
Share on other sites
I'm guessing your buffer ain't large enough, and since you're working with C++ you should be using std::string...

Share this post


Link to post
Share on other sites
Quote:
Original post by raz0r
I'm guessing your buffer ain't large enough, and since you're working with C++ you should be using std::string...


i dont understand what u mean..
and i used a 255 buffer before that one

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!