Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
UInt32 CalculateOutputBufferSize(AudioConverterRef audioConverter,
UInt32 iPacketsPerBuffer) {
UInt32 size = 0;
Boolean isWritable = false;
CheckError(AudioConverterGetPropertyInfo(audioConverter,
kAudioConverterPropertyMaximumOutputPacketSize,
&size,
&isWritable),
"Getting the Audio Converter property value size for property kAudioConverterPropertyMaximumOutputPacketSize");
UInt32 maximumOutputPackeSize = 0;
CheckError(AudioConverterGetProperty(audioConverter,
kAudioConverterPropertyMaximumOutputPacketSize,
&size,
&maximumOutputPackeSize),
"Getting the Audio Converter Property: MaximumOutputPacketSize");
return iPacketsPerBuffer * maximumOutputPackeSize;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment