also the buffer could be used by a hardware sound card that share only a
part of the memory with the system, so the 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 protected]>
> *Sent:* Wednesday, December 14, 2016 8:33:50 PM
> *To:* Bram Bos
> *Cc:* [email protected]
> *Subject:* Re: ExtAudioFileWrite: insz - invalid number of frames? (iOS)
>  
> 
>> On Dec 13, 2016, at 9:12 AM, Bram Bos <[email protected]
>> <mailto:[email protected]>> 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 protected]
>> <mailto:[email protected]>)
>> Help/Unsubscribe/Update your Subscription:
>> https://lists.apple.com/mailman/options/coreaudio-api/jmccartney%40apple.com
>>
>> This email sent to [email protected] <mailto:[email protected]>
> 
> James McCartney
> Apple CoreAudio
> [email protected] <mailto:[email protected]>
> 
> 
> 
> 
> 
>  _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Coreaudio-api mailing list      ([email protected])
> Help/Unsubscribe/Update your Subscription:
> https://lists.apple.com/mailman/options/coreaudio-api/renan%40aestesis.org
> 
> This email sent to [email protected]
> 

-- 
renan jegouzo
software developer
aestesis.net

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/coreaudio-api/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to