Skip to content

Instantly share code, notes, and snippets.

@SunXiaoShan
Created July 19, 2019 01:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save SunXiaoShan/b2c47b0269ef06b0c55811a4ce37d893 to your computer and use it in GitHub Desktop.
Save SunXiaoShan/b2c47b0269ef06b0c55811a4ce37d893 to your computer and use it in GitHub Desktop.
// Step 6: Allocate buffer
for (int i = 0; i < maxBufferNum; i++) {
// Step 6.1: allock the buffer
status = AudioQueueAllocateBuffer(
_queue,
outBufferSize,
&buffers[i]
);
if (status != noErr) NSLog(@"AudioQueueAllocateBuffer failed %d", status);
// Step 6.2: Fill the audio data to buffer
[self audioQueueOutputWithQueue:_queue
queueBuffer:buffers[i]];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment