From 1120a5f963d1d2c896de59c3f6790fab2536ee98 Mon Sep 17 00:00:00 2001 From: Stephen Birarda Date: Thu, 12 Feb 2015 11:50:48 -0800 Subject: [PATCH] use new injector API in inWorldTestTone --- examples/utilities/diagnostics/inWorldTestTone.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/examples/utilities/diagnostics/inWorldTestTone.js b/examples/utilities/diagnostics/inWorldTestTone.js index 0229654f15..4596bfe2ad 100644 --- a/examples/utilities/diagnostics/inWorldTestTone.js +++ b/examples/utilities/diagnostics/inWorldTestTone.js @@ -21,13 +21,13 @@ var offset = Vec3.normalize(Quat.getFront(MyAvatar.orientation)); var position = Vec3.sum(MyAvatar.position, offset); function update(deltaTime) { - if (!soundPlaying.isPlaying) { - soundPlaying = Audio.playSound(sound, { - position: position, - loop: true - }); - print("Started sound loop"); - } + if (sound.downloaded && !soundPlaying) { + print("Started sound loop"); + soundPlaying = Audio.playSound(sound, { + position: position, + loop: true + }); + } } Script.update.connect(update);