Skip to content

Instantly share code, notes, and snippets.

@SunXiaoShan
Created July 19, 2019 01:35
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/917452b58f06920570e21b20d6e45c41 to your computer and use it in GitHub Desktop.
Save SunXiaoShan/917452b58f06920570e21b20d6e45c41 to your computer and use it in GitHub Desktop.
// Step 1: Register callback
// Callback function will fill buffer. Then add to buffer queue.
status = AudioQueueNewOutput(
&dataFormat,
BufferCallback,
(__bridge void * _Nullable)(self),
CFRunLoopGetCurrent(), // nil
kCFRunLoopCommonModes, // nil
0,
&_queue
);
if (status != noErr) NSLog(@"AudioQueueNewOutput bitrate failed %d", status);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment