mirror of https://github.com/coqui-ai/TTS.git
Add a cheap trick to avoid short audio clips
This commit is contained in:
parent
1a43e05460
commit
7dfd753d91
|
@ -229,7 +229,8 @@ class TTSDataset(Dataset):
|
|||
# after phonemization the text length may change
|
||||
# this is a shareful 🤭 hack to prevent longer phonemes
|
||||
# TODO: find a better fix
|
||||
if len(token_ids) > self.max_text_len:
|
||||
if len(token_ids) > self.max_text_len or len(wav) < self.min_audio_len:
|
||||
self.rescue_item_idx += 1
|
||||
return self.load_data(self.rescue_item_idx)
|
||||
|
||||
# get f0 values
|
||||
|
|
Loading…
Reference in New Issue