Recurse if inited but no deviceOpen

This commit is contained in:
NeilClack
2026-04-23 17:29:21 -05:00
parent 9c88f0c9fd
commit c8756d0528
+4 -1
View File
@@ -113,8 +113,11 @@ func Play(path string, loopForever bool, cfg *db.AppConfig) error {
defer mu.Unlock()
// Check if mixer has been initialized and that a device is open
// JUMP: This is where the issue is...
if !inited || !deviceOpen {
if !deviceOpen {
SwitchDevice("") // Re-switch to the default device
Play(path, loopForever, cfg) // Re-run the function
}
logger.Error("audio mixer not initialized")
return errors.New("audio mixer not initialized")
}