beep experiment
This commit is contained in:
parent
6ad2ec64d4
commit
ea1f6a380a
4
main.go
4
main.go
|
@ -46,6 +46,7 @@ func main() {
|
|||
|
||||
speaker.Play(mix)
|
||||
|
||||
var oldStreamer beep.StreamCloser
|
||||
var oldCtrl *beep.Ctrl
|
||||
|
||||
for {
|
||||
|
@ -81,13 +82,16 @@ func main() {
|
|||
if oldCtrl != nil {
|
||||
oldCtrl.Paused = true
|
||||
oldCtrl.Streamer = nil
|
||||
oldStreamer.Close()
|
||||
}
|
||||
|
||||
ctrl.Paused = true
|
||||
ctrl.Streamer = streamer
|
||||
ctrl.Paused = false
|
||||
speaker.Unlock()
|
||||
|
||||
oldCtrl = ctrl
|
||||
oldStreamer = streamer
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue