?
Solved

auxGetVolume

Posted on 1998-05-13
11
Medium Priority
?
410 Views
Last Modified: 2010-05-18
Why does this procedure not work ???

unit VolUnit1;
uses ......., mmsystem;
...
var
    Device:       Byte;
    VolumeTotaal: Cardinal;
    VolumeLeft:   Word;
    VolumeRight:  Word;
...
procedure TForm1.Timer1Timer(Sender: TObject);
begin
  Device:=2;
  auxGetVolume(Device,@VolumeTotaal);
  VolumeLeft := VolumeTotaal and $0000ffff;
  VolumeRight:= VolumeTotaal shr 16;
  Label1.Caption:=FloatToStr(VolumeTotaal);
  Label2.Caption:=FloatToStr(VolumeLeft);
  Label3.Caption:=FloatToStr(VolumeRight);
end;
...

HELP me PLEASE !!!!!
Thanx.
Stefan van Roosmalen.
0
Comment
Question by:roosiedb
[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
  • 5
  • 4
  • 2
11 Comments
 
LVL 6

Expert Comment

by:Stuart_Johnson
ID: 1345410
Let me guess, you aren't using a Genuine SoundBlaster card are you?  We are trying to do the same thing here with an ESS Audio Drive card and it wont work - but it does perfectly on a Creative Labs card.

I just tested you code on my SB Vibra 16 P&P card and it worked perfectly.  However, when I ran it on the ESS Audio Drive 1689 P&P card, I just got the same number no matter what I set the volume levels too.

I would be interested to know if you can solve this or not.  We have had the guys from NEC trying to solve it for us, and we are in the middle of contacting ESS now.

If I find anything, rest assured, I will let you know.

Regards,

Stuart.
0
 

Author Comment

by:roosiedb
ID: 1345411
Adjusted points to 125
0
 
LVL 6

Expert Comment

by:Stuart_Johnson
ID: 1345412
Roosiedb:

So, are you using a non Sound Blaster compatible card???  I'ld just be interested to know if my comments where useful or not.

Stu.
0
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!

 

Author Comment

by:roosiedb
ID: 1345413
Well, I don't exactly know the name of my soundcard, but it is definitely not a SoundBlaster-card. I really do not know how to solve this problem and I want to ask everyone who can, to solve it so that my solution to this problem also works on the other soundcards, like for example: CreativeLabs. Otherwise my application won't work at computers with other soundcards than mine. When you found something what maybe can help me, please tell me. But I don't want to use new components, because I allready tried several components, and they seem only to work with SB-cards too. Bye!
0
 
LVL 4

Accepted Solution

by:
BoRiS earned 1000 total points
ID: 1345414
roosiedb

here is a function I used recently on a Volume control component I wrote for someone here....

add this to the your unit

const
  AuxVolume       = 0;
  WaveVolume    = 1;
  MidiVolume     = 2;

type
    TVolumeRec = record
    case Integer of
    0: (LongVolume: Longint);
    1: (LeftVolume,
        RightVolume : Word);
    end;

then this to your private clause

FDevices     : array[0..2] of Integer;
function       GetVolume(PIndex: Integer): Byte;

then here is the function

    function       TVolumeMixer.GetVolume(PIndex: Integer): Byte;
    var Mix: TVolumeRec;
    begin
      Mix.LongVolume := 0;
      if FDevices[PIndex] <> -1 then
      case PIndex of
      0: auxGetVolume(FDevices[PIndex], @Mix.LongVolume);
      1: waveOutGetVolume(FDevices[PIndex], @Mix.LongVolume);
      2: midiOutGetVolume(FDevices[PIndex], @Mix.LongVolume);
      end;
      Result := (Mix.LeftVolume + Mix.RightVolume) shr 9;
    end;

It works on my machine and I have an OPTI card which is not a Sound blaster compatible card

Anyway this function goes along with a procdeure called setvolume etc....

Let me know if it works

Later
BoRiS
0
 

Author Comment

by:roosiedb
ID: 1345415
Boris,

Your function seems to work great, but I also want to know how I can get the volume-values of the other mixer-channels (Master and Microphone). Would you please tell me how to adjust the code you sent me so that I can finish my (audio)job.
Thanx !!

Stefan van Roosmalen.
0
 
LVL 4

Expert Comment

by:BoRiS
ID: 1345416
roosiedb

The master volume I'm still working on but the microphone volume I have set up

Please grad this answer and send me your mail address then I'll send you the component I wrote that gets and sets all the volumes except for now the master volume which is what I'm busy with...

Later
BoRiS
0
 

Author Comment

by:roosiedb
ID: 1345417
My e-mail adres is:
roosiedb@wxs.nl
Please send me the MICROPHONE and MASTER -stuff too ...
Thanx again. It is worth 250 points !!! Excellent !!!
0
 
LVL 4

Expert Comment

by:BoRiS
ID: 1345418
roosiedb

K I'll send you the component as sson as I get the master volume done..

I have added you to my contacts list so I'll mail you the component soon

till then

Later
BoRiS
0
 

Author Comment

by:roosiedb
ID: 1345419
Boris, Can I have you e-mail to contact you in the future for this kind of things?
Bye! Stefan.
0
 
LVL 4

Expert Comment

by:BoRiS
ID: 1345420
roosiedb

my email at work is pdutoit@brillacc.com
and at home is idbehold@iafrica.com

keep in touch

Later
BoRiS
(Phillip)
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
Suggested Courses
Course of the Month14 days, 22 hours left to enroll

771 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