mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2025-01-11 19:48:54 +01:00
audio: time.Sleep to avoid busy loop
This commit is contained in:
parent
f07702746c
commit
681b8ef933
@ -22,6 +22,7 @@ import (
|
|||||||
"runtime"
|
"runtime"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
"github.com/hajimehoshi/ebiten"
|
||||||
"golang.org/x/mobile/exp/audio/al"
|
"golang.org/x/mobile/exp/audio/al"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -146,7 +147,7 @@ func (p *player) start() error {
|
|||||||
// TODO: Record the last error
|
// TODO: Record the last error
|
||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
runtime.Gosched()
|
time.Sleep(1 * time.Second / ebiten.FPS / 2)
|
||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
return nil
|
return nil
|
||||||
|
Loading…
Reference in New Issue
Block a user