Skip to main content

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
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

voicehelper.py-0.1.5.1-py39-none-win_amd64.whl (100.8 MB view hashes)

Uploaded Python 3.9 Windows x86-64

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page