Fix clapping silence issue

This commit is contained in:
Zach Fox 2019-08-20 14:22:13 -07:00
parent 58d83b6455
commit 8b79dc3020
17 changed files with 3 additions and 3 deletions

View file

@ -100,8 +100,8 @@ function calculateInjectorVolume(clapIntensity) {
var soundInjector = false; var soundInjector = false;
var MINIMUM_PITCH = 0.85; var MINIMUM_PITCH = 0.85;
var MAXIMUM_PITCH = 1.15; var MAXIMUM_PITCH = 1.15;
function playSound(sound, position) { function playSound(sound, position, stopPrevious) {
if (soundInjector && soundInjector.isPlaying()) { if (soundInjector && soundInjector.isPlaying() && !stopPrevious) {
return; return;
} }
@ -134,7 +134,7 @@ function startClappingSounds() {
maybeClearClapSoundInterval(); maybeClearClapSoundInterval();
clapSoundInterval = Script.setInterval(function() { clapSoundInterval = Script.setInterval(function() {
playSound(clapSounds[Math.floor(Math.random() * clapSounds.length)]); playSound(clapSounds[Math.floor(Math.random() * clapSounds.length)], MyAvatar.position, true);
}, CLAP_SOUND_INTERVAL_MS); }, CLAP_SOUND_INTERVAL_MS);
} }