Audio Sprite Loader and Plugin for Webpack
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
src
test
usage
.gitignore
.npmignore
.travis.yml
LICENSE
README.md
package.json
tsconfig.json
yarn.lock

README.md

Webpack Audio Sprite Loader & Plugin

Audio Sprite loader for Webpack. This loader currently only supports howler.js format. It should be pretty easy to support other audio libraries though.

Usage

Install the loader.

npm install audiosprite-loader

webpack.config.js

const AudioSprite = require("audiosprite-loader");

module.exports = {
    module: {
        loaders: [
            {
              test: /\.(wav|mp3)$/,
              loader: AudioSprite.loader()
            }
        ]
    },
    plugins: [
        new AudioSprite.Plugin()
    ]
}

index.js

const audio = require("./audio/file.wav");
audio.play();

Dependencies

You'll need ffmpeg installed.

OSX

brew install ffmpeg --with-theora --with-libvorbis

License

MIT