mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-24 18:58:54 +01:00
audio: Use AudioBuffer's duration
This commit is contained in:
parent
719e5ba6d2
commit
14d28ea122
@ -60,9 +60,8 @@ func (a *audioProcessor) playChunk(buf []byte) {
|
||||
s := context.Call("createBufferSource")
|
||||
s.Set("buffer", b)
|
||||
s.Call("connect", context.Get("destination"))
|
||||
|
||||
s.Call("start", a.position)
|
||||
a.position += float64(len(il)) / float64(a.sampleRate)
|
||||
a.position += b.Get("duration").Float()
|
||||
}
|
||||
|
||||
func isPlaying(channel int) bool {
|
||||
|
Loading…
Reference in New Issue
Block a user