These are two neural networks connected by the same module. One for recognition, the other for voice generation.
Project description
voicehelper.py
Описание
voicehelper.py - это модуль соединивший в себе две нейронные сети. Одна нейросеть для генерации голоса, другая для распознования речи. По умолчанию стоят модели для Русской речи
.
Установка
- Windows:
pip install https://github.com/romanin-rf/voicehelper.py/releases/download/v0.1.5/voicehelper.py-0.1.5-py39-none-win_amd64.whl
Название моделей для загрузки
- Для SpeechSynthesizer
- Для SpeechRecognition
Примеры
SpeechSynthesizer
import VoiceHelper
ss = VoiceHelper.SpeechSynthesizer(sample_rate=48000)
with open("temp.wav", "rb") as f:
f.write(ss.get_audio_bytes("Привет!", "WAV", "PCM_32"))
__main__.py
import VoiceHelper
from rich.console import Console
# Initialising the console (just to create a CUI)
c = Console()
# Класс нейросети
c.clear()
c.rule("Запуск")
# Процесс иницализации
try:
ssynth = VoiceHelper.SpeechSynthesizer(
device_type="cuda"
)
except:
ssynth = VoiceHelper.SpeechSynthesizer(
device_type="cpu"
)
vh = VoiceHelper.VoiceHelper(
ssynth,
VoiceHelper.SpeechRecognition()
)
# Команды
@vh.add_command("привет")
def Hello(event: VoiceHelper.Event):
vh.say("Ага, я здесь!")
@vh.add_command(["скажи <text>"])
def cSay(event: VoiceHelper.Event, text: str):
vh.say(text)
@vh.add_command("пока")
def cGoodBye(event: VoiceHelper.Event):
vh.say("До свидания!")
vh.stop()
@vh.add_command("<text>")
def cLogger(event: VoiceHelper.Event, text: str) -> None:
c.print(f"[red]You[/] [green]->[/] [yellow]{text}[/]")
# Запуск
if __name__ == "__main__":
c.rule("Логи")
vh.start()
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
Built Distribution
Close
Hashes for voicehelper.py-0.1.5.2-py39-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | de05962fffd91c983aac26f4becc164a62500f02ba8bd08371642e6c553f5ccc |
|
MD5 | 8126eb6e872912d9f51402d3adb8d331 |
|
BLAKE2b-256 | e7648470299ca25980e430534ee4b54c905f61aa533603947803e7012a30383d |