Crash when playing music on iOS 13.0+
Haley-Wong opened this issue · 8 comments
the log is :Error: Failed to fill complex buffer in float converter ('insz')
Hi. This worked for me: In AudioKit I changed in file EZOutput.m constant : Float64 const EZOutputDefaultSampleRate = 48000.0f. By default this constant is 44100.0f
@IlyaBlinov For me too it is still not working on iOS 13.0.
EZAudioFloatConverter.m: 218
AudioConverterFillComplexBuffer
If you stop checking OSStatus, it will work.
But the waveform is not displayed.
I found that it just crashed on the real machine and didn't crash on the emulator.
If I comment out exit(-1), it won't crash, but the waveform is still a problem.
After debugging, I found that sometimes frames are not 512, but 91x, which will cause the OSStatus returned by the AudioConverterFillComplexBuffer function to be incorrect.
Hope you fix this bug。
I set in file EZOutput.m constant : Float64 const EZOutputDefaultSampleRate = 44100.0f and in EZAudioFloatConverter.m I am changed method:
(void)convertDataFromAudioBufferList:(AudioBufferList *)audioBufferList
withNumberOfFrames:(UInt32)frames toFloatBuffers:(float **)buffers
packetDescriptions:(AudioStreamPacketDescription *)packetDescriptions. At this method I changed:
OSStatus status = AudioConverterFillComplexBuffer(self.info->converterRef,
EZAudioFloatConverterCallback,
audioBufferList,
&frames,
self.info->floatAudioBufferList,
packetDescriptions ? packetDescriptions : self.info->packetDescriptions);
if (status > 0 ) {
AudioConverterReset(self.info->converterRef);
}
same issue in AudioKit
AudioKit/AudioKit#1873
I set in file EZOutput.m constant : Float64 const EZOutputDefaultSampleRate = 44100.0f and in EZAudioFloatConverter.m I am changed method:
(void)convertDataFromAudioBufferList:(AudioBufferList *)audioBufferList
withNumberOfFrames:(UInt32)frames toFloatBuffers:(float **)buffers
packetDescriptions:(AudioStreamPacketDescription *)packetDescriptions. At this method I changed:
OSStatus status = AudioConverterFillComplexBuffer(self.info->converterRef,
EZAudioFloatConverterCallback,
audioBufferList,
&frames,
self.info->floatAudioBufferList,
packetDescriptions ? packetDescriptions : self.info->packetDescriptions);
if (status > 0 ) {
AudioConverterReset(self.info->converterRef);
}
Great, it works for me! Thank you !
This is still happening to me, the solution doesn't work..