From 056da9ab9430e759a7090e3a81552cc019550d3d Mon Sep 17 00:00:00 2001 From: Eric Rosenbaum Date: Mon, 22 Jul 2019 13:55:49 -0400 Subject: [PATCH] Use offline context to create offline nodes --- src/containers/sound-editor.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/containers/sound-editor.jsx b/src/containers/sound-editor.jsx index bda9a3467..c50a2d48c 100644 --- a/src/containers/sound-editor.jsx +++ b/src/containers/sound-editor.jsx @@ -311,7 +311,7 @@ class SoundEditor extends React.Component { const newLength = sampleRateRatio * buffer.samples.length; const offlineContext = new window.OfflineAudioContext(1, newLength, newRate); const source = offlineContext.createBufferSource(); - const audioBuffer = this.audioContext.createBuffer(1, buffer.samples.length, buffer.sampleRate); + const audioBuffer = offlineContext.createBuffer(1, buffer.samples.length, buffer.sampleRate); audioBuffer.getChannelData(0).set(buffer.samples); source.buffer = audioBuffer; source.connect(offlineContext.destination);