Setting the volume on Windows

Hi,
I’m very new to game development and cocos.
I’ve been reading through topics aboute this issue (The volume cannot be changed in Windows Desktop platform/ SimpleAudioEngine volume’s functions are empty or dull), and i’d like to know how to fix it.

All the documentation and examples i’ve found about audio are using the cocosdenshion, so I don’t know how to use another.

Can anyone please tell me how to deal with this volume issue in the most basic way?
What and where I have to change.

Thank you!

The default implementation of the Win32 SimpleAudioEngine does not support volume.

You have to re-write it with a different sound backend because MCIPlayer is really incomplete.

You may be able to find an MCIPlayer volume implementation on the forum here:

But I would recommend just replacing MCIPlayer ASAP the performance is horrible.

I’ve read several of your topics about this, and you managed to make it work by replacing it by DirectSound right?

Is it possible for you to teach me how to replace MCIPlayer for DirectSound and make it work?

This is the patch that I used.

My implementation contains a bunch of specific modifications to SimpleAudioEngine that would probably cause you compatibility issues. The referenced patch should be enough to get sounds and volume working, however.

Just remember to add “dsound.lib” to your linking list.