omni-compress - v2.3.1
    Preparing search index...

    Interface AudioOptions

    Options for compressAudio().

    interface AudioOptions {
        format?: "opus" | "mp3" | "flac" | "wav" | "auto" | "aac";
        bitrate?: string;
        channels?: 1 | 2;
        sampleRate?: number;
        preserveMetadata?: boolean;
        strict?: boolean;
        useWorker?: boolean;
        onProgress?: (percent: number) => void;
        signal?: AbortSignal;
    }
    Index

    Properties

    format?: "opus" | "mp3" | "flac" | "wav" | "auto" | "aac"

    Target output format. Default: 'auto' (converts WAV/FLAC to MP3).

    bitrate?: string

    Target bitrate, e.g. '128k', '192k'. Encoder default if omitted.

    channels?: 1 | 2

    Output channel count. Defaults to input channel count.

    sampleRate?: number

    Output sample rate in Hz. Defaults to input sample rate.

    preserveMetadata?: boolean

    When true, audio tags/metadata is preserved. Default: false (stripped).

    strict?: boolean

    If the compressed audio is larger than the original, return the original. Default: false.

    useWorker?: boolean

    Explicitly force Web Worker usage (true) or Main Thread usage (false). If omitted, the library chooses based on file size and operation type.

    onProgress?: (percent: number) => void

    Called with progress 0–100 during FFmpeg operations.

    signal?: AbortSignal

    Cancel the operation. Throws AbortError when signalled.