Skip to content

Instantly share code, notes, and snippets.

@SunXiaoShan
Created July 19, 2019 01:30
Show Gist options
  • Save SunXiaoShan/a11a67c7e4a0dfc6904cb819b7971bef to your computer and use it in GitHub Desktop.
Save SunXiaoShan/a11a67c7e4a0dfc6904cb819b7971bef to your computer and use it in GitHub Desktop.
AudioToolbox
static const UInt32 maxBufferSize = 0x10000;
static const UInt32 minBufferSize = 0x4000;
static const UInt32 maxBufferNum = 3;
@interface AudioPlayerManager() {
AudioFileID _audioFile;
AudioStreamBasicDescription _dataFormat;
AudioQueueRef _queue;
UInt32 numPacketsToRead;
AudioStreamPacketDescription *packetDescs;
AudioQueueBufferRef buffers[maxBufferNum];
SInt64 packetIndex;
UInt32 maxPacketSize;
UInt32 outBufferSize;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment