Solved

Equalizer, detect volume?

Posted on 1998-12-05
4
259 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

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…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…
This is a video describing the growing solar energy use in Utah. This is a topic that greatly interests me and so I decided to produce a video about it.

948 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

23 Experts available now in Live!

Get 1:1 Help Now