Update README.md
Browse files
README.md
CHANGED
@@ -42,16 +42,16 @@ from speechbrain.pretrained import HIFIGAN
|
|
42 |
|
43 |
# Intialize TTS (tacotron2) and Vocoder (HiFIGAN)
|
44 |
tacotron2 = Tacotron2.from_hparams(source="aioxlabs/tacotron-swahili", savedir="tmpdir_tts")
|
45 |
-
hifi_gan = HIFIGAN.from_hparams(source="
|
46 |
|
47 |
# Running the TTS
|
48 |
-
mel_output, mel_length, alignment = tacotron2.encode_text("
|
49 |
|
50 |
# Running Vocoder (spectrogram-to-waveform)
|
51 |
waveforms = hifi_gan.decode_batch(mel_output)
|
52 |
|
53 |
# Save the waverform
|
54 |
-
torchaudio.save('example_TTS.wav',waveforms.squeeze(1),
|
55 |
```
|
56 |
|
57 |
If you want to generate multiple sentences in one-shot, you can do in this way:
|
|
|
42 |
|
43 |
# Intialize TTS (tacotron2) and Vocoder (HiFIGAN)
|
44 |
tacotron2 = Tacotron2.from_hparams(source="aioxlabs/tacotron-swahili", savedir="tmpdir_tts")
|
45 |
+
hifi_gan = HIFIGAN.from_hparams(source="aioxlabs/hifigan-swahili", savedir="tmpdir_vocoder")
|
46 |
|
47 |
# Running the TTS
|
48 |
+
mel_output, mel_length, alignment = tacotron2.encode_text("raisi wa jumhuri ya tanzania")
|
49 |
|
50 |
# Running Vocoder (spectrogram-to-waveform)
|
51 |
waveforms = hifi_gan.decode_batch(mel_output)
|
52 |
|
53 |
# Save the waverform
|
54 |
+
torchaudio.save('example_TTS.wav',waveforms.squeeze(1), 16000)
|
55 |
```
|
56 |
|
57 |
If you want to generate multiple sentences in one-shot, you can do in this way:
|