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: Tue, 25 Jun 2013 08:52:38 -0700
[I’m starting to work with AVFoundation and have some issues. I’ve tried posting on the coreaudio-api list but haven’t gotten any responses, so I’m wondering whether cocoa-dev is a better place for discussing this API (since it’s Objective-C-based.) Here’s my most recent question:]
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
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden