From 797bd04b1f8b3f240adb22d6cbce0d42429319b4 Mon Sep 17 00:00:00 2001 From: Hajime Hoshi Date: Sat, 13 Feb 2016 21:39:45 +0900 Subject: [PATCH] audio: Bug fix: newPlayer should return error in JS --- exp/audio/audio_js.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/exp/audio/audio_js.go b/exp/audio/audio_js.go index 13c43781d..289a19a7f 100644 --- a/exp/audio/audio_js.go +++ b/exp/audio/audio_js.go @@ -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) {