在iPhone6s上,AKplayer和AKAudioPlayer插入式耳机静音,而iPhone8s AKplayer仍在播放。 我已经尝试了很多方法,但都没有成功
这是我的代码:
do {
AKSettings.playbackWhileMuted = true;
try AKSettings.setSession(category: .playback, with: .mixWithOthers)
let backFile = Bundle.main.path(forResource: "1", ofType: "mp3")!
let backUrl = URL.init(string: backFile)!
backPlayer = AKPlayer.init(url: backUrl)
AudioKit.output = backPlayer
do {
try AudioKit.start()
} catch {
print("AudioKit.start()失败")
}
} catch {
AKLog("Could not set session category.")
}