Solved

changing the volume in c++Builder

Posted on 1998-12-02
1
642 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 20 total points
Comment Utility
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

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Unlike C#, C++ doesn't have native support for sealing classes (so they cannot be sub-classed). At the cost of a virtual base class pointer it is possible to implement a pseudo sealing mechanism The trick is to virtually inherit from a base class…
Templates For Beginners Or How To Encourage The Compiler To Work For You Introduction This tutorial is targeted at the reader who is, perhaps, familiar with the basics of C++ but would prefer a little slower introduction to the more ad…
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 how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.

763 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now