Re: kAudioFormatFlagIsFloat sample range
Re: kAudioFormatFlagIsFloat sample range
- Subject: Re: kAudioFormatFlagIsFloat sample range
- From: "Stephen F. Booth" <email@hidden>
- Date: Sun, 12 Sep 2010 17:01:15 -0700
On Sun, Sep 12, 2010 at 12:09 AM, Brian Willoughby
<email@hidden> wrote:
On Sep 11, 2010, at 20:49, Stephen F. Booth wrote:
If kAudioFormatFlagIsFloat is set as part of an ExtAudioFile's client format, should the returned samples be in the range [-1, 1)? I've always worked under this assumption but I can't find anything explicit in the documentation. I've recently observed samples being returned from AAC files with values >= 1 (and < -1), which is causing clipping on one of my devices. It isn't difficult to perform hard limiting, but this is something I hadn't noticed before.
I was under the impression that CoreAudio device drivers would always hard clip before sending data to the DAC. Is that not happening in your case? I guess hard clipping is not quite as gentle as hard limiting, though...
In my testing the Core Audio drivers do hard clip before data is sent if one is performing mixable IO. In my particular case I am performing non-mixable IO in the device's native format (24 bit LE signed integer) so the drivers are passing my buffers to the DAC unmodified. I didn't verify that the output from ExtAudioFileRead was in the correct range, so I was sending samples > 0x7fffff to the device. Some devices handle this with no audible artifacts, but some don't. For now as a temporary solution I am just clipping the ExtAudioFile return data using vDSP_vclip which solves the problem.
Stephen
_______________________________________________
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