mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-26 03:38:55 +01:00
audio: Make sure to fill 4096 bytes
This commit is contained in:
parent
e69b44e327
commit
c090805021
@ -89,6 +89,8 @@ func (p *player) proceed() error {
|
|||||||
p.position = c
|
p.position = c
|
||||||
}
|
}
|
||||||
b := make([]byte, bufferSize)
|
b := make([]byte, bufferSize)
|
||||||
|
for 0 < len(b) {
|
||||||
|
print(len(b))
|
||||||
n, err := p.src.Read(b)
|
n, err := p.src.Read(b)
|
||||||
if 0 < n {
|
if 0 < n {
|
||||||
const channelNum = 2
|
const channelNum = 2
|
||||||
@ -107,8 +109,13 @@ func (p *player) proceed() error {
|
|||||||
p.bufferSource.Call("connect", p.context.Get("destination"))
|
p.bufferSource.Call("connect", p.context.Get("destination"))
|
||||||
p.bufferSource.Call("start", maxF(p.position, c))
|
p.bufferSource.Call("start", maxF(p.position, c))
|
||||||
p.position += buf.Get("duration").Float()
|
p.position += buf.Get("duration").Float()
|
||||||
|
b = b[n:]
|
||||||
}
|
}
|
||||||
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (p *player) start() error {
|
func (p *player) start() error {
|
||||||
|
Loading…
Reference in New Issue
Block a user