开发者

how do you allocate memory for a buffer in iOS

开发者 https://www.devze.com 2023-02-25 05:09 出处:网络
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

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

精彩评论

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