mwg API
    Preparing search index...

    Function decodeWav

    • Decodes a PCM (8, 16, 24 or 32 bit) or float32 WAVE file to stereo frames: a mono file is duplicated to both channels, and channels past the second are dropped.

      Parameters

      • bytes: Uint8Array

      Returns StereoFrames

      import { decodeWav } from '@datamoc/mwg/audio';

      declare const bytes: Uint8Array;

      const { sampleRate, left } = decodeWav(bytes);
      console.log(sampleRate, left.length);