An experimental SDK module for loading and playing sounds
- Paste this module into your project
- Configure your
config.js
to includeimport { AnimatedEventModule } from './animations/AnimatedEventModule.js';
and addAnimatedEventModule
to the declaration of themodules
array. - In your Referee, include
@Inject AnimatedEventModule animatedEventModule;
. - Include sounds in the
assets/sounds/
folder. - Delete any already existing
demo.js
file fromsrc/main/resources/view/
In your Referee's gameTurn
:
// Play sound at t = 0
ViewerEvent soundEvent = animatedEventModule.createAnimationEvent("Sound", 0.0);
soundEvent.params.put("path", "sounds/death.wav");
- on/off switch
- Preload sounds instead of downloading them when first played.