Solved

Equalizer, detect volume?

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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Show Listview image from database (String field) 5 191
Press three keys together and trigger a function 3 77
Delphi: Connect to running MS Outlook 4 211
Delphi Yen format 3 75
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…
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…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

752 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