Compare commits
9 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 91cd9b02df | |||
| ba52d86754 | |||
| 4a0155413e | |||
| 6a6efe8dd6 | |||
| 08b6f95a67 | |||
| d2b60b53c4 | |||
| a7abfe44b4 | |||
| 3fb31e60ea | |||
| c03811cb87 |
@@ -1,31 +0,0 @@
|
||||
import time
|
||||
|
||||
import sounddevice as sd
|
||||
import torch
|
||||
|
||||
language = 'ru'
|
||||
model_id = 'ru_v3'
|
||||
sample_rate = 48000 # 48000
|
||||
speaker = 'aidar' # aidar, baya, kseniya, xenia, random
|
||||
put_accent = True
|
||||
put_yo = True
|
||||
device = torch.device('cpu') # cpu или gpu
|
||||
text = "Хауди Хо, друзья!!!"
|
||||
|
||||
model, _ = torch.hub.load(repo_or_dir='snakers4/silero-models',
|
||||
model='silero_tts',
|
||||
language=language,
|
||||
speaker=model_id)
|
||||
model.to(device)
|
||||
|
||||
|
||||
def va_speak(what: str):
|
||||
audio = model.apply_tts(text=what + "..",
|
||||
speaker=speaker,
|
||||
sample_rate=sample_rate,
|
||||
put_accent=put_accent,
|
||||
put_yo=put_yo)
|
||||
|
||||
sd.play(audio, sample_rate * 1.05)
|
||||
time.sleep((len(audio) / sample_rate) + 0.5)
|
||||
sd.stop()
|
||||
Reference in New Issue
Block a user