• 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
Re: Setting the volume of an Audio Unit
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Setting the volume of an Audio Unit


  • Subject: Re: Setting the volume of an Audio Unit
  • From: David Duncan <email@hidden>
  • Date: Tue, 7 Nov 2006 06:36:15 -0800

On Nov 7, 2006, at 05:29 AM, Kevin Brown wrote:

But when I called audioDeviceHasVolumeControl (defaultOutputDeviceID, 0) I always got false, which makes no sense to me, because obviously the default output device has adjustable volume.

Having adjustable volume, and having a volume control are two entirely separate things. Many controls on audio hardware are optional, if only because they can be simulated in software. A volume control is one of them.


What I really want to do is to have just my application's volume controllable from my preferences window without interfering with the system volume (ala iTunes, Adium etc). How do I go about this?

I presume you want to change the final mixed output volume on your Audio output audio unit? Here is the magic incantation:


AudioUnitSetParameter(outputAU, kHALOutputParam_Volume, kAudioUnitScope_Global, 0, volumeScaler, 0);

where volumeScaler is between 0.0 and 1.0 (inclusive) and outputAU is your output audio unit.

--
Reality is what, when you stop believing in it, doesn't go away.
Failure is not an option. It is a privilege reserved for those who try.

David Duncan

_______________________________________________
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


References: 
 >Setting the volume of an Audio Unit (From: Kevin Brown <email@hidden>)

  • Prev by Date: Setting the volume of an Audio Unit
  • Next by Date: Custom AU Data (unseen by user, stored by host)
  • Previous by thread: Setting the volume of an Audio Unit
  • Next by thread: Custom AU Data (unseen by user, stored by host)
  • Index(es):
    • Date
    • Thread