Solved

auxGetVolume

Posted on 1998-05-13
11
375 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
  • 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
Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

 

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 250 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

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Run video youtube webbrowse 10 61
Delphi IDE crash without error message ... 7 89
Press three keys together and trigger a function 3 56
update joined tables 2 46
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…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

770 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