not sure
This commit is contained in:
parent
560398fefb
commit
80ed37298b
73 changed files with 3619 additions and 1295 deletions
|
|
@ -9,8 +9,9 @@ export class NoiseBurstPlayer {
|
|||
) {}
|
||||
|
||||
public play({ startTime, durationSeconds, gain, filterHz, pan }: NoiseBurst): void {
|
||||
const { context, eventBus, noiseBuffer } = this.graph;
|
||||
if (!context || !eventBus || !noiseBuffer) {
|
||||
const { context, eventBus, noiseBus, noiseBuffer } = this.graph;
|
||||
const outputBus = noiseBus ?? eventBus;
|
||||
if (!context || !outputBus || !noiseBuffer) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -25,7 +26,7 @@ export class NoiseBurstPlayer {
|
|||
const stopAt = scheduledStart + durationSeconds;
|
||||
|
||||
source.buffer = noiseBuffer;
|
||||
filter.type = 'bandpass';
|
||||
filter.type = this.config.noiseBurst.filterType;
|
||||
filter.frequency.setValueAtTime(filterHz, scheduledStart);
|
||||
filter.Q.value = this.config.noiseBurst.filterQ;
|
||||
envelope.gain.setValueAtTime(this.config.noiseBurst.silentGain, scheduledStart);
|
||||
|
|
@ -39,7 +40,7 @@ export class NoiseBurstPlayer {
|
|||
source.connect(filter);
|
||||
filter.connect(envelope);
|
||||
envelope.connect(panner);
|
||||
panner.connect(eventBus);
|
||||
panner.connect(outputBus);
|
||||
source.start(
|
||||
scheduledStart,
|
||||
Math.random() * this.config.noiseBurst.offsetRandomSeconds
|
||||
|
|
|
|||
Loading…
Reference in a new issue