I am using EZaudio to play mp3 files and it works on iOS 12 and below but on physical Device (iPhone X) running iOS 13 app crashed and console print error
Error : Failed to fill complex buffer in float converter
I am using Audiokit and PandoraPlayer framework what may cause this error and how to fix this ?
I'm using this code to configure avaudiosession and it works fine on iOS 12 and below
private func configureAudio() {
do {
try AVAudioSession.sharedInstance().setCategory(.playback, mode: .default)
try AVAudioSession.sharedInstance().setActive(true)
updateCommandCenter()
} catch {
print(error)
}
AKSettings.playbackWhileMuted = true;
AKSettings.enableRouteChangeHandling = true
}
I think EZAudioFloatConverter and microphone may cause this problem but I am not using microphone in my app
I am not sure if this is an issue in AudioKit per se. I don't have nay clue on what is going wrong, so I just want to suggest that you post this to StackOverflow.
I am having exactly the same issue. Also when testing with IOS 13 on physical iPhone. It comes from Audiokit. It did not happen in previous IOS versions.
@mahadshahib where you able to fix it?
No not yet i know what caused this issue but no solution yet i am trying hard to figure out what is going on but no luck yet. This is my email reach me if u found a solution or i can reach you if i found one @francdn
@mahadshahib
I found a temp fix. If I add this line of code it does not seem to crash at the moment.
[AVAudioSession.sharedInstance setPreferredSampleRate:48000 error:nil];
@francen have you test it on an actual device? Cause in my case sample rate on physical device stays the same at 48000 no matter how i change sample rate always stays the same at 48000 on iPhone X but simulator changes sample rate
Yes, I tried. I added the line of code I posted above before starting Audiokit with [AudioKit startAndReturnError:nil]; and at least for now it is not crashing.
It is weird because on my case the samplerate is also supposed to be 48000 before executing that line as well.
In my case
I set avaudiosession to .playback
Set sample rate to 48000
Set avaudiosession to active
But still crashes
@francdn
I am also facing this issue on iOS 13. Does anyone have a working solution?
@francdn your solution is not working for me. Do you have any other ideas?
No sorry. I don't even know if this is working on all devices yet. I guess the developers of Audiokit should check this.
I just set up a sample project here with the EZAudio source code to show the exact error: https://github.com/ashishkeshan/TestEZAudioBug
I am trying to set the sample rate to 48000, but for some reason, the value that is used by the EZAudioPlayer is 44100, which is causing the buffer sizes to be 940 or 941 frames resulting in the mismatch. However, when I plug my bluetooth headphones in, the EZAudioPlayer works perfectly, and the buffer size is 1024 frames. Therefore, I believe the quick fix is to ensure that the EZAudioPlayer internally uses the 48000 sample rate when music is played through the speakers (because the iPhone speakers support a sample rate of 48k hz)
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
@llyaBlinov how can i access .m files on audiokit ?
I downloaded AudioKit source code, changed constant in EZOutput.m and rebuilt Audiokit for me
Most helpful comment
No sorry. I don't even know if this is working on all devices yet. I guess the developers of Audiokit should check this.