sound
sound copied to clipboard
Bug: Failed to set the 'buffer'
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
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'))
I use the url address. I want it to be preloaded.
Please create a reproduction. Are you sure loader
is returning a valid URL?
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
}