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