mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 10:47:11 +02:00
fixed gap range bug
This commit is contained in:
parent
b60ba0c5a7
commit
85ddb7100c
2 changed files with 3 additions and 4 deletions
|
@ -144,7 +144,6 @@ function handleFoundSoundEntities(entities) {
|
||||||
soundProperties.clipDuration = sound.duration * 1000;
|
soundProperties.clipDuration = sound.duration * 1000;
|
||||||
soundEntityMap[entity] = soundProperties;
|
soundEntityMap[entity] = soundProperties;
|
||||||
|
|
||||||
print("DURATION " + soundProperties.clipDuration);
|
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
// We already have sound downloaded, so just add it to map right away
|
// We already have sound downloaded, so just add it to map right away
|
||||||
|
@ -153,7 +152,6 @@ function handleFoundSoundEntities(entities) {
|
||||||
soundProperties.readyToPlay = true;
|
soundProperties.readyToPlay = true;
|
||||||
soundProperties.isDownloaded = true;
|
soundProperties.isDownloaded = true;
|
||||||
soundEntityMap[entity] = soundProperties;
|
soundEntityMap[entity] = soundProperties;
|
||||||
print("DURATION " + soundProperties.clipDuration);
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
//If this sound is in our map already, we want to reset timeWithoutAvatarInRange
|
//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) {
|
if (currentProps.playbackGapRange !== currentProps.playbackGapRange) {
|
||||||
|
currentProps.playbackGapRange = newProps.playbackGapRange;
|
||||||
currentProps.currentPlaybackGap = currentProps.playbackGap + randFloat(-currentProps.playbackGapRange, currentProps.playbackGapRange);
|
currentProps.currentPlaybackGap = currentProps.playbackGap + randFloat(-currentProps.playbackGapRange, currentProps.playbackGapRange);
|
||||||
currentProps.currentPlaybackGap = Math.max(MIN_PLAYBACK_GAP, currentProps.currentPlaybackGap);
|
currentProps.currentPlaybackGap = Math.max(MIN_PLAYBACK_GAP, currentProps.currentPlaybackGap);
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,9 +25,9 @@ var userData = {
|
||||||
soundKey: {
|
soundKey: {
|
||||||
url: "https://s3-us-west-1.amazonaws.com/hifi-content/eric/Sounds/dove2.wav",
|
url: "https://s3-us-west-1.amazonaws.com/hifi-content/eric/Sounds/dove2.wav",
|
||||||
volume: 0.3,
|
volume: 0.3,
|
||||||
loop: true,
|
loop: false,
|
||||||
playbackGap: 2000, // In ms - time to wait in between clip plays
|
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
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue