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

Описание

Это модуль соединивший в себе две нейронные сети. Для упрощения создания голосового помошника.

Установка

pip install --upgrade voicehelper.py

!!! Р’РќРМЕНРР• !!! Установка torch должна происходить отдельно. Сайт PyTorch Installation

Название моделей для загрузки

Пример

  • Пример создания Голосового Ассистента
import VoiceHelper
from rich.console import Console

# Консоль
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()
  • Пример генерации голоса
from VoiceHelper.NueroNetworks import SpeechSynthesizer

ss = SpeechSynthesizer(sample_rate=48000, thread_count=1) # по умолчанию стоит русская речь

with open("test.wav", "wb") as file:
    file.write(ss.get_audio_bytes("Привет!", "WAV", "PCM_32"))

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.7-py39-none-any.whl (100.8 MB view details)

Uploaded Python 3.9

File details

Details for the file voicehelper.py-0.1.7-py39-none-any.whl.

File metadata

File hashes

Hashes for voicehelper.py-0.1.7-py39-none-any.whl
Algorithm Hash digest
SHA256 628e3403e738925922515c73b7dab4d017774d580633838e5ce77fbce0189a3b
MD5 b79eed1758bdbdb06c0a85fd88fa13a1
BLAKE2b-256 9be6952a744170916bcc896e51a3d49f4d6815bf0f42cf4ae161fc833cc8af82

See more details on using hashes here.

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