repo: janusweb action: commit revision: path_from: revision_from: 89ef291392dac1e1e0c7993674b48babff04b355: path_to: revision_to:
commit 89ef291392dac1e1e0c7993674b48babff04b355 Author: James BaicoianuDate: Tue Nov 2 01:26:52 2021 -0700 room.playSound() now supports asset and js_id modes diff --git a/scripts/room.js b/scripts/room.js
--- a/scripts/room.js
+++ b/scripts/room.js
@@ -1584,9 +1584,13 @@ console.log('connect room audio to graph', this.audionodes.gain, this.audionodes
}
this.playSound = function(name, properties) {
if (!this.sounds[name]) {
- this.sounds[name] = this.createObject('Sound', {
- id: name
- });
+ if (room.objects[name]) {
+ this.sounds[name] = room.objects[name];
+ } else {
+ this.sounds[name] = this.createObject('Sound', {
+ id: name
+ });
+ }
}
if (this.sounds[name]) {
if (properties) {
-----END OF PAGE-----