Solved

Equalizer, detect volume?

Posted on 1998-12-05
4
261 Views
Last Modified: 2010-04-04
How to get the sound volume, to use in a very simple equalizer, to get a picture of what I'm trying to say, minize WinAmp to its smallest window or double click the volume settings in the systemtray (if available), while playing a song.
0
Comment
Question by:koger
  • 2
4 Comments
 
LVL 20

Expert Comment

by:Madshi
ID: 1349444
You'll have to use the mixer API. You can download a little source sample at "http://www.wilsonc.demon.co.uk/delphi.htm". Don't know if it is exactly what you need - but I think, it is a good starting point.
You'll need to get the ID of the peakmeter of general volume output, then poll it.

Regards, Madshi.
0
 
LVL 2

Accepted Solution

by:
trillo earned 200 total points
ID: 1349445
You can use the "WaveOutGetVolume" and "WaveOutSetVolume" functions:
MMRESULT waveOutGetVolume(
    HWAVEOUT hwo,      // Handle of a open waveout device
    LPDWORD pdwVolume      // Adress of variable to be filled with the volume setting
   );
MMRESULT waveOutSetVolume(
    HWAVEOUT hwo,      
    DWORD dwVolume      
   );      
 
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
 

Author Comment

by:koger
ID: 1349446
This dosn't sound like the answer I'm looking for, but I got my answer from Madshi, so thanks to both of you.
0
 
LVL 20

Expert Comment

by:Madshi
ID: 1349447
So trillo got my points?   :-(((
0

Featured Post

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

Suggested Solutions

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …

775 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