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)
|
speaker.Play(mix)
|
||||||
|
|
||||||
|
var oldStreamer beep.StreamCloser
|
||||||
var oldCtrl *beep.Ctrl
|
var oldCtrl *beep.Ctrl
|
||||||
|
|
||||||
for {
|
for {
|
||||||
|
@ -81,13 +82,16 @@ func main() {
|
||||||
if oldCtrl != nil {
|
if oldCtrl != nil {
|
||||||
oldCtrl.Paused = true
|
oldCtrl.Paused = true
|
||||||
oldCtrl.Streamer = nil
|
oldCtrl.Streamer = nil
|
||||||
|
oldStreamer.Close()
|
||||||
}
|
}
|
||||||
|
|
||||||
ctrl.Paused = true
|
ctrl.Paused = true
|
||||||
ctrl.Streamer = streamer
|
ctrl.Streamer = streamer
|
||||||
ctrl.Paused = false
|
ctrl.Paused = false
|
||||||
speaker.Unlock()
|
speaker.Unlock()
|
||||||
|
|
||||||
oldCtrl = ctrl
|
oldCtrl = ctrl
|
||||||
|
oldStreamer = streamer
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue