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

Setting the volume of an Audio Unit


  • Subject: Setting the volume of an Audio Unit
  • From: Kevin Brown <email@hidden>
  • Date: Tue, 7 Nov 2006 05:29:23 -0800

I'm using CoreAudio to play a sequence I'm creating in software and playing back using a custom created SF2 sound bank. The problem is that I can't figure out how to set the volume. I've tried lots of things:

AudioUnitSetParameter(synth, kMusicDeviceParam_Volume, kAudioUnitScope_Global, 0, volume, 0);

as well as a huge pile of code that boiled down to attempting to do it with:

AudioDeviceSetProperty(defaultOutputDeviceID,
									   NULL, //time stamp not needed
									   0, //channel 0 is master channel
									   false,  //for an output device
									   kAudioDevicePropertyVolumeScalar,
									   sizeof(Float32),
									   &newVolume);

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.

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?

Note: I found the tech note on setting Audio Unit volume and it didn't seem to help me at all as I stated above.
_______________________________________________
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: Setting the volume of an Audio Unit
      • From: David Duncan <email@hidden>
  • Prev by Date: Re: Reading the contents of an Audio file
  • Next by Date: Re: Setting the volume of an Audio Unit
  • Previous by thread: Re: DeferredRender strangeness AudioUnitUninitialize
  • Next by thread: Re: Setting the volume of an Audio Unit
  • Index(es):
    • Date
    • Thread