Encode audio into normalized, packed conditioning latents
Description
Pads or trims the waveform so the latent length equals
audio_num_frames (mel frames 4L - 3, mirroring the
decoder’s target_frames), computes the log-mel, encodes in
argmax mode, packs, and normalizes with the checkpoint statistics.
Usage
ltx23_encode_audio(audio_vae, wav, audio_num_frames, frontend = NULL)
Arguments
audio_vae: Anltx23_audio_vae(with encoder weights).wav: Matrix [2, samples] in [-1, 1] at 16 kHz (seeltx23_read_audio).audio_num_frames: Integer. Target latent length.frontend: Optional prebuiltltx23_audio_mel_frontend.
Value
Packed normalized latents [1, audio_num_frames, 128] (float32).