mwg API
    Preparing search index...

    Function estimateExportBytes

    • A rough size in bytes for an export, before spending the time on it: WAV is exact (about 10 MB a minute in stereo at 44.1 kHz), Opus follows its bit rate, FLAC takes about 60 percent of the 16-bit PCM it holds (a rule of thumb for synthesised music, not a promise).

      Parameters

      • request: Pick<ExportRequest, "format" | "bitrate" | "bitsPerSample">
      • seconds: number
      • sampleRate: number

      Returns number

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

      console.log(Math.round(estimateExportBytes({ format: 'wav' }, 60, 44100) / 1e6)); // 11