mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-07-23 11:04:02 +02:00
updated test
This commit is contained in:
parent
ec1c7925c0
commit
efbb5ec967
1 changed files with 13 additions and 4 deletions
|
@ -12,6 +12,9 @@
|
||||||
|
|
||||||
Script.include("../libraries/utils.js");
|
Script.include("../libraries/utils.js");
|
||||||
|
|
||||||
|
|
||||||
|
var numSoundsToPlayPerBatch = 1;
|
||||||
|
var timeBetweenBatch = 100;
|
||||||
// A green box represents an injector that is playing
|
// A green box represents an injector that is playing
|
||||||
|
|
||||||
var basePosition = {
|
var basePosition = {
|
||||||
|
@ -23,6 +26,7 @@ var basePosition = {
|
||||||
var soundBoxes = [];
|
var soundBoxes = [];
|
||||||
|
|
||||||
var testSound = SoundCache.getSound("https://s3-us-west-1.amazonaws.com/hifi-content/eric/Sounds/dove.wav");
|
var testSound = SoundCache.getSound("https://s3-us-west-1.amazonaws.com/hifi-content/eric/Sounds/dove.wav");
|
||||||
|
var totalInjectors = 0;
|
||||||
|
|
||||||
if(!testSound.downloaded) {
|
if(!testSound.downloaded) {
|
||||||
|
|
||||||
|
@ -37,10 +41,14 @@ if(!testSound.downloaded) {
|
||||||
|
|
||||||
function playSounds() {
|
function playSounds() {
|
||||||
print("PLAY SOUNDS!")
|
print("PLAY SOUNDS!")
|
||||||
var numSounds = 45;
|
for (var i = 0; i < numSoundsToPlayPerBatch; i++) {
|
||||||
for (var i = 0; i < numSounds; i++) {
|
|
||||||
playSound();
|
playSound();
|
||||||
}
|
}
|
||||||
|
print("EBL Total Number of Injectors: " + totalInjectors);
|
||||||
|
|
||||||
|
Script.setTimeout(function() {
|
||||||
|
playSounds();
|
||||||
|
}, timeBetweenBatch);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -48,8 +56,9 @@ function playSound() {
|
||||||
var position = Vec3.sum(basePosition, {x: randFloat(-.1, .1), y: randFloat(-1, 1), z: randFloat(-3, -.1)});
|
var position = Vec3.sum(basePosition, {x: randFloat(-.1, .1), y: randFloat(-1, 1), z: randFloat(-3, -.1)});
|
||||||
var injector = Audio.playSound(testSound, {
|
var injector = Audio.playSound(testSound, {
|
||||||
position: position,
|
position: position,
|
||||||
volume: 0.3
|
volume: 0.1
|
||||||
});
|
});
|
||||||
|
totalInjectors++;
|
||||||
|
|
||||||
var soundBox = Entities.addEntity({
|
var soundBox = Entities.addEntity({
|
||||||
type: "Box",
|
type: "Box",
|
||||||
|
|
Loading…
Reference in a new issue