Skip to content

Commit

Permalink
Set avatar-audio-source audio early
Browse files Browse the repository at this point in the history
  • Loading branch information
keianhzo committed May 31, 2023
1 parent d6a8384 commit a127efa
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/components/avatar-audio-source.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,9 @@ AFRAME.registerComponent("avatar-audio-source", {
createSilentAudioEl(stream); // TODO: Do the audio els need to get cleaned up?
}

APP.audios.set(this.el, audio);
APP.gains.set(this.el, gain);

this.mediaStreamSource = APP.audioCtx.createMediaStreamSource(stream);
this.mediaStreamSource.connect(audio);
this.el.emit("sound-source-set", { soundSource: audio });
Expand All @@ -83,8 +86,6 @@ AFRAME.registerComponent("avatar-audio-source", {
} else {
APP.moderatorAudioSource.delete(this.el);
}
APP.audios.set(this.el, audio);
APP.gains.set(this.el, gain);
updateAudioSettings(this.el, audio);
updateAudio(this.el, this.el.object3D, true);

Expand Down

0 comments on commit a127efa

Please sign in to comment.