From 6c9979e6ab21b64bf10af6c35d0f4ed52b36d434 Mon Sep 17 00:00:00 2001 From: Yatharth Sharma Date: Sun, 25 Jan 2026 12:13:40 -0500 Subject: [PATCH] Add ref_duration parameter to encode_prompt Updated the encode_prompt function to include a reference duration parameter for improved inference speed. --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 5a14d90..f2d30fe 100644 --- a/README.md +++ b/README.md @@ -82,9 +82,10 @@ t_shift = 0.9 ## sampling param, higher can sound better but worse WER num_steps = 4 ## sampling param, higher sounds better but takes longer(3-4 is best for efficiency) speed = 1.0 ## sampling param, controls speed of audio(lower=slower) return_smooth = False ## sampling param, makes it sound smoother possibly but less cleaner +ref_duration = 5 ## Setting it lower can speedup inference, set to 1000 if you find artifacts. ## encode audio(takes 10s to init because of librosa first time) -encoded_prompt = lux_tts.encode_prompt(prompt_audio, rms=rms) +encoded_prompt = lux_tts.encode_prompt(prompt_audio, duration=ref_duration, rms=rms) ## generate speech final_wav = lux_tts.generate_speech(text, encoded_prompt, num_steps=num_steps, t_shift=t_shift, speed=speed, return_smooth=return_smooth)