core audio: how can one packet = one byte when clearly one packet = 4 bytes

烂漫一生 提交于 2019-11-29 11:55:20

I think you're right, according to the definition in the AudioFile.h header file, AudioFileWritePackets should take the number of bytes of audio data being written as the third parameter, and in that Learning Core Audio example the framecount variable is defined as the number of packets, not the number of bytes.

I tried the examples out and got the exact same output with (framecount * 4), 0 and even -1 as the third parameter of the AudioFileWritePackets function call. So for me it would seem that the function doesn't work exactly as defined in the .h file (does not require the third parameter), and that in that example the authors of the book have not noticed this error either - I might be wrong though.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!