/** * Generated sound to an OGG Vorbis clip for Valkyrie. ComfyUI saves audio as FLAC, MP3 or * Opus, but Valkyrie's editor lists only .ogg files and Unity plays Vorbis in them, so the * FLAC is decoded and re-encoded here. Both codecs run in WebAssembly (no ffmpeg). */ /** Float samples per channel, -1..1 */ export interface Pcm { channels: Float32Array[]; sampleRate: number; } export declare function decodeFlac(bytes: Uint8Array): Promise; /** Vorbis VBR quality 0..10; 4 is about 128 kb/s for stereo, 3 s of sound is about 50 KB */ export declare function encodeOggVorbis(pcm: Pcm, quality?: number): Promise; export interface FinishOptions { /** Peak level after normalising, in dBFS (default -1) */ peakDb?: number; /** Trailing sound quieter than this, relative to the peak, is cut (default -50 dB) */ trimDb?: number; /** Fade at the end so the clip does not stop with a click, in seconds (default 0.05) */ fadeOut?: number; } export declare function lengthSeconds(pcm: Pcm): number; /** * Peak-normalises a generated clip, cuts its silent tail and fades out the last moment. * Diffusion models fill the whole requested length, so a 4 s door creak often ends in * near-silence; Valkyrie plays clips on top of each other, so dead air is worth cutting. */ export declare function finishClip(pcm: Pcm, opts?: FinishOptions): Pcm; //# sourceMappingURL=clip.d.ts.map