updated test

This commit is contained in:
ericrius1 2016-02-18 12:14:30 -08:00
parent ec1c7925c0
commit efbb5ec967

View file

@ -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",