Skip to content

A neural network voice model that executes commands on demand, like a voice assistant, but very crude

License

Notifications You must be signed in to change notification settings

xsvebmx/VoiceBot-Linux

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Typing SVG

About

A neural network voice model that executes commands on demand, like a voice assistant, but very crude

Authors:

Screenshots

App Screenshot

Run Locally

Clone the project

  git clone https://github.com/xsvebmx/VoiceBot.git

Go to the project directory

  cd VoiceBot

Install requirements

  pip3 install -r requirements.txt

Start main.py

  python3 main.py

Usage/Examples

import json, pyaudio
from vosk import Model, KaldiRecognizer

model = Model('vosk-model-small-ru-0.4')
rec = KaldiRecognizer(model, 16000)
p = pyaudio.PyAudio()
stream = p.open(format=pyaudio.paInt16, channels=1, rate=16000, input=True, frames_per_buffer=8000)
stream.start_stream()

def listen():
	while True:
		data = stream.read(4000, exception_on_overflow=False)
		if (rec.AcceptWaveform(data)) and (len(data) > 0):
			answer = json.loads(rec.Result())
			if answer["text"]:
				yield answer["text"]

for text in listen():
	if text == "кеша":
		print("Hello")
	elif text == "пока":
		quit()
	else:
		print(text)

Tech Stack

Client: Mem usage 6-8gb

About

A neural network voice model that executes commands on demand, like a voice assistant, but very crude

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages