diff --git a/audio/mp3/decode_js.go b/audio/mp3/decode_js.go index 16d0cb4c5..6da1fdcd5 100644 --- a/audio/mp3/decode_js.go +++ b/audio/mp3/decode_js.go @@ -119,9 +119,12 @@ func Decode(context *audio.Context, src audio.ReadSeekCloser) (*Stream, error) { case 2: s.rightData = buf.Call("getChannelData", 1).Interface().([]float32) default: - ch <- fmt.Errorf("audio/mp3: Number of channels must be 1 or 2 but %d", n) + ch <- fmt.Errorf("audio/mp3: number of channels must be 1 or 2 but %d", n) } close(ch) + }, func(err *js.Object) { + ch <- fmt.Errorf("audio/mp3: decoding failed: %s", err.String()) + close(ch) }) if err := <-ch; err != nil { return nil, err