From fd5e3d61dc5d9a9a78ece4fc9b976fcee3dc3b42 Mon Sep 17 00:00:00 2001 From: Craig Hansen-Sturm Date: Mon, 25 Aug 2014 10:55:11 -0700 Subject: [PATCH] minor cleanup of playSoundOrbit.js + playSound.js --- examples/playSound.js | 4 ++-- examples/playSoundOrbit.js | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/examples/playSound.js b/examples/playSound.js index 867768f807..189c24e86f 100644 --- a/examples/playSound.js +++ b/examples/playSound.js @@ -12,14 +12,14 @@ var bird = new Sound("https://s3-us-west-1.amazonaws.com/highfidelity-public/sounds/Animals/bushtit_1.raw"); function maybePlaySound(deltaTime) { -// if (Math.random() < 0.01) { + if (Math.random() < 0.01) { // Set the location and other info for the sound to play var options = new AudioInjectionOptions(); var position = MyAvatar.position; options.position = position; options.volume = 0.5; Audio.playSound(bird, options); -// } + } } // Connect a call back that happens every frame diff --git a/examples/playSoundOrbit.js b/examples/playSoundOrbit.js index 92b8e0a96e..4349eac888 100644 --- a/examples/playSoundOrbit.js +++ b/examples/playSoundOrbit.js @@ -19,19 +19,19 @@ var debug = 0; function playSound() { var options = new AudioInjectionOptions(); currentTime += deltaTime; - + var s = distance * Math.sin(currentTime); var c = distance * Math.cos(currentTime); var soundOffset = { x:s, y:0, z:c }; - + if( debug ) { print("t=" + currentTime + "offset=" + soundOffset.x + "," + soundOffset.y + "," + soundOffset.z); } - + var avatarPosition = MyAvatar.position; var soundPosition = Vec3.sum(avatarPosition,soundOffset); - + options.position = soundPosition options.volume = 1.0; Audio.playSound(soundClip, options);