foundryvtt-reve-de-dragon/module/rdd-audio.js

20 lines
596 B
JavaScript
Raw Normal View History

/* -------------------------------------------- */
const context2file = {
"argent": { file: "son_piece_monnaie.mp3", isGlobal: false }
}
/* -------------------------------------------- */
export class RdDAudio {
/* -------------------------------------------- */
static PlayContextAudio(context) {
let audioData = context2file[context];
if ( audioData ) {
let audioPath = "systems/foundryvtt-reve-de-dragon/sounds/" + audioData.file;
console.log(`wfrp4e | Playing Sound: ${audioPath}`)
AudioHelper.play({ src: audioPath }, audioData.isGlobal);
}
}
}