From 85ddb7100c9bfd6d23b82aab8f3714ffe0114d52 Mon Sep 17 00:00:00 2001 From: ericrius1 Date: Mon, 8 Feb 2016 16:51:04 -0800 Subject: [PATCH] fixed gap range bug --- .../audioExamples/acAudioSearching/ACAudioSearchAndInject.js | 3 +-- .../acAudioSearching/acAudioSearchCompatibleEntitySpawner.js | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/examples/audioExamples/acAudioSearching/ACAudioSearchAndInject.js b/examples/audioExamples/acAudioSearching/ACAudioSearchAndInject.js index d20e132113..f7fbb2140b 100644 --- a/examples/audioExamples/acAudioSearching/ACAudioSearchAndInject.js +++ b/examples/audioExamples/acAudioSearching/ACAudioSearchAndInject.js @@ -144,7 +144,6 @@ function handleFoundSoundEntities(entities) { soundProperties.clipDuration = sound.duration * 1000; soundEntityMap[entity] = soundProperties; - print("DURATION " + soundProperties.clipDuration); }); } else { // We already have sound downloaded, so just add it to map right away @@ -153,7 +152,6 @@ function handleFoundSoundEntities(entities) { soundProperties.readyToPlay = true; soundProperties.isDownloaded = true; soundEntityMap[entity] = soundProperties; - print("DURATION " + soundProperties.clipDuration); } } else { //If this sound is in our map already, we want to reset timeWithoutAvatarInRange @@ -177,6 +175,7 @@ function checkForSoundPropertyChanges(currentProps, newProps) { } if (currentProps.playbackGapRange !== currentProps.playbackGapRange) { + currentProps.playbackGapRange = newProps.playbackGapRange; currentProps.currentPlaybackGap = currentProps.playbackGap + randFloat(-currentProps.playbackGapRange, currentProps.playbackGapRange); currentProps.currentPlaybackGap = Math.max(MIN_PLAYBACK_GAP, currentProps.currentPlaybackGap); } diff --git a/examples/audioExamples/acAudioSearching/acAudioSearchCompatibleEntitySpawner.js b/examples/audioExamples/acAudioSearching/acAudioSearchCompatibleEntitySpawner.js index 455ff13427..96516af45f 100644 --- a/examples/audioExamples/acAudioSearching/acAudioSearchCompatibleEntitySpawner.js +++ b/examples/audioExamples/acAudioSearching/acAudioSearchCompatibleEntitySpawner.js @@ -25,9 +25,9 @@ var userData = { soundKey: { url: "https://s3-us-west-1.amazonaws.com/hifi-content/eric/Sounds/dove2.wav", volume: 0.3, - loop: true, + loop: false, playbackGap: 2000, // In ms - time to wait in between clip plays - playbackGapRange: 0 // In ms - the range to wait in between clip plays + playbackGapRange: 500 // In ms - the range to wait in between clip plays } }