Commit 4f76d922 authored by marioromera's avatar marioromera
Browse files

sound listen app

parent 99152b60
......@@ -18,6 +18,9 @@
window.yourTurnAudio = soundManager.createSound({
id: 'yourTurnAudio',
url: './yourTurn.mp3',
autoPlay: true,
volume: 100,
loops: 3
});
},
});
......
......@@ -81,7 +81,9 @@ export default function Drawing(svgId) {
if (myTurn) {
// AUDIO
if (window.soundManager) {
window.soundManager.setVolume('yourTurnAudio', 80);
const vol = 80;
console.log("setting volume to", vol);
window.soundManager.setVolume('yourTurnAudio', vol);
}
letterCoords.forEach((letter) => {
......@@ -104,7 +106,9 @@ export default function Drawing(svgId) {
});
} else {
console.log('Finishing turn');
if (window.soundManager) soundManager.setVolume('yourTurnAudio', 0);
if (window.soundManager) {
console.log('Setting volume to 0');
soundManager.setVolume('yourTurnAudio', 0);}
this.myTurnG.selectAll('path').remove();
}
});
......
......@@ -13,11 +13,11 @@ drawId(state.id);
import _ from 'lodash';
document.addEventListener('click', playSound, false);
document.querySelector('.app').addEventListener('click', playSound, false);
function playSound(e) {
console.log('PLay sound', e);
window.yourTurnAudio.play({ loops: 3, volume: 100 });
window.yourTurnAudio.play();
}
import Drawing from './components/drawing';
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment