Views
No views yet
| Model card | Example |
|---|---|
| English (American) | Link |
| English (British) | Link |
| English (Indian) | Link |
| English (Australian) | Link |
| English (Default) | Link |
| Spanish | Link |
| French | Link |
| Chinese (mix EN) | Link |
| Japanese | Link |
| Korean | Link |
mixed Chinese and English.CPU real-time inference.1from melo.api import TTS
2
3# Speed is adjustable
4speed = 1.0
5
6# CPU is sufficient for real-time inference.
7# You can set it manually to 'cpu' or 'cuda' or 'cuda:0' or 'mps'
8device = 'auto' # Will automatically use GPU if available
9
10# English
11text = "Did you ever hear a folk tale about a giant turtle?"
12model = TTS(language='EN', device=device)
13speaker_ids = model.hps.data.spk2id
14
15# American accent
16output_path = 'en-us.wav'
17model.tts_to_file(text, speaker_ids['EN-US'], output_path, speed=speed)
18
19# British accent
20output_path = 'en-br.wav'
21model.tts_to_file(text, speaker_ids['EN-BR'], output_path, speed=speed)
22
23# Indian accent
24output_path = 'en-india.wav'
25model.tts_to_file(text, speaker_ids['EN_INDIA'], output_path, speed=speed)
26
27# Australian accent
28output_path = 'en-au.wav'
29model.tts_to_file(text, speaker_ids['EN-AU'], output_path, speed=speed)
30
31# Default accent
32output_path = 'en-default.wav'
33model.tts_to_file(text, speaker_ids['EN-Default'], output_path, speed=speed)
34