Solved

Equalizer, detect volume?

Posted on 1998-12-05
4
268 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
Suggested Courses
Course of the Month10 days, 5 hours left to enroll

623 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