Member Junction
    Preparing search index...

    Interface AudioSplitter

    Splits an audio buffer into pieces small enough for a provider that caps upload size.

    This is a port rather than a bundled implementation on purpose. Splitting audio without re-encoding it means a media tool — in practice an ffmpeg binary — and a ~70MB platform-specific binary is not a dependency an AI provider package should force on every consumer, most of which transcribe short clips and never need it. Applications that do transcribe long audio already have such a tool and inject it here.

    interface AudioSplitter {
        Split(
            audio: Buffer,
            maxBytes: number,
        ): Promise<Buffer<ArrayBufferLike>[]>;
    }
    Index

    Methods

    Methods

    • Split audio into consecutive pieces, each no larger than maxBytes, ordered so that concatenating their transcripts reproduces the whole.

      Implementations should split on time, not byte offsets: cutting a compressed stream mid-frame produces pieces the provider cannot decode.

      Parameters

      • audio: Buffer
      • maxBytes: number

      Returns Promise<Buffer<ArrayBufferLike>[]>