Solved

How to control sound's volume ??

Posted on 2007-04-08
3
291 Views
Last Modified: 2013-12-26
Hi to all experts:

i'm using   waveOutOpen() ,  waveOutWrite() , waveOutClose() , ....
to play some wave sounds in my own game , and it works fine.
my problem is to control the volume for these sounds,
if i'm using  waveOutSetVolume function ,  it changes the wave master volume
and it also change the music volume at the background ( which is not good ).
so my question is how can i change a specific sound's volume without changing
the wave master volume and without effecting any thing else.

thanks alot
kobkob.
0
Comment
Question by:kob_kob
3 Comments
 
LVL 18

Accepted Solution

by:
JoseParrot earned 125 total points
ID: 18950894
Hi,

waveOutxxxx() reffers to the output device, so the command is always a "master" command to any wave send to it. To circumvect the problem, you can try to check if the system has more than one wave output device capable of running your wave files (game sounds and background music). This can be cheched with    WAVE_FORMAT_QUERY   and    WAVE_MAPPED . Take a look at
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/multimed/htm/_win32_waveoutopen.asp
for a MS help on that.

Another approach is to use different sound formats, say, MIDI for the music and WAVE for the sounds.
The noises and other game sounds remain using waveOutxxx() and the music uses
midiOutSetVolume() as described in
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/multimed/htm/_win32_waveoutopen.asp

A third ioption is to use wave for both sounds, with pre-recoderd music and noises at selected volumes, say:
MUSIC#1:  music1volume1.wav,  music1volume2.wav, music1volume3.wav
MUSIC#2: m2v1.wav, m2v2.wv
NOISE#1: n1v1.wav, etc. etc.
where v1, is lower and v3 is higher.
And programaticaly you can chose the desired combinations

Jose
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

What is RenderMan: RenderMan is a not any particular piece of software. RenderMan is an industry standard, defining set of rules that any rendering software should use, to be RenderMan-compliant. Pixar's RenderMan is a flagship implementation of …
For those of you searching for a fun but also medium paced MMORPG game I would highly suggest Ragnarok Online. This MMORPG is a bit older than World of Warcraft and in a way is extremely different. Compared to WoW's 3D environment and massive wor…
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.

778 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question