From 3cd5bdd16cacc4fdf7f76615f4187329f02846ea Mon Sep 17 00:00:00 2001 From: Alex P Date: Fri, 21 Nov 2025 00:15:38 +0200 Subject: [PATCH] Make RestartAudioOutput async to prevent RPC hanging Consistent with other audio toggle functions, restart now happens asynchronously to avoid blocking the RPC caller. --- audio.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/audio.go b/audio.go index c52428ab..58e56fdd 100644 --- a/audio.go +++ b/audio.go @@ -339,7 +339,12 @@ func RestartAudioOutput() error { audioLogger.Info().Msg("Restarting audio output") stopOutputAudio() - return startAudio() + go func() { + if err := startAudio(); err != nil { + audioLogger.Error().Err(err).Msg("Failed to restart audio output") + } + }() + return nil } func handleInputTrackForSession(track *webrtc.TrackRemote) {