From 43a3a4afafad04d6d83b6ac4bc8848868f653476 Mon Sep 17 00:00:00 2001 From: Michael Kirk Date: Mon, 3 Jul 2017 12:57:54 -0500 Subject: [PATCH] play *after* stop In theory this shouldn't make a difference, since we're not playing the ringer twice, but in practice I fail to here ringer audio 50% of the time (in DEBUG builds) while app is in the foreground. // FREEBIE --- Signal/src/call/CallAudioService.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Signal/src/call/CallAudioService.swift b/Signal/src/call/CallAudioService.swift index 61d8226d0..33f739e0e 100644 --- a/Signal/src/call/CallAudioService.swift +++ b/Signal/src/call/CallAudioService.swift @@ -253,13 +253,13 @@ import AVFoundation private func play(sound: Sound) { guard let newPlayer = sound.player else { Logger.error("\(self.TAG) unable to build player") + assertionFailure() return } Logger.info("\(self.TAG) playing sound: \(sound.filePath)") - newPlayer.play() self.currentPlayer?.stop() - + newPlayer.play() self.currentPlayer = newPlayer }