mirror of https://github.com/coqui-ai/TTS.git
Update `synthesis` for the new API
This commit is contained in:
parent
4e83bf3968
commit
d8ec7086b6
|
@ -113,8 +113,6 @@ def synthesis(
|
||||||
text,
|
text,
|
||||||
CONFIG,
|
CONFIG,
|
||||||
use_cuda,
|
use_cuda,
|
||||||
ap,
|
|
||||||
tokenizer,
|
|
||||||
speaker_id=None,
|
speaker_id=None,
|
||||||
style_wav=None,
|
style_wav=None,
|
||||||
use_griffin_lim=False,
|
use_griffin_lim=False,
|
||||||
|
@ -139,9 +137,6 @@ def synthesis(
|
||||||
use_cuda (bool):
|
use_cuda (bool):
|
||||||
Enable/disable CUDA.
|
Enable/disable CUDA.
|
||||||
|
|
||||||
ap (TTS.tts.utils.audio.AudioProcessor):
|
|
||||||
The audio processor for extracting features and pre/post-processing audio.
|
|
||||||
|
|
||||||
speaker_id (int):
|
speaker_id (int):
|
||||||
Speaker ID passed to the speaker embedding layer in multi-speaker model. Defaults to None.
|
Speaker ID passed to the speaker embedding layer in multi-speaker model. Defaults to None.
|
||||||
|
|
||||||
|
@ -169,10 +164,10 @@ def synthesis(
|
||||||
if isinstance(style_wav, dict):
|
if isinstance(style_wav, dict):
|
||||||
style_mel = style_wav
|
style_mel = style_wav
|
||||||
else:
|
else:
|
||||||
style_mel = compute_style_mel(style_wav, ap, cuda=use_cuda)
|
style_mel = compute_style_mel(style_wav, model.ap, cuda=use_cuda)
|
||||||
# convert text to sequence of token IDs
|
# convert text to sequence of token IDs
|
||||||
text_inputs = np.asarray(
|
text_inputs = np.asarray(
|
||||||
tokenizer.text_to_ids(text),
|
model.tokenizer.text_to_ids(text),
|
||||||
dtype=np.int32,
|
dtype=np.int32,
|
||||||
)
|
)
|
||||||
# pass tensors to backend
|
# pass tensors to backend
|
||||||
|
|
Loading…
Reference in New Issue