howler-pixi-loader-middleware is a utility package that enables PixiJS's asset loader to seamlessly integrate audio files using the Howler.js library. It maps loaded audio assets directly to `Howl` instances, simplifying audio management within PixiJS applications. The current stable version is 5.0.0, which specifically supports PixiJS v8.x and Howler.js v2.x. This package's release cadence is tightly coupled with major PixiJS releases, requiring updates to match new PixiJS loader APIs (e.g., transitioning from middleware to loader parser in v4 for PixiJS v7.x). Its primary differentiator is providing a direct, standardized way to load and manage audio through PixiJS's robust asset pipeline, making it a go-to choice for games and interactive experiences built with PixiJS that require advanced audio features from Howler.js, such as sprite management and Web Audio API capabilities. It abstracts away the need for manual Howler.js instantiation for assets loaded via Pixi's `Assets` system.
npm install howler-pixi-loader-middlewareVerified import paths — ran on the pinned version, not inferred.
Demonstrates how to register the HowlerLoaderParser with PixiJS and load an audio file, then play and stop it, confirming it's a Howl instance.
Upgrade your PixiJS installation to v8.x or newer, or downgrade howler-pixi-loader-middleware to a v4.x release if you need to maintain PixiJS v7.x.
For PixiJS v7.x and v8.x, ensure you are adding the parser via `extensions.add(HowlerLoaderParser)` as shown in the quickstart example, not `loader.use()`.
For PixiJS v6.x, use howler-pixi-loader-middleware v3.x. For PixiJS v7.x and up, upgrade this package and update your integration as per the new API.
Place `extensions.add(HowlerLoaderParser);` at the earliest point in your application initialization, ideally before `Assets.load()` or `Assets.add()` calls that involve audio files.
Always install `howler` and `pixi.js` versions that are compatible with the specific major version of `howler-pixi-loader-middleware` you are using. Check the `peerDependencies` in the package's `package.json` for guidance.
Update your code to use the new PixiJS loader parser extension API: `extensions.add(HowlerLoaderParser);`.
Verify that `extensions.add(HowlerLoaderParser);` is called before `Assets.load('my_audio.mp3');` and that your `howler-pixi-loader-middleware` version is compatible with your `pixi.js` version (e.g., v5.x for PixiJS v8.x).Ensure the audio file path is correct, the `HowlerLoaderParser` is correctly added as an extension, and that `howler.js` is installed and functioning. Check browser console for earlier loading errors.