mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2025-01-26 10:42:42 +01:00
audio: Bug fix: newPlayer should return error in JS
This commit is contained in:
parent
72e0080f65
commit
797bd04b1f
@ -49,7 +49,7 @@ func initialize() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
func newPlayer(src io.ReadSeeker, sampleRate int) *Player {
|
||||
func newPlayer(src io.ReadSeeker, sampleRate int) (*Player, error) {
|
||||
if context == nil {
|
||||
if !initialize() {
|
||||
panic("audio couldn't be initialized")
|
||||
@ -62,7 +62,7 @@ func newPlayer(src io.ReadSeeker, sampleRate int) *Player {
|
||||
position: context.Get("currentTime").Float(),
|
||||
bufferSource: nil,
|
||||
}
|
||||
return &Player{p}
|
||||
return &Player{p}, nil
|
||||
}
|
||||
|
||||
func toLR(data []byte) ([]int16, []int16) {
|
||||
|
Loading…
Reference in New Issue
Block a user