(speaker_dir, out_dir: Path, skip_existing: bool, hparams, dict_info, no_alignments: bool)
| 81 | return wav, res |
| 82 | |
| 83 | def preprocess_speaker_general(speaker_dir, out_dir: Path, skip_existing: bool, hparams, dict_info, no_alignments: bool): |
| 84 | metadata = [] |
| 85 | extensions = ["*.wav", "*.flac", "*.mp3"] |
| 86 | for extension in extensions: |
| 87 | wav_fpath_list = speaker_dir.glob(extension) |
| 88 | # Iterate over each wav |
| 89 | for wav_fpath in wav_fpath_list: |
| 90 | words = dict_info.get(wav_fpath.name.split(".")[0]) |
| 91 | words = dict_info.get(wav_fpath.name) if not words else words # try with wav |
| 92 | if not words: |
| 93 | print("no wordS") |
| 94 | continue |
| 95 | sub_basename = "%s_%02d" % (wav_fpath.name, 0) |
| 96 | wav, text = _split_on_silences(wav_fpath, words, hparams) |
| 97 | metadata.append(_process_utterance(wav, text, out_dir, sub_basename, |
| 98 | skip_existing, hparams)) |
| 99 | return [m for m in metadata if m is not None] |
nothing calls this directly
no test coverage detected