Update README.md
Browse files
README.md
CHANGED
@@ -14,8 +14,20 @@ license: cc-by-4.0
|
|
14 |
|
15 |
This model was trained by kan-bayashi using csmsc/tts1 recipe in [espnet](https://github.com/espnet/espnet/).
|
16 |
### Demo: How to use in ESPnet2
|
|
|
|
|
|
|
|
|
|
|
|
|
17 |
```python
|
18 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
19 |
```
|
20 |
### Citing ESPnet
|
21 |
```BibTex
|
|
|
14 |
|
15 |
This model was trained by kan-bayashi using csmsc/tts1 recipe in [espnet](https://github.com/espnet/espnet/).
|
16 |
### Demo: How to use in ESPnet2
|
17 |
+
You first need to import the following packages
|
18 |
+
```bash
|
19 |
+
pip install torch
|
20 |
+
pip install espnet_model_zoo
|
21 |
+
```
|
22 |
+
Then start using it!
|
23 |
```python
|
24 |
+
import soundfile
|
25 |
+
from espnet2.bin.tts_inference import Text2Speech
|
26 |
+
text2speech = Text2Speech.from_pretrained("espnet/kan-bayashi_csmsc_tts_train_tacotron2_raw_phn_pypinyin_g2p_phone_train.loss.best")
|
27 |
+
|
28 |
+
text = "春江潮水连海平,海上明月共潮生"
|
29 |
+
speech = text2speech(text)["wav"]
|
30 |
+
soundfile.write("out.wav", speech.numpy(), text2speech.fs, "PCM_16")
|
31 |
```
|
32 |
### Citing ESPnet
|
33 |
```BibTex
|