• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
setting microphone gain
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

setting microphone gain


  • Subject: setting microphone gain
  • From: Matthew Johnson <email@hidden>
  • Date: Wed, 27 Mar 2002 18:17:02 +1100

Hi,

I am trying to set the gain for my default input device. I can set the volume of the output Device and this work (if i
have daisy running I can see the volume sliders move. Works perfect.) as soon as I try to change the gain to any number
at all channel 1 in daisy does not change but channel 2 gets set to 0.0 and no matter what i set the gain to be it does
not move from 0. Can anyone tell me what i am missing?

Here is the code i use to set microphone gain.

float theValue=x; //x is a float between 0.0 and 1.0

for (channel=1; channel<3; channel++)
{
int datasize = sizeof(theValue);
Boolean isWritable;
err=0;
err = AudioDeviceGetPropertyInfo(inputAudioDevice, channel, true, kAudioDevicePropertyVolumeScalar,
NULL, &isWritable);
if(err==kAudioHardwareNoError && isWritable)
{
if((err = AudioDeviceSetProperty(inputAudioDevice, 0, channel, true,
kAudioDevicePropertyVolumeScalar, datasize, &theValue))!=kAudioHardwareNoError)
fprintf(stderr,"Set error[%d] %ld\n",channel,err);
}
else
fprintf(stderr,"Get error[%d] %ld\n",channel,err);

}

thanks

Matt
_______________________________________________
coreaudio-api mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/coreaudio-api
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: setting microphone gain
      • From: Jeff Moore <email@hidden>
  • Prev by Date: CRAudioUnits
  • Next by Date: Basic question
  • Previous by thread: CRAudioUnits
  • Next by thread: Re: setting microphone gain
  • Index(es):
    • Date
    • Thread