mwg API
    Preparing search index...

    Function resampleStereo

    • Converts stereo frames to another sample rate by linear interpolation. Linear is audibly soft above the new Nyquist, which is the right trade for ambience and background music where this is used to save memory; a game that needs a clean conversion renders at the target rate instead.

      Type Parameters

      Parameters

      • frames: T
      • sampleRate: number

      Returns T

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

      declare const frames: { sampleRate: number; left: Float32Array; right: Float32Array };

      const half = resampleStereo(frames, frames.sampleRate / 2);
      console.log(half.left.length);