You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
while True:
data = stream.read(4000)
if len(data) == 0:
break
if rec.AcceptWaveform(data):
result = json.loads(rec.Result())
query = result['text']
a = query.lower()
print(a)
if a == "quit" or a == "exit" or a == "close" or a == "goodbye":
speak("THnak You Sir. Have a nice day !")
print("Bye Sir. Have a nice day !")
sys.exit()
else:
response = k.respond(a)
speak(response)
print(response)`
Im running Macos Catalina 10.15.7 and Python version 3.8.0. Do you have any ideas on how I could fix this if you need more info DM me on my Linkedin:
I downloaded the code from the official git repo:
https://github.com/JoelShine/JARVIS-AI-ASSISTANT
Here is the error in more detail:
`/Volumes/DataDrive/JARVIS-AI-ASSISTANT/jarvis.py
2023-11-17 19:53:16.025 Python[3036:84370] *** Assertion failure in +[UINSServiceViewController initialize], /AppleInternal/BuildRoot/Library/Caches/com.apple.xbs/Sources/ViewBridge/ViewBridge-468/UINSServiceViewController.m:203
Parsing aiml files
Saving brain file: brain.dump
Saving brain to brain.dump...Traceback (most recent call last):
File "/Volumes/DataDrive/jarvis_reborn/JARVIS-AI-ASSISTANT/jarvis.py", line 39, in
k.saveBrain(BRAIN_FILE)
File "/Volumes/DataDrive/jarvis_reborn/venv/lib/python3.8/site-packages/aiml/Kernel.py", line 201, in saveBrain
start = time.clock()
AttributeError: module 'time' has no attribute 'clock'
Process finished with exit code:`
Here Was The code i ran
`from vosk import Model, KaldiRecognizer
from playsound import playsound
from vosk import SetLogLevel
import os
import pyaudio
import json
import os
import aiml
import pyttsx4
import sys
SetLogLevel(-1)
engine = pyttsx4.init()
voices = engine.getProperty('voices')
engine.setProperty('voice', voices[0].id)
def speak(audio):
engine.say(audio)
engine.runAndWait()
BRAIN_FILE = "brain.dump"
k = aiml.Kernel()
if os.path.exists(BRAIN_FILE):
print("Loading from brain file: " + BRAIN_FILE)
k.loadBrain(BRAIN_FILE)
else:
print("Parsing aiml files")
k.bootstrap(learnFiles="std-startup.aiml", commands="load aiml b")
print("Saving brain file: " + BRAIN_FILE)
k.saveBrain(BRAIN_FILE)
model = Model("vosk_speech_engine/model") #loading model
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()
print("Listening")
WAKE = "jarvis"
while True:
data = stream.read(4000)
if len(data) == 0:
break
if rec.AcceptWaveform(data):
result = json.loads(rec.Result())
Im running Macos Catalina 10.15.7 and Python version 3.8.0. Do you have any ideas on how I could fix this if you need more info DM me on my Linkedin:
https://www.linkedin.com/in/omar-f-ahmad/
The text was updated successfully, but these errors were encountered: