Advertisement Jump to content
Sign in to follow this  

mciSendCommand help

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


//load the sound

waveParams.lpstrDeviceType = (LPCSTR)MCI_DEVTYPE_WAVEFORM_AUDIO;


//play the sound


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
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){
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, you agree to our community Guidelines, Terms of Use, and Privacy Policy. is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!