Open shuyangsun opened 8 years ago
I have the same issue. To fix this issue, I add the following code before playing and it works normally. I don't know the reason, but hope it help.
let session: AVAudioSession = AVAudioSession.sharedInstance()
do {
try session.setCategory(AVAudioSessionCategoryPlayback)
try session.setActive(true)
try session.overrideOutputAudioPort(AVAudioSessionPortOverride.Speaker)
} catch {
}
Thank you. I haven't tried it but I assume this code would fix the output volume issue, do you know if this would also fix input volume issue?
I am using EZAudio for some realtime audio analysis and waveform drawing, it works great!
One of the problem I have is that when my app enters background and become active again, the gain for microphone is very small. I checked calculated RMS, those number are significantly smaller.
PS: A new instance of microphone and plot is created every time I do the analysis. I also have no code at all in "applicationDidEnterBackground" callback.
Any ideas?