/** * @fileoverview Minimal WAV (RIFF) encoder for raw Float32 PCM. * * The browser path gets its WAV from `convertAudioBufferToWav`, which needs a Web * Audio `AudioBuffer`. Node has no such thing: the Kokoro model hands back a bare * `Float32Array`, and long documents are synthesized one chunk at a time and * joined before encoding. Both of those are pure buffer work, so they live here * with no platform dependency. */ /** * Joins per-chunk sample buffers into one contiguous track. * * @param chunks Sample buffers in playback order. * @param silenceSamples Samples of silence to insert between chunks, so the * seams between separately synthesized chunks do not sound clipped. */ export declare function concatSamples(chunks: Float32Array[], silenceSamples?: number): Float32Array; /** * Encodes Float32 samples (nominally -1..1) as a 16-bit PCM WAV file. * * @param samples Interleaved samples when `channels` is greater than 1. * @param sampleRate Sample rate of the audio, e.g. 24000 for Kokoro. * @param channels Channel count. Kokoro is mono. */ export declare function encodeWav(samples: Float32Array, sampleRate?: number, channels?: number): ArrayBuffer; /** Duration of a Float32 track in seconds, for progress and log lines. */ export declare function wavDurationSeconds(samples: Float32Array, sampleRate: number): number;