ltx23_encode_audio

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: An ltx23_audio_vae (with encoder weights).
  • wav: Matrix [2, samples] in [-1, 1] at 16 kHz (see ltx23_read_audio).
  • audio_num_frames: Integer. Target latent length.
  • frontend: Optional prebuilt ltx23_audio_mel_frontend.

Value

Packed normalized latents [1, audio_num_frames, 128] (float32).