From efbb5ec9670a3955912c10de1d1abd4d6c0899f0 Mon Sep 17 00:00:00 2001 From: ericrius1 Date: Thu, 18 Feb 2016 12:14:30 -0800 Subject: [PATCH] updated test --- examples/audioExamples/injectorLoadTest.js | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/examples/audioExamples/injectorLoadTest.js b/examples/audioExamples/injectorLoadTest.js index 35e3e07868..3842678590 100644 --- a/examples/audioExamples/injectorLoadTest.js +++ b/examples/audioExamples/injectorLoadTest.js @@ -12,6 +12,9 @@ Script.include("../libraries/utils.js"); + +var numSoundsToPlayPerBatch = 1; +var timeBetweenBatch = 100; // A green box represents an injector that is playing var basePosition = { @@ -23,6 +26,7 @@ var basePosition = { var soundBoxes = []; var testSound = SoundCache.getSound("https://s3-us-west-1.amazonaws.com/hifi-content/eric/Sounds/dove.wav"); +var totalInjectors = 0; if(!testSound.downloaded) { @@ -37,10 +41,14 @@ if(!testSound.downloaded) { function playSounds() { print("PLAY SOUNDS!") - var numSounds = 45; - for (var i = 0; i < numSounds; i++) { + for (var i = 0; i < numSoundsToPlayPerBatch; i++) { 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 injector = Audio.playSound(testSound, { position: position, - volume: 0.3 + volume: 0.1 }); + totalInjectors++; var soundBox = Entities.addEntity({ type: "Box",