Views
No views yet
pip install TensorFlowTTS1import numpy as np
2import soundfile as sf
3import yaml
4
5import tensorflow as tf
6
7from tensorflow_tts.inference import AutoProcessor
8from tensorflow_tts.inference import TFAutoModel
9
10processor = AutoProcessor.from_pretrained("tensorspeech/tts-fastspeech-ljspeech-en")
11fastspeech = TFAutoModel.from_pretrained("tensorspeech/tts-fastspeech-ljspeech-en")
12
13text = "How are you?"
14
15input_ids = processor.text_to_sequence(text)
16
17mel_before, mel_after, duration_outputs = fastspeech.inference(
18 input_ids=tf.expand_dims(tf.convert_to_tensor(input_ids, dtype=tf.int32), 0),
19 speaker_ids=tf.convert_to_tensor([0], dtype=tf.int32),
20 speed_ratios=tf.convert_to_tensor([1.0], dtype=tf.float32),
21)@article{DBLP:journals/corr/abs-1905-09263,
author = {Yi Ren and
Yangjun Ruan and
Xu Tan and
Tao Qin and
Sheng Zhao and
Zhou Zhao and
Tie{-}Yan Liu},
title = {FastSpeech: Fast, Robust and Controllable Text to Speech},
journal = {CoRR},
volume = {abs/1905.09263},
year = {2019},
url = {http://arxiv.org/abs/1905.09263},
archivePrefix = {arXiv},
eprint = {1905.09263},
timestamp = {Wed, 11 Nov 2020 08:48:07 +0100},
biburl = {https://dblp.org/rec/journals/corr/abs-1905-09263.bib},
bibsource = {dblp computer science bibliography, https://dblp.org}
}@misc{TFTTS,
author = {Minh Nguyen, Alejandro Miguel Velasquez, Erogol, Kuan Chen, Dawid Kobus, Takuya Ebata,
Trinh Le and Yunchao He},
title = {TensorflowTTS},
year = {2020},
publisher = {GitHub},
journal = {GitHub repository},
howpublished = {\\url{https://github.com/TensorSpeech/TensorFlowTTS}},
}