Re: AudioUnits and Volume
Re: AudioUnits and Volume
- Subject: Re: AudioUnits and Volume
- From: Doug Wyatt <email@hidden>
- Date: Thu, 2 Feb 2006 11:55:26 -0800
On Feb 2, 2006, at 11:15, Tobias Rundström wrote:
Hello,
A few months ago I wrote a CoreAudio output driver for XMMS2
(http://xmms2.xmms.org) and it has been working beautifully ever
since. Latest addition to the XMMS2 API is the ability to control
volume on multiple channels. I would like to support this in the
coreaudio driver also.
Two problems arise:
I have been searching the documents on apple.com and google and
everywhere it seems to mention using CoreAudios HAL API to change
volume. AudioDeviceGetProperty (...). Does this mean that I can't
change volume for the higher level (AudioUnits)?
Actually it's the opposite; you're strongly discouraged from touching
the hardware volume (besides, not all devices let you change the
hardware volume). But you can change the volume of an output unit:
Float32 theVolume = ...; // 0-1
AudioUnitSetParameter(anOutputUnit, kHALOutputParam_Volume,
kAudioUnitScope_Global, 0, theVolume, 0);
Even if I can manipulate the volume I can't find a good method to
list available channels on the current device. Is there something
for this in the CoreAudio API somewhere?
yes ... you can ask an audio device for its streams and their
formats ...
But if you're trying to manipulate the volumes of all of the outputs
of a multichannel device, the hardware volumes are the wrong place
(may not be supported and will interfere with other apps if it is),
and the output unit only scales all channels equally. In that case
I'd recommend inserting a matrix mixer before the output unit and
using that to control the volumes.
--
Doug Wyatt
Core Audio, Apple
_______________________________________________
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