我看着this example from the Portaudio page想知道为什么作者使用
data.rBufToRTData = PaUtil_AllocateMemory(sizeof(OceanWave*) * 256);
而不是
data.rBufToRTData = malloc(sizeof(OceanWave*) * 256);
我在Portaudio网站上找不到答案。
最佳答案
不应使用PaUtil_AllocateMemory()
。它不是PortAudio公共API的一部分。我已经申请了bug against the example。谢谢你提出这个问题。
也就是说,这个例子似乎是为了演示PortAudio中一些低级内部数据结构的使用。特别是PortAudio环缓冲区。它不应该被当作使用PortAudio公共API的好例子。