Fix cutoff issue hopefully
This commit is contained in:
@@ -1,3 +1,9 @@
|
||||
# FORK DISCLAIMER
|
||||
|
||||
This is a fork of [LuxTTS](https://github.com/ysharma3501/LuxTTS) applying the fix for [this](https://github.com/ysharma3501/LuxTTS/issues/23) issue. Any changes to that repo should be merged into this one for compatibility.
|
||||
|
||||
---
|
||||
|
||||
# LuxTTS
|
||||
<p align="center">
|
||||
<a href="https://huggingface.co/YatharthS/LuxTTS">
|
||||
|
||||
@@ -82,6 +82,14 @@ def generate(prompt_tokens, prompt_features_lens, prompt_features, prompt_rms, t
|
||||
|
||||
# Convert to waveform
|
||||
pred_features = pred_features.permute(0, 2, 1) / 0.1
|
||||
|
||||
# FIX: Padding for the Vocoder
|
||||
# We take the last frame and repeat it 15 times (approx 150ms buffer)
|
||||
# This gives Vocos enough data to finish the previous sound without cutting it.
|
||||
last_frame = pred_features[:, :, -1:]
|
||||
padding_frames = last_frame.repeat(1, 1, 15)
|
||||
pred_features = torch.cat([pred_features, padding_frames], dim=2)
|
||||
|
||||
wav = vocoder.decode(pred_features).squeeze(1).clamp(-1, 1)
|
||||
|
||||
# Volume matching
|
||||
|
||||
Reference in New Issue
Block a user