mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2025-01-13 20:42:07 +01:00
audio/internal/go2cpp: Refactoring
This commit is contained in:
parent
52c609459c
commit
9585c1e09a
@ -21,10 +21,6 @@ import (
|
|||||||
"syscall/js"
|
"syscall/js"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
|
||||||
readChunkSize = 4096
|
|
||||||
)
|
|
||||||
|
|
||||||
type Context struct {
|
type Context struct {
|
||||||
v js.Value
|
v js.Value
|
||||||
sampleRate int
|
sampleRate int
|
||||||
@ -294,6 +290,8 @@ func (p *Player) writeImpl(dst js.Value, src []byte) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (p *Player) loop() {
|
func (p *Player) loop() {
|
||||||
|
const readChunkSize = 4096
|
||||||
|
|
||||||
buf := make([]byte, readChunkSize)
|
buf := make([]byte, readChunkSize)
|
||||||
dst := js.Global().Get("Uint8Array").New(readChunkSize)
|
dst := js.Global().Get("Uint8Array").New(readChunkSize)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user