add basic outline of audio for room

This commit is contained in:
jorsi
2020-05-29 17:53:18 -04:00
parent 978f53d40b
commit 12c6559802
13 changed files with 358 additions and 321 deletions
+2 -2
View File
@@ -51,7 +51,7 @@ var AudioEngine = {
}
// fade in new track
var fadeTime = this.audioContext.currentTime + 5.0;
var fadeTime = this.audioContext.currentTime + 2.0;
newTrack.connect(this.tracks[nextBackgroundChannel]);
newTrack.start(0);
this.tracks[nextBackgroundChannel].gain.setValueAtTime(0.0, this.audioContext.currentTime);
@@ -60,7 +60,7 @@ var AudioEngine = {
// fade out old track
this.tracks[this.currentBackgroundChannel].gain.linearRampToValueAtTime(0.0, fadeTime);
if (this.currentTrack) {
this.currentTrack.stop(fadeTime + 1.0); // make sure fade has completed
this.currentTrack.stop(fadeTime + 0.3); // make sure fade has completed
}
// switch background track