mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2025-01-12 20:18:59 +01:00
audio/mp3: Bug fix: Avoid using a detached ArrayBuffer
This commit is contained in:
parent
8c9a11ddf4
commit
4c70ad382d
@ -186,7 +186,7 @@ func decode(context *audio.Context, buf []byte, try int) (*Stream, error) {
|
||||
|
||||
// TODO: 1 is a correct second argument?
|
||||
oc := offlineAudioContextClass.New(2, 1, context.SampleRate())
|
||||
a := js.ValueOf(buf).Get("buffer")
|
||||
a := js.ValueOf(buf).Get("buffer").Call("slice", 0, len(buf))
|
||||
oc.Call("decodeAudioData", a, js.NewCallback(func(args []js.Value) {
|
||||
buf := args[0]
|
||||
s.leftData = float32ArrayToSlice(buf.Call("getChannelData", 0))
|
||||
|
Loading…
Reference in New Issue
Block a user