Re: ExtAudioFileWrite: insz - invalid number of frames? (iOS)
Re: ExtAudioFileWrite: insz - invalid number of frames? (iOS)
- Subject: Re: ExtAudioFileWrite: insz - invalid number of frames? (iOS)
- From: renan jegouzo <email@hidden>
- Date: Thu, 15 Dec 2016 08:26:48 +0100
also the buffer could be used by a hardware sound card that share only a
part of the memory with the system, so the audio data must be copied in
the memory accessible by the sound card.
renan
On 15/12/2016 08:06, Bram Bos 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. 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?
>
>
> Or am I supposed to allocate new buffers for every render call (which
> also feels very wrong)?
>
>
> Thanks,
>
> Bram
>
> ------------------------------------------------------------------------
> *From:* James McCartney <email@hidden>
> *Sent:* Wednesday, December 14, 2016 8:33:50 PM
> *To:* Bram Bos
> *Cc:* email@hidden
> *Subject:* Re: ExtAudioFileWrite: insz - invalid number of frames? (iOS)
>
>
>> On Dec 13, 2016, at 9:12 AM, Bram Bos <email@hidden
>> <mailto:email@hidden>> 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 (email@hidden
>> <mailto:email@hidden>)
>> Help/Unsubscribe/Update your Subscription:
>>
>> This email sent to email@hidden <mailto:email@hidden>
>
> James McCartney
> Apple CoreAudio
> email@hidden <mailto: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
>
--
renan jegouzo
software developer
aestesis.net
_______________________________________________
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