aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPřemysl Eric Janouch <p@janouch.name>2024-11-14 16:47:51 +0100
committerPřemysl Eric Janouch <p@janouch.name>2024-11-14 16:48:44 +0100
commita22baa4b553ac08a7f27001fb9a53c441d675727 (patch)
tree60999173ecd9da6cbe1bc353658e8ee686c6e331
parentb3e545e0bb5c56cefaa0848ac6471a3139e15a75 (diff)
downloadxK-origin/master.tar.gz
xK-origin/master.tar.xz
xK-origin/master.zip
xA: prevent sound playback GCorigin/master
The beep sound could be cut short.
-rw-r--r--xA/xA.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/xA/xA.go b/xA/xA.go
index 17a0400..f501622 100644
--- a/xA/xA.go
+++ b/xA/xA.go
@@ -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)
+ }
}()
}