If sound is already downloaded, it's fetched from cache

This commit is contained in:
ericrius1 2016-02-02 16:38:14 -08:00
parent 964763b88c
commit 1bfe14c70e
2 changed files with 3 additions and 3 deletions

View file

@ -40,6 +40,7 @@ print("EBL STARTING AC SCRIPT");
function messageReceived(channel, message, sender) {
print("EBL RECEIVED A MESSAGE FROM ENTITY: " + message);
var entityID = JSON.parse(message).id;
if (soundEntityMap[entityID]) {
// We already have this entity in our sound map, so don't re-add
@ -47,7 +48,6 @@ function messageReceived(channel, message, sender) {
}
EntityViewer.queryOctree();
print("EBL RECEIVED A MESSAGE FROM ENTITY: " + message);
var soundData = getEntityCustomData(SOUND_DATA_KEY, entityID);
print("SOUND DATA " + JSON.stringify(soundData))
if (soundData && soundData.url) {

View file

@ -22,8 +22,8 @@ var SCRIPT_URL = Script.resolvePath("soundEntityScript.js?v1" + Math.random());
var userData = {
soundKey: {
url: "https://s3-us-west-1.amazonaws.com/hifi-content/eric/Sounds/dove.wav",
volume: 1.0,
loop: false
volume: 0.2,
loop: true
}
}