Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: Failed to set the 'buffer' #239

Open
meghe2000 opened this issue Mar 3, 2023 · 4 comments
Open

Bug: Failed to set the 'buffer' #239

meghe2000 opened this issue Mar 3, 2023 · 4 comments

Comments

@meghe2000
Copy link

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

@bigtimebuddy
Copy link
Member

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'))

@meghe2000
Copy link
Author

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

@bigtimebuddy
Copy link
Member

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

@meghe2000
Copy link
Author

meghe2000 commented Mar 3, 2023

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
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants