Created
November 7, 2018 02:49
-
-
Save Atlante45/dce200f63be67fa8b09680d2d64aa353 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: true | |
}); | |
} | |
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