mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2025-01-26 02:42:02 +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 (
|
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
|
||||||
|
Loading…
Reference in New Issue
Block a user