diff options
author | Přemysl Eric Janouch <p@janouch.name> | 2024-11-14 16:47:51 +0100 |
---|---|---|
committer | Přemysl Eric Janouch <p@janouch.name> | 2024-11-14 16:48:44 +0100 |
commit | a22baa4b553ac08a7f27001fb9a53c441d675727 (patch) | |
tree | 60999173ecd9da6cbe1bc353658e8ee686c6e331 /xA/xA.go | |
parent | b3e545e0bb5c56cefaa0848ac6471a3139e15a75 (diff) | |
download | xK-a22baa4b553ac08a7f27001fb9a53c441d675727.tar.gz xK-a22baa4b553ac08a7f27001fb9a53c441d675727.tar.xz xK-a22baa4b553ac08a7f27001fb9a53c441d675727.zip |
xA: prevent sound playback GC
The beep sound could be cut short.
Diffstat (limited to 'xA/xA.go')
-rw-r--r-- | xA/xA.go | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -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) + } }() } |