CookiePPP / cookietts

[Last Updated 2021] TTS from Cookie. Messy and experimental!
BSD 3-Clause "New" or "Revised" License
43 stars 8 forks source link

pyloudnorm error on short files #8

Closed DatGuy1 closed 4 years ago

DatGuy1 commented 4 years ago

In extremely short files, such as Combine_soldiers/vo/ion.wav (Duration: 00:00:00.28, bitrate: 706 kb/s), the default block_size of 0.400 in meter isn't enough to pass pyloudnorm's valid_audio check.

  File "cookietts/CookieTTS/utils/dataset/data_utils.py", line 790,
    loudness = meter.integrated_loudness(audio.numpy()) # measure loudness (in d
  File "pyloudnorm/meter.py", li
    util.valid_audio(input_data, self.rate, self.block_size)
  File "pyloudnorm/util.py", lin
    raise ValueError("Audio must have length greater than the block size.")
ValueError: Audio must have length greater than the block size.
CookiePPP commented 4 years ago

Files that short should be filtered out before training.

https://github.com/CookiePPP/cookietts/blob/62ffb029e9235f62aab932ca331385808ade2efe/CookieTTS/utils/dataset/data_utils.py#L169-L171


I assume you used the _1_preprocess script or did it manually? Is it okay if I add checks to remove these shorter files? edit: I just checked, the preprocess script is supposed to have a min_duration param but it looks like it's not implemented correctly.