mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-24 18:58:54 +01:00
audio: Sleep 1 msec instead of calling Gosched in JavaScript
This commit is contained in:
parent
0b040e92e8
commit
cc51bc2a08
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user