You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I tried to use @pixi/sound with new Pixi.Assets loading system like this:
import * as PIXI from 'pixi.js'
import '@pixi/sound'
const url = item.data.src // path to .mp3 file
const sound = await PIXI.Assets.load(url)
I successfully load images this way, but in this example I get this error:
[Assets] <path> could not be loaded as we don't know how to parse it, ensure the correct parser has been added
Seems like LoaderParser for sound files does not add to Pixi extension system. I tried to add the extensions manually:
import {soundAsset} from '@pixi/sound/lib/soundAsset.js'
PIXI.extensions.add(soundAsset)
PIXI.extensions.add(soundAsset.loader)
But I get this error that I cannot even explain:
Error: [Loader.load] Failed to load <src>.
TypeError: Cannot read properties of undefined (reading 'useLegacy')
at _callee2$ (Loader.ts:200:1)
at tryCatch (Loader.js:7:1062)
at Generator.eval (Loader.js:7:3012)
at Generator.eval [as throw] (Loader.js:7:1699)
at asyncGeneratorStep (Loader.js:8:103)
at _throw (Loader.js:9:291)
Finally I gave up and used old preloading system wrapper in promise, like this:
Can you create a minimum reproduction so that we can debug more easily? Functionally this works, as you can see the example here.
Make sure you don't have multiple copies of @pixi/core in your lock file (this can happen if you've upgraded) and could cause this behavior where the parser is getting installed in the wrong place.
Nuxt 2.15.3 + webpack 4.47.0
Pixi version: 7.2.4
@pixi/sound version: 5.2.1
I tried to use @pixi/sound with new Pixi.Assets loading system like this:
I successfully load images this way, but in this example I get this error:
Seems like LoaderParser for sound files does not add to Pixi extension system. I tried to add the extensions manually:
But I get this error that I cannot even explain:
Finally I gave up and used old preloading system wrapper in promise, like this:
But eventually I'd like to revert it back to new Assets system. Where do I do something wrong?
Also I've tried to revert to old versions of pixi.js and @pixi/sound but I kept getting same errors.
The text was updated successfully, but these errors were encountered: