Skip to content
Snippets Groups Projects
Commit 056da9ab authored by Eric Rosenbaum's avatar Eric Rosenbaum
Browse files

Use offline context to create offline nodes

parent 5062518d
Branches
No related tags found
No related merge requests found
......@@ -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);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment