-
Notifications
You must be signed in to change notification settings - Fork 67
Home
Matt Karl edited this page Dec 24, 2017
·
6 revisions
Welcome to the pixi-sound wiki!
PixiAnimate is a runtime and extension for Adobe Animate 2015+ which exports Pixi.js content. PixiAnimate supports dispatching audio play events, but doesn't actually play the audio file. To hook-up pixi-sound to play audio files, simply add this code to your project:
PIXI.animate.sound.on('play', (alias, loop) => {
PIXI.sound.play(alias, {loop});
});
Note: Make sure pixi-sound is imported after pixi-animate, see issue.
See comment for use with RequireJS.
requirejs.config({
paths: {
'pixi.js': '../node_modules/pixi.js/dist/pixi.min',
'pixi-sound': '../node_modules/pixi-sound/dist/pixi-sound'
},
shim: {
'pixi-sound': {
deps: ['pixi.js']
}
}
})