Created
June 11, 2021 05:24
-
-
Save pmatsinopoulos/d3a20a586a7c8e870faf44cf72b34d58 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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