diff --git a/Tone/instrument/PolySynth.ts b/Tone/instrument/PolySynth.ts index 506dfd90d..cac98c29b 100644 --- a/Tone/instrument/PolySynth.ts +++ b/Tone/instrument/PolySynth.ts @@ -10,6 +10,7 @@ import { MetalSynth, MetalSynthOptions } from "./MetalSynth"; import { Monophonic } from "./Monophonic"; import { Synth, SynthOptions } from "./Synth"; import { warn } from "../core/util/Debug"; +import { OfflineContext } from "../core/context/OfflineContext"; type VoiceConstructor = { getDefaults: () => VoiceOptions; @@ -193,7 +194,9 @@ export class PolySynth = Synth> extends Instrument const firstAvail = this._availableVoices.shift() as Voice; const index = this._voices.indexOf(firstAvail); this._voices.splice(index, 1); - firstAvail.dispose(); + if (!(this.context instanceof OfflineContext)) { + firstAvail.dispose(); + } } }