I need to analyze the audio played by device itself
That means I play and record simultaneously
So I set audioSession like this:
try audioSession.setCategory(.playAndRecord, mode: .videoChat, options: .defaultToSpeaker)
But there is always a warning from this:
assert(remainderf(sizeFloat, powf(2.0, lg2)) == 0, "size must be a power of 2")
It seems that the buffer will be effect when the audioSession set
I can modify the buffer size by try audioSession.setPreferredIOBufferDuration(0.1)
But the size always can not be power of 2
I need to analyze the audio played by device itself That means I play and record simultaneously
So I set audioSession like this: try audioSession.setCategory(.playAndRecord, mode: .videoChat, options: .defaultToSpeaker)
But there is always a warning from this: assert(remainderf(sizeFloat, powf(2.0, lg2)) == 0, "size must be a power of 2") It seems that the buffer will be effect when the audioSession set
I can modify the buffer size by try audioSession.setPreferredIOBufferDuration(0.1) But the size always can not be power of 2
How can I fix this problem? Thanks