[英]how do you allocate memory for a buffer in iOS
我有一個AudioQueueBufferRef數據類型,我想為緩沖區分配內存,但是我不想將其與隊列關聯。 因此,我不能使用AudioQueueAllocateBufferWithPacketDescription。 將內存分配給任何緩沖區的一般方法是什么?
我嘗試了malloc但沒有用
for(i=0;i<numBuffers;i++){
AudBuf[i] = (AudioQueueBufferRef)malloc(sizeof(AudioQueueBuffer));
}
AudioQueueBuffer dummyAQB;
audioQueueBuffer = malloc(sizeof(dummyAQB)*kNumAQBufs);
看一下Apple的AudioFileStreamExample 。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.