Hello CoreAudio people,

My app has a bunch of PCM float vectors in memory. I want to write them to
disk as a single uncompressed file (CAF, AIFF, or Wave file). The output
file on disk should be interleaved. Do I absolutely have to do this
interleaving on my end?

My code to attempt this is currently failing with "fmt?" when I try to set
the Client ASBD. I'm pretty sure the flags are correct though [Float,
Packed, NonInterleaved], and I filled out the rest of the ASBD for the
total number of vectors.

I have two theories:
a) the only PCM support for writing ExtAudioFileWrite is for you to
interleave vectors as a single mBuffer?
b) it is supported, but only if you set a valid AudioChannelLayout?

Does anyone know if it's possible?

Thanks,

Charles

PS:
As an aside, here's a snippet of how to create an AudioBufferList in Swift
containing more than one mBuffer. Maybe it will save the next guy the pain:

var abl_ptr = AudioBufferList.allocate( maximumBuffers: buffers.count )
defer {
free( abl_ptr.unsafeMutablePointer )
}
for i in 0 ..< buffers.count {
abl_ptr[i] = buffers[i]
}
let abl = abl_ptr.unsafePointer.memory
 _______________________________________________
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