xA: prevent sound playback GC
Alpine 3.20 Success Details
Arch Linux AUR Success Details
OpenBSD 7.5 Success Details

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
1 changed files with 5 additions and 1 deletions

View File

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