Re: AVAudioMix volume/gain curve seems nonlinear
Re: AVAudioMix volume/gain curve seems nonlinear
- Subject: Re: AVAudioMix volume/gain curve seems nonlinear
- From: Jens Alfke <email@hidden>
- Date: Tue, 25 Jun 2013 18:42:07 -0700
On Jun 25, 2013, at 5:13 PM, Gordon Apple <email@hidden> wrote:
> I don’t have the definitive answer to your question of how the AV volume level is actually defined, but it would make sense for it to be linear in dB (i.e, logarithmic in power). dB is always a power measurement.
Right. The cubic curve that the AU mixer uses is, I think, a cheaper approximation of this.
> AVAudioMix does the same to get the composite level. If not, they need to rethink this.
No, it’s pretty clearly just a linear interpolation of the raw sample values. Not very useful on its own IMHO.
> If the volume curve turns out to not be what you want, there is nothing preventing you from imposing your own function mapping from your controls (fades, whatever) to AV’s volume level. You can customize it any way you want.
Yeah, I wrote a function to do this. It breaks the time range of the fade into a number of equal segments, applies the cubic mapping to the volume at each point, and adds a linear fade between each. I arbitrarily decided to space the segments at least 1/4 second apart but use no more than 10.
—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