Skip to content

🎥 Make videos programmatically with React

Delete get-waveform.ts

Jonny Burgercdf577d9aa2e
diff --git a/packages/cli/src/editor/helpers/get-waveform.ts b/packages/cli/src/editor/helpers/get-waveform.ts
deleted file mode 100644
index d4552a47ca..0000000000
--- a/packages/cli/src/editor/helpers/get-waveform.ts
+++ /dev/null
@@ -1,16 +0,0 @@
-const waveFormCache: {[src: string]: Float32Array} = {};
-
-export const getWaveform = async (src: string): Promise<Float32Array> => {
- if (waveFormCache[src]) {
- return waveFormCache[src];
- }
- const audioContext = new AudioContext();
-
- const response = await fetch(src);
- const arrayBuffer = await response.arrayBuffer();
-
- const wave = await audioContext.decodeAudioData(arrayBuffer);
- const channelData = wave.getChannelData(0);
- waveFormCache[src] = channelData;
- return channelData;
-};