mdx-m3-viewer
Version:
A browser WebGL model viewer. Mainly focused on models of the games Warcraft 3 and Starcraft 2.
16 lines (13 loc) • 404 B
text/typescript
let audioContext: OfflineAudioContext;
// Some browsers don't have OfflineAudioContext or AudioContext.
if (typeof OfflineAudioContext === 'function') {
audioContext = new OfflineAudioContext(1, 1, 48000);
}
/**
* A context-less decodeAudioData().
*/
export function decodeAudioData(buffer: ArrayBuffer) {
if (audioContext) {
return audioContext.decodeAudioData(buffer);
}
}