• 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: StereoMixer and Volume distribution
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: StereoMixer and Volume distribution


  • Subject: Re: StereoMixer and Volume distribution
  • From: Kurt Revis <email@hidden>
  • Date: Sat, 7 Oct 2006 15:19:37 -0700

On Oct 7, 2006, at 1:29 PM, Hari Seldon wrote:

I seem to have almost everything working with my CoreAudio implementation except for some small audio tweaks. My main problem right now is with the distribution of Volume between 0..1 when using the StereoMixerAU. I have implemented similar controls on windows using DirectX, and was able to develop my own dB logarthmic conversion so that when someone slides the Volume between 0..1 it is smooth. But now I find that the distribution of volume on the Mac is a little steep. Going between 1 and .5 is a large change while .5 to 0 gets quiet very quickly.

Are you using the parameter kStereoMixerParam_Volume? If so, note that AudioParameters.h says:


 	// Input/Output, Mixer Fader Curve, 0->1, 1
	kStereoMixerParam_Volume 	= 0,

The "Mixer Fader Curve" is defined in AudioUnitProperties.h as:

kAudioUnitParameterUnit_MixerFaderCurve1 = 17,
/* 0.0 -> 1.0, pow(x, 3.0) -> linear gain to simulate a reasonable mixer channel fader response */


So if your sample has value y and the mixer channel's volume is set to x, the result is y * pow(x, 3.0).

If you want a value that linearly scales the samples, just invert that function -- set the volume to cbrt(your linear volume). You ought to be able to go from linear values to dB yourself.

It looks like you could also use AUParameterValueFromLinear() and AUParameterValueToLinear() to do this, as well.

Also, if you're using an output AU to play the result of the mixer AU, note that its volume parameter kHALOutputParam_Volume is linear. (It wasn't clear if you were asking about the volumes of individual channels on the mixer, or the mixer output as a whole.)

Are there other ways to change the volume on my graph (a bunch of AUConverters going into the StereoMixer)?

No, AUConverters are for converting format, and aren't relevant to this problem.


--
Kurt Revis
email@hidden

_______________________________________________
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: 
 >StereoMixer and Volume distribution (From: Hari Seldon <email@hidden>)

  • Prev by Date: StereoMixer and Volume distribution
  • Next by Date: AudioUnitAddRenderNotify and AudioUnitRender mDataByteSize
  • Previous by thread: StereoMixer and Volume distribution
  • Next by thread: Re: StereoMixer and Volume distribution
  • Index(es):
    • Date
    • Thread