howler-pixi-loader-middleware
v5.0.0
Published
Loader middleware for PixiJS which maps audio files to Howl instances
Downloads
1,133
Maintainers
Readme
howler-pixi-loader-middleware
PixiJS loader parser for Howler audio
Note: This package has been updated from being loader middleware to being a loader parser for Pixi 7.x, which dramatically changed how assets are loaded in Pixi. If you are using Pixi 6.x or below, you will need to use an older version of this package (e.g. 3.x).
Installation
npm i howler-pixi-loader-middleware
Example
import HowlerLoaderParser from 'howler-pixi-loader-middleware';
import { Assets, extensions } from 'pixi.js';
// add extension before loading assets
extensions.add(HowlerLoaderParser);
// load files (or add to bundle)
const myAudio = await Assets.load('my_audio.mp3');
// after load is complete, use Howl objects as needed
myAudio.play();