From ff0be0092b6484c928247d64916a1f744b039804 Mon Sep 17 00:00:00 2001 From: Beingpax Date: Sun, 16 Nov 2025 22:45:03 +0545 Subject: [PATCH] Fix: Prevent abrupt stop of custom sound playback --- VoiceInk/SoundManager.swift | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/VoiceInk/SoundManager.swift b/VoiceInk/SoundManager.swift index b327dd4..e4d46b1 100644 --- a/VoiceInk/SoundManager.swift +++ b/VoiceInk/SoundManager.swift @@ -52,6 +52,13 @@ class SoundManager: ObservableObject { } private func reloadCustomSoundsAsync() async { + if customStartSound?.isPlaying == true { + customStartSound?.stop() + } + if customStopSound?.isPlaying == true { + customStopSound?.stop() + } + customStartSound = loadAndPreparePlayer(from: CustomSoundManager.shared.getCustomSoundURL(for: .start)) customStopSound = loadAndPreparePlayer(from: CustomSoundManager.shared.getCustomSoundURL(for: .stop)) }