some reformat
This commit is contained in:
parent
7d309869ad
commit
079cd97d6f
155 changed files with 541 additions and 1028 deletions
15
tts.py
15
tts.py
|
|
@ -1,14 +1,15 @@
|
|||
import torch
|
||||
import sounddevice as sd
|
||||
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
|
||||
sample_rate = 48000 # 48000
|
||||
speaker = 'aidar' # aidar, baya, kseniya, xenia, random
|
||||
put_accent = True
|
||||
put_yo = True
|
||||
device = torch.device('cpu') # cpu или gpu
|
||||
device = torch.device('cpu') # cpu или gpu
|
||||
text = "Хауди Хо, друзья!!!"
|
||||
|
||||
model, _ = torch.hub.load(repo_or_dir='snakers4/silero-models',
|
||||
|
|
@ -20,7 +21,7 @@ model.to(device)
|
|||
|
||||
# воспроизводим
|
||||
def va_speak(what: str):
|
||||
audio = model.apply_tts(text=what+"..",
|
||||
audio = model.apply_tts(text=what + "..",
|
||||
speaker=speaker,
|
||||
sample_rate=sample_rate,
|
||||
put_accent=put_accent,
|
||||
|
|
@ -32,4 +33,4 @@ def va_speak(what: str):
|
|||
|
||||
# sd.play(audio, sample_rate)
|
||||
# time.sleep(len(audio) / sample_rate)
|
||||
# sd.stop()
|
||||
# sd.stop()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue