fix #32 override mute was not working anymore

This commit is contained in:
Johan Degraeve 2019-10-18 23:48:02 +02:00
parent 7798930456
commit 6d35008f72
1 changed files with 7 additions and 0 deletions

View File

@ -28,6 +28,13 @@ class SoundPlayer {
return
}
do {
try AVAudioSession.sharedInstance().setCategory(AVAudioSession.Category.playback, options: AVAudioSession.CategoryOptions.mixWithOthers)
try AVAudioSession.sharedInstance().setActive(true)
} catch let error {
trace("in playSound, could not set AVAudioSession category to playback and mixwithOthers, error = %{public}@", log: self.log, type: .error, error.localizedDescription)
}
do {
try audioPlayer = AVAudioPlayer(contentsOf: url)