> On Dec 14, 2016, at 11:06 PM, Bram Bos <bram...@outlook.com> wrote: > > Thanks James, I will try that. > > But I'm wondering what the rationale here is because it seems > counterintuitive. > Obviously the buffers have been allocated before starting the audio rendering > thread, and the "mDataByteSize" property is a description of these buffers.
In this case, mDataByteSize is the amount of valid data in the buffer, not the capacity of the buffer. > Feels strange to change this description on the fly depending on the Audio > Unit calls... That's what the "inNumberFrames" parameter in the AURenderBlock > is for, isn't it? I’m not sure what you mean by changing it on the fly. You have a buffer of some capacity. It is up to you to know the capacity. mDataByteSize is for communicating the current amount of valid data to ExtAudioFile, not for communicating the capacity. ExtAudioFile doesn’t care about the capacity. > > Or am I supposed to allocate new buffers for every render call (which also > feels very wrong)? No, definitely not. > > Thanks, > Bram > From: James McCartney <jmccart...@apple.com <mailto:jmccart...@apple.com>> > Sent: Wednesday, December 14, 2016 8:33:50 PM > To: Bram Bos > Cc: coreaudio-api@lists.apple.com <mailto:coreaudio-api@lists.apple.com> > Subject: Re: ExtAudioFileWrite: insz - invalid number of frames? (iOS) > > >> On Dec 13, 2016, at 9:12 AM, Bram Bos <bram...@outlook.com >> <mailto:bram...@outlook.com>> wrote: >> >> I'm creating a perfectly looping audio file by writing the output buffers of >> an AudioUnit to an ExtAudioFile. >> All buffers are 1024 frames, except the last one, which is 68 frames. >> >> I'm writing the buffers (in an offline rendering loop) to the file using >> >> result = ExtAudioFileWrite( outputStreamFile, numberOfFrames, >> renderBufferList ); >> >> When attempting to write the last, smaller, buffer this function call >> returns "1768846202" which translates into "insz" indicating an invalid >> buffer size. >> >> What exactly is invalid about this size? The buffer is big enough and the >> error message is returned regardless of whether I render exactly 68 frames >> or the usual 1024 frames. > > insz means that the buffer list you passed in has a mDataByteSize that is not > equal to numberOfFrames * sizeof(the-sample-type), or if your client format > is interleaved then numberOfFrames * numberOfChannels * > sizeof(the-sample-type) > > mDataByteSize has to match, it is not allowed to be greater than. > > >> >> What am I missing here? >> _______________________________________________ >> Do not post admin requests to the list. They will be ignored. >> Coreaudio-api mailing list (Coreaudio-api@lists.apple.com >> <mailto:Coreaudio-api@lists.apple.com>) >> Help/Unsubscribe/Update your Subscription: >> https://lists.apple.com/mailman/options/coreaudio-api/jmccartney%40apple.com >> <https://lists.apple.com/mailman/options/coreaudio-api/jmccartney%40apple.com> >> >> This email sent to jmccart...@apple.com <mailto:jmccart...@apple.com> > James McCartney > Apple CoreAudio > jmccart...@apple.com <mailto:jmccart...@apple.com> > > > > _______________________________________________ > Do not post admin requests to the list. They will be ignored. > Coreaudio-api mailing list (Coreaudio-api@lists.apple.com > <mailto:Coreaudio-api@lists.apple.com>) > Help/Unsubscribe/Update your Subscription: > https://lists.apple.com/mailman/options/coreaudio-api/jmccartney%40apple.com > <https://lists.apple.com/mailman/options/coreaudio-api/jmccartney%40apple.com> > > This email sent to jmccart...@apple.com <mailto:jmccart...@apple.com> James McCartney Apple CoreAudio jmccart...@apple.com
_______________________________________________ Do not post admin requests to the list. They will be ignored. Coreaudio-api mailing list (Coreaudio-api@lists.apple.com) Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/coreaudio-api/archive%40mail-archive.com This email sent to arch...@mail-archive.com