Solved

Equalizer, detect volume?

Posted on 1998-12-05
4
257 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
So trillo got my points?   :-(((
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

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…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

728 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