Re: AVAudioMix volume/gain curve seems nonlinear
Re: AVAudioMix volume/gain curve seems nonlinear
- Subject: Re: AVAudioMix volume/gain curve seems nonlinear
- From: Kyle Sluder <email@hidden>
- Date: Tue, 25 Jun 2013 09:14:08 -0700
You're better off posting here than cocoa-dev.
On Jun 24, 2013, at 11:16 PM, Jens Alfke < email@hidden> wrote: 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.)
If you're concerned about performance, you could do a piece wise approximation of a cubic curve.
--Kyle Sluder
|
_______________________________________________
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