9 Commits

Author SHA1 Message Date
Dmitrium12 a2375e6daf modify project structure and add download_models.py 2024-05-01 13:35:00 +07:00
Dmitrium12 8504126d4a Merge pull request 'add_noisereduce' (#2) from add_noisereduce into master
Reviewed-on: #2
2024-05-01 10:38:58 +07:00
Dmitrium12 4dc4ffa58c micro fix 2024-04-30 08:46:16 +07:00
Dmitrium12 26b38811cc micro fix 2024-04-30 08:46:06 +07:00
Dmitrium12 1d63461e35 add testing noisereduce 2024-04-30 08:31:33 +07:00
Dmitrium12 5f1e2e67a4 add command and add its in ollama functions 2024-04-29 17:58:53 +07:00
Dmitrium12 c23b1d42bf add linter and test ollama in python 2024-04-29 15:31:01 +07:00
Dmitrium12 b2866d073c .gitignore 2024-01-09 22:10:57 +07:00
Dmitrium12 a889c68e40 starting 2024-01-09 22:10:13 +07:00
Executable
+31
View File
@@ -0,0 +1,31 @@
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()