diff --git a/internal/audio/audio_js.go b/internal/audio/audio_js.go index 0dd9d7aaf..3ba89dcf3 100644 --- a/internal/audio/audio_js.go +++ b/internal/audio/audio_js.go @@ -38,7 +38,7 @@ func initialize() { r := e.Get("outputBuffer").Call("getChannelData", 1) inputL, inputR := loadChannelBuffers() nextInsertionPosition -= min(bufferSize, nextInsertionPosition) - const max = 1 << 16 + const max = 1 << 15 for i := 0; i < bufferSize; i++ { // TODO: Use copyFromChannel? if len(inputL) <= i { diff --git a/internal/audio/audio_openal.go b/internal/audio/audio_openal.go index a673f41c2..1ddf4bc92 100644 --- a/internal/audio/audio_openal.go +++ b/internal/audio/audio_openal.go @@ -31,7 +31,7 @@ func toBytes(l, r []int16) []byte { panic("len(l) must equal to len(r)") } b := &bytes.Buffer{} - for i, _ := range l { + for i := 0; i < len(l); i++ { if err := binary.Write(b, binary.LittleEndian, []int16{l[i], r[i]}); err != nil { panic(err) }