Re: ExtAudioFileRead ioNumberFrames parameter can only be adjusted downward?
Re: ExtAudioFileRead ioNumberFrames parameter can only be adjusted downward?
- Subject: Re: ExtAudioFileRead ioNumberFrames parameter can only be adjusted downward?
- From: Doug Wyatt <email@hidden>
- Date: Fri, 23 Sep 2011 14:55:09 -0700
Be sure that before each call to ExtAudioFileRead you are setting each mDataByteSize in the AudioBufferList to be consistent with the number of frames you are requesting. The read will be limited to the smaller of the number of frames requested and the capacity of the buffer as expressed in mDataByteSize.
On Sep 23, 2011, at 6:09 , patrick machielse wrote:
> Hi,
>
> In my program I'm reading audio frames using ExtAudioFileRead(). I start out reading 512 frames at a time. Because I process the audio in segments, at certain points I read fewer frames to arrive at the exact segment boundary.
>
> It seems that after using a lower value for ioNumberOfFrames it becomes subsequently impossible to read more than this lower amount of frames using ExtAudioFileRead(). If I start out with 512 frames, then reduce it (once!) to 138, and then lift it to 512 again, I will only receive a max of 138 frames until the end of the lifetime of the ExtAudioFile object. I _can_ ask for even fewer frames, which automatically reduces the maximum number of returned frames to this new 'low'.
>
> For some of my files this means that only 2 frames are pulled in at a time, slowing processing in my application down noticeably.
>
> I'm using 10.7.1 at the moment, and I've not investigated this behaviour on other systems.
>
> The docs state that 'Fewer frames may be read', but I believe that should be the exception rather than the rule?
>
> - ioNumberFrames
>
> "On input, the number of frames to read from the file. On output, the number of frames actually read. Fewer frames may be read than were requested. For example, the supplied buffers may not be large enough to accommodate the requested data."
>
> Thanks,
> patrick
> --
> Patrick Machielse
> Hieper Software
>
> http://www.hieper.nl
> email@hidden
>
> _______________________________________________
> 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
_______________________________________________
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