开发者

how do you allocate memory for a buffer in iOS

I have an AudioQueueBufferRef datatype and I want to allocate memory for the buffers but I don't want to associate it with the queue. Hence, I can't use AudioQueueAllocateBufferWithPacketDescription. What is the general way of allocating memory to开发者_如何学运维 any buffer?

I tried malloc but it didn't work

        for(i=0;i<numBuffers;i++){
          AudBuf[i] = (AudioQueueBufferRef)malloc(sizeof(AudioQueueBuffer));

}


Have a look at the AudioFileStreamExample from apple.


AudioQueueBuffer dummyAQB;
audioQueueBuffer = malloc(sizeof(dummyAQB)*kNumAQBufs);
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜