cocoa - Storing AudioBufferLists from the ExtAudioFile API for later use -
After using the Xcode / Cocoa and ExtAudioFile API, I am trying to remove the objectbuffer list * object for later use, but I am having trouble accessing the data again. This object repeated repeats ExtAudioFileRead calls Coming from.
I realize that I can not only bring these audiobilist * objects to NSAA, but I had the impression that an NSPointerArray would work for this purpose. However, when audio buffer list-> ambufers [0] .mditta attempts to access audio buffer lists after accumulating in NSPIeter arrays, they only come out of zero.
I was recalling the Audiobuffer list to the Audiobuff list because I am reusing the same audio buffer list for each ExtAudioFileRead call. I'm not sure that this is enough, though, and remembering the ZERO * AUDIOBOOFER-LIST-> MBAFFER [0]. The MDAATA object is not helping either.
What is the easiest way to store these audio buffer lists * objects? Am I on the right track?
Audiobufer lists keep your data in audioBufferList.mBuffers [i] .mData < / Code>.
mData is
zero *
and the actual type of value is determined by the output format you specify.
Example: If you have defined kAudioFormatFlagsCanonical
, kAudioFormatLinearPCM ,
mBitsPerChannel = 32
and mFramesPerPacket = 1
As your output format, the mData-array type value is AudioSampleType
(which is float32
A typedef)
If you select any other format then the array can have SInt16 values or something else.
Then you should know about your output type when you copy the content of MData.
If you know the format, then you can simply create a Sea-Array
datacopy = calloc (DataSize, Sizes (float 32));
and memcpy audioBufferList.mBuffers [i] .mData in that
If you want to use Cocoa NSMutableArray, you need to wrap Float in an NSNumber object.