Re: AVAudioMix volume/gain curve seems nonlinear
Re: AVAudioMix volume/gain curve seems nonlinear
- Subject: Re: AVAudioMix volume/gain curve seems nonlinear
- From: Gordon Apple <email@hidden>
- Date: Tue, 25 Jun 2013 19:13:57 -0500
- Thread-topic: AVAudioMix volume/gain curve seems nonlinear
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. Growing up,
I was always told that a dB was the smallest volume change a person could
detect. While that is not the definition, it is close to being true. A Bel
is the base 10 logarithm of a power ratio, often referenced to a standard
level (e.g., dBm.), and a dB being 10x that. Using a volume control and a
meter in some of my AVFoundation implementations, the volume and meter seem
to be linearly related. When I meter combined audios, I convert each back
to power, add, then reconvert to dB. I hope AVAudioMix does the same to get
the composite level. If not, they need to rethink this.
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.
On 6/25/13 2:00 PM, " Jens Alfke <email@hidden> wrote:
> [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