MCPcopy
hub / github.com/babysor/MockingBird / preprocess_speaker_general

Function preprocess_speaker_general

synthesizer/preprocess_speaker.py:83–99  ·  view source on GitHub ↗
(speaker_dir, out_dir: Path, skip_existing: bool, hparams, dict_info, no_alignments: bool)

Source from the content-addressed store, hash-verified

81 return wav, res
82
83def 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]

Callers

nothing calls this directly

Calls 4

_split_on_silencesFunction · 0.85
_process_utteranceFunction · 0.85
appendMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected