Created
November 7, 2018 02:48
-
-
Save Atlante45/b09a16c12c6a09396eb34737a8a8c92f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var soundURL = "http://hifi-public.s3.amazonaws.com/birarda/medium-crowd.wav"; | |
var injector = null; | |
var sound = null; | |
function startInjector() { | |
injector = Audio.playSound(sound, { | |
position: MyAvatar.position, | |
volume: 0.5, | |
localOnly: false, | |
loop: false | |
}); | |
} | |
sound = SoundCache.getSound(soundURL); | |
if (sound.downloaded) { | |
startInjector(); | |
} else { | |
sound.ready.connect(startInjector); | |
} | |
Script.scriptEnding.connect(function() { | |
injector.stop(); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment