From ca6cc86ca124122dcfda7909b0d4cdd9e605fb89 Mon Sep 17 00:00:00 2001 From: Ryan Huffman Date: Tue, 27 May 2014 11:35:00 -0700 Subject: [PATCH] Add playSoundWave.js --- examples/playSoundWave.js | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 examples/playSoundWave.js diff --git a/examples/playSoundWave.js b/examples/playSoundWave.js new file mode 100644 index 0000000000..419fd80cd2 --- /dev/null +++ b/examples/playSoundWave.js @@ -0,0 +1,22 @@ +// +// playSoundWave.js +// examples +// +// Created by Ryan Huffman on 05/27/14. +// Copyright 2014 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html +// + +var soundClip = new Sound("https://s3-us-west-1.amazonaws.com/highfidelity-public/sounds/Cocktail%20Party%20Snippets/Walken1.wav"); + +function playSound() { + var options = new AudioInjectionOptions(); + var position = MyAvatar.position; + options.position = position; + options.volume = 0.5; + Audio.playSound(soundClip, options); +} + +Script.setInterval(playSound, 10000);