Skip to content

Instantly share code, notes, and snippets.

@Atlante45
Created November 7, 2018 02:49
Show Gist options
  • Save Atlante45/dce200f63be67fa8b09680d2d64aa353 to your computer and use it in GitHub Desktop.
Save Atlante45/dce200f63be67fa8b09680d2d64aa353 to your computer and use it in GitHub Desktop.
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