mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-24 02:38:53 +01:00
audio: Bug fix: half volume of any sound on GopherJS
This commit is contained in:
parent
d455233e32
commit
701de9f82b
@ -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 {
|
||||
|
@ -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)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user