content/hifi-content/milad/ROLC/Organize/Projects/Hifi-Scripts/Scav-Hunt/Sound-Zone-Server.js
2022-02-14 02:04:11 +01:00

40 lines
No EOL
876 B
JavaScript

(function(){
var _entityId,
soundURL,
soundObject,
soundPlaying;
soundURL = "https://s3.amazonaws.com/hifi-public/sounds/Drums/deepdrum1.wav";
soundObject = SoundCache.getSound(soundURL);
function Sound_Zone_Server(){
}
Sound_Zone_Server.prototype = {
remotelyCallable: [
'playSound',
'stopSound'
],
preload: function(id){
_entityId = id;
},
playSound: function(position){
Audio.playSound(soundObject,{
position: JSON.parse(position),
volume: 1.0,
loop: false
});
},
stopSound: function(){
soundObject.stop();
},
unload: function(){
}
};
return new Sound_Zone_Server();
});