Fix: Prevent abrupt stop of custom sound playback
This commit is contained in:
parent
7365493366
commit
ff0be0092b
@ -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))
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user