xA: prevent sound playback GC
All checks were successful
Alpine 3.20 Success
Arch Linux AUR Success
OpenBSD 7.5 Success

The beep sound could be cut short.
This commit is contained in:
Přemysl Eric Janouch 2024-11-14 16:47:51 +01:00
parent b3e545e0bb
commit a22baa4b55
Signed by: p
GPG Key ID: A0420B94F92B9493

View File

@ -281,7 +281,11 @@ func beep() {
}
go func() {
<-otoReady
otoContext.NewPlayer(bytes.NewReader(beepSample)).Play()
p := otoContext.NewPlayer(bytes.NewReader(beepSample))
p.Play()
for p.IsPlaying() {
time.Sleep(time.Second)
}
}()
}