Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import { OfflineAudioContext } from 'standardized-audio-context';
const offlineAudioContext = new OfflineAudioContext(1, 1, 44100);
export const loadFixtureAsAudioBuffer = (fixture) => fetch(`/base/test/fixtures/${ fixture }`)
.then((response) => response.arrayBuffer())
.then((arrayBuffer) => offlineAudioContext.decodeAudioData(arrayBuffer));
export function createOfflineAudioContext(channels: number, length: number, sampleRate: number): OfflineAudioContext {
return new stdOfflineAudioContext(channels, length, sampleRate) as unknown as OfflineAudioContext;
}