• 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
Help: About Input Volume
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Help: About Input Volume


  • Subject: Help: About Input Volume
  • From: "aizhimin" <email@hidden>
  • Date: Mon, 5 Dec 2005 21:02:00 +0800

Hi:
 
I want to control the USB Audio device's Volume.
 
And I can adjust it's output volume (use AudioDeviceSetProperty directly)
 
But I can't adjust it's Input volume (use AudioDeviceSetProperty too)
 
I don't know why , I wrote code like this:
 
//---------------------------------------------------------------------------
 
// Change output's volume and successfully !
 
float theValue = 0.8;
 
Boolean isWritable;
err = AudioDeviceGetPropertyInfo (
    outputDeviceID, 1, false,            // channel: 1 = left channel; 2 = right channel
    kAudioDevicePropertyVolumeScalar,
    NULL, &isWritable );

if ( (err == kAudioHardwareNoError)&& isWritable)
{
    err = AudioDeviceSetProperty (
    outputDeviceID, NULL, 1, false,
    kAudioDevicePropertyVolumeScalar,
    sizeof(float), &theValue );
}

err = AudioDeviceGetPropertyInfo (
    outputDeviceID, 2, false,            // channel: 1 = left channel; 2 = right channel
    kAudioDevicePropertyVolumeScalar,
    NULL, &isWritable);
 
if ( (err == kAudioHardwareNoError)&& isWritable)
{
    err = AudioDeviceSetProperty (
    outputDeviceID, NULL, 2, false,
    kAudioDevicePropertyVolumeScalar,
    sizeof(float), &theValue );
}
 
// Change input's volume and failed !
err = AudioDeviceGetPropertyInfo (
    inputDevice,
    1,            // I have tryed set channel form 0 to 100, but everytime returned by "err = 2003332927"
    false,
    kAudioDevicePropertyVolumeScalar,
    NULL, &isWritable);
 
//----------------------------------------------------------
 
Who can help me ??? Help me ~~~~
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Help: About Input Volume
      • From: David Duncan <email@hidden>
  • Prev by Date: Re: AudioOuputUnitStop
  • Next by Date: Re: Help: About Input Volume
  • Previous by thread: Re: PhysicalFormat vs. VirtualFormat
  • Next by thread: Re: Help: About Input Volume
  • Index(es):
    • Date
    • Thread