AVAudioMix volume/gain curve seems nonlinear
AVAudioMix volume/gain curve seems nonlinear
- Subject: AVAudioMix volume/gain curve seems nonlinear
- From: Jens Alfke <email@hidden>
- Date: Mon, 24 Jun 2013 23:16:16 -0700
The volume level mapping (gain curve) used by AVAudioMix seems to be very different from the one used by the AudioUnit kStereoMixerParam_Volume property. After porting my audio-editor app to AVFoundation — which took only two days! — I’m noticing that fade-ins and fade-outs sound very different than they used to.
Subjectively, most of the audible change in the gain curve is at the low levels, like from 0.0 to 0.25, with much more gradual change from 0.25 to 1.0. Compared to the AudioUnits curve, it seems a lot less audibly linear. I know that the human ear’s response to volume levels is very nonlinear, so AVAudioMix might actually be using linear interpolation, while AudioUnits might be using something like a cubic curve.
Is there any way to customize this curve? The new one seems less useful overall (it doesn’t sound linear), and the large difference from the old curve makes a lot of careful crossfades that I’ve created in my app sound completely wrong now.
(The workaround, I suppose, is to use a series of segments instead of one interpolation, with a lot of calls to -setVolumeRamp:… I hope there aren’t scalability problems with having lots of control points in the volume level of a track.)
—Jens
_______________________________________________
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