mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-04-22 01:22:46 +02:00
Fix #7325: prevent setting the audio session to inactive during recording Fix #7217: ensure that an audio player has its content loaded when it reaches the end to allow seek and replay.
This commit is contained in:
@@ -73,15 +73,18 @@ class VoiceMessageAudioRecorder: NSObject, AVAudioRecorderDelegate {
|
||||
}
|
||||
}
|
||||
|
||||
func stopRecording() {
|
||||
func stopRecording(releaseAudioSession: Bool = true) {
|
||||
audioRecorder?.stop()
|
||||
do {
|
||||
try AVAudioSession.sharedInstance().setActive(false)
|
||||
} catch {
|
||||
delegateContainer.notifyDelegatesWithBlock { delegate in
|
||||
(delegate as? VoiceMessageAudioRecorderDelegate)?.audioRecorder(self, didFailWithError: VoiceMessageAudioRecorderError.genericError) }
|
||||
|
||||
if releaseAudioSession {
|
||||
MXLog.debug("[VoiceMessageAudioRecorder] stopRecording() - releasing audio session")
|
||||
do {
|
||||
try AVAudioSession.sharedInstance().setActive(false)
|
||||
} catch {
|
||||
delegateContainer.notifyDelegatesWithBlock { delegate in
|
||||
(delegate as? VoiceMessageAudioRecorderDelegate)?.audioRecorder(self, didFailWithError: VoiceMessageAudioRecorderError.genericError) }
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
func peakPowerForChannelNumber(_ channelNumber: Int) -> Float {
|
||||
|
||||
Reference in New Issue
Block a user