Jump to content
  • Advertisement
Sign in to follow this  
flounder

mciSendCommand help

This topic is 4835 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

MCI_WAVE_OPEN_PARMS	waveParams;

//load the sound

waveParams.lpstrDeviceType = (LPCSTR)MCI_DEVTYPE_WAVEFORM_AUDIO;
	
waveParams.lpstrElementName="powerup.wav";

mciSendCommand(0, MCI_OPEN,MCI_OPEN_ELEMENT|MCI_OPEN_TYPE|MCI_OPEN_TYPE_ID|MCI_NOTIFY, (DWORD)(LPVOID)&waveParams);

//play the sound

mciSendCommand(waveParams.wDeviceID,MCI_PLAY,MCI_NOTIFY,(DWORD)(LPVOID)&waveParams);





i can load the sound fine but i can only play it once. closing the player didn't help either. i think i might have declared something wrong in one of the mcisendcommand's

Share this post


Link to post
Share on other sites
Advertisement
Sorry about the late reply (I only found it when I was looking for something else). Anyway, you could always try something a little simpler:


mciSendString("open powerup.wav type waveaudio alias mysound",0,0,0);
mciSendString("play mysound loop",0,0,0);//you might wanna check the 'loop' bit
while (notReadyToStop){
Sleep(someAmountOfTime);
}
mciSendString("stop mysound",0,0,0);
mciSendString("close mysound",0,0,0);



I could be off with the strings (I haven't used them in quite a long time), so you might wanna google them, but they look OK.

You should probably look at OpenAL. Sure you have to load the files yourself, but it's a lot less fiddly than the MCI stuff... On the other hand, if you plan on playing videos, OpenAL will only help with the audio, where as the MCI commands can get it up and running in no time.

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!