Setting the volume of an Audio Unit
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