sound icon indicating copy to clipboard operation
sound copied to clipboard

Bug: Failed to set the 'buffer'

Open meghe2000 opened this issue 1 year ago • 4 comments

pixi-sound.esm.mjs:24 Uncaught DOMException: Failed to set the 'buffer' property on 'AudioBufferSourceNode': Cannot set buffer to non-null after it has been already been set to a non-null buffer at set buffer [as buffer]

sound.add('a1', {
    url: loader('1.mp3'),
    preload: true,
}).play()

Use: pixijs: 7.1.1

meghe2000 avatar Mar 03 '23 14:03 meghe2000

You want to use source not url if you're providing an ArrayBuffer. And you don't need preload

Better yet, do this: sound.add('a1', loader('1.mp3'))

bigtimebuddy avatar Mar 03 '23 14:03 bigtimebuddy

I use the url address. I want it to be preloaded.

meghe2000 avatar Mar 03 '23 15:03 meghe2000

Please create a reproduction. Are you sure loader is returning a valid URL?

bigtimebuddy avatar Mar 03 '23 16:03 bigtimebuddy

Yes it returns a valid url which works fine with other methods.

sound.add({
    '1': loader('1.mp3') //loader return string sound address
})
//worked

loader function for webpack

const assets = require.context('./')
export default function (name) {
    return assets('./' + name).default
}

meghe2000 avatar Mar 03 '23 16:03 meghe2000