audio: Sleep 1 msec instead of calling Gosched in JavaScript

This commit is contained in:
Hajime Hoshi 2016-04-04 02:54:54 +09:00
parent 0b040e92e8
commit cc51bc2a08

View File

@ -19,7 +19,7 @@ package audio
import (
"errors"
"io"
"runtime"
"time"
"github.com/gopherjs/gopherjs/js"
"github.com/hajimehoshi/ebiten"
@ -64,7 +64,7 @@ func startPlaying(src io.Reader, sampleRate int) error {
// TODO: Record the last error
panic(err)
}
runtime.Gosched()
time.Sleep(1 * time.Millisecond)
}
}()
return nil