fixed gap range bug

This commit is contained in:
ericrius1 2016-02-08 16:51:04 -08:00
parent b60ba0c5a7
commit 85ddb7100c
2 changed files with 3 additions and 4 deletions

View file

@ -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);
}

View file

@ -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
}
}