[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

changing the volume in c++Builder

Posted on 1998-12-02
1
Medium Priority
?
686 Views
Last Modified: 2010-10-05
I am trying to control the volume of a wave sound with
waveoutgetvolume(0,(LPDWORD) oldvolume);
to keep the oldvolume and then
waveoutsetvolume(0, (DWORD) newvolume);
and it only seems to change the left channel
even if I do something like newvolume == oldvolume
I am new to this type of programming and know nothing about API Im used to pascal for Dos....Any help would be nice...
0
Comment
Question by:jayy
1 Comment
 
LVL 2

Accepted Solution

by:
trillo earned 60 total points
ID: 1179137
The low-order word (from the second parameter of the function) contains the left-channel volume setting, and the high-order word contains the right-channel setting. A value of 0xFFFF represents full volume, and a value of 0x0000 is silence.
If a device does not support both left and right volume control, the low-order word of dwVolume specifies the volume level, and the high-order word is ignored.

You can use the HIWORD and LOWORD macros to separate the left and right channel volume values in the "WaveOutGetVolume" fucntion and you can use the MAKELONG macro to build the parameter form the left-right volume values in the "WaveOutSetVolume" function.

Trillo
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

  Included as part of the C++ Standard Template Library (STL) is a collection of generic containers. Each of these containers serves a different purpose and has different pros and cons. It is often difficult to decide which container to use and …
C++ Properties One feature missing from standard C++ that you will find in many other Object Oriented Programming languages is something called a Property (http://www.experts-exchange.com/Programming/Languages/CPP/A_3912-Object-Properties-in-C.ht…
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.

829 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