Add process check before terminating audio playback in play_audio function

This commit is contained in:
Aaro Varis
2026-02-19 08:58:45 +02:00
parent ee6091948e
commit ace55084c2

View File

@@ -61,6 +61,7 @@ def play_audio(file_path: str, loop: bool = False) -> Callable[[], None]:
)
def stop():
if process.poll() is None: # Check if the process is still running
process.terminate()
return stop