svpino / alloy-voice-assistant

188 stars 95 forks source link

Audio does not work. #7

Open jaydeepc opened 1 week ago

jaydeepc commented 1 week ago

Hi ,

First of great project and thanks for making this public. I was trying to run it locally. Upon successful installation of the python packages, the CAM opened up. But then there is an error:

Exception in thread Thread-2 (threaded_listen): Traceback (most recent call last): File "/Users/jaydeep.chakrabarty/anaconda3/envs/v_conda_cam/lib/python3.12/urllib/request.py", line 1344, in do_open h.request(req.get_method(), req.selector, req.data, headers, File "/Users/jaydeep.chakrabarty/anaconda3/envs/v_conda_cam/lib/python3.12/http/client.py", line 1319, in request self._send_request(method, url, body, headers, encode_chunked) File "/Users/jaydeep.chakrabarty/anaconda3/envs/v_conda_cam/lib/python3.12/http/client.py", line 1365, in _send_request self.endheaders(body, encode_chunked=encode_chunked) File "/Users/jaydeep.chakrabarty/anaconda3/envs/v_conda_cam/lib/python3.12/http/client.py", line 1314, in endheaders self._send_output(message_body, encode_chunked=encode_chunked) File "/Users/jaydeep.chakrabarty/anaconda3/envs/v_conda_cam/lib/python3.12/http/client.py", line 1074, in _send_output self.send(msg) File "/Users/jaydeep.chakrabarty/anaconda3/envs/v_conda_cam/lib/python3.12/http/client.py", line 1018, in send self.connect() File "/Users/jaydeep.chakrabarty/anaconda3/envs/v_conda_cam/lib/python3.12/http/client.py", line 1460, in connect self.sock = self._context.wrap_socket(self.sock, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/jaydeep.chakrabarty/anaconda3/envs/v_conda_cam/lib/python3.12/ssl.py", line 455, in wrap_socket return self.sslsocket_class._create( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/jaydeep.chakrabarty/anaconda3/envs/v_conda_cam/lib/python3.12/ssl.py", line 1046, in _create self.do_handshake() File "/Users/jaydeep.chakrabarty/anaconda3/envs/v_conda_cam/lib/python3.12/ssl.py", line 1317, in do_handshake self._sslobj.do_handshake() ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1000)

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/Users/jaydeep.chakrabarty/anaconda3/envs/v_conda_cam/lib/python3.12/threading.py", line 1052, in _bootstrap_inner self.run() File "/Users/jaydeep.chakrabarty/anaconda3/envs/v_conda_cam/lib/python3.12/threading.py", line 989, in run self._target(self._args, self._kwargs) File "/Users/jaydeep.chakrabarty/anaconda3/envs/v_conda_cam/lib/python3.12/site-packages/speech_recognition/init.py", line 568, in threaded_listen if running[0]: callback(self, audio) ^^^^^^^^^^^^^^^^^^^^^ File "/Users/jaydeep.chakrabarty/Documents/work/ai_projects/video_assistant/assistant.py", line 150, in audio_callback prompt = recognizer.recognize_whisper(audio, model="base", language="english") ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/jaydeep.chakrabarty/anaconda3/envs/v_conda_cam/lib/python3.12/site-packages/speech_recognition/init.py", line 1412, in recognize_whisper self.whisper_model[model] = whisper.load_model(model, load_options or {}) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/jaydeep.chakrabarty/anaconda3/envs/v_conda_cam/lib/python3.12/site-packages/whisper/init.py", line 133, in load_model checkpoint_file = _download(_MODELS[name], download_root, in_memory) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/jaydeep.chakrabarty/anaconda3/envs/v_conda_cam/lib/python3.12/site-packages/whisper/init.py", line 69, in _download with urllib.request.urlopen(url) as source, open(download_target, "wb") as output: ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/jaydeep.chakrabarty/anaconda3/envs/v_conda_cam/lib/python3.12/urllib/request.py", line 215, in urlopen return opener.open(url, data, timeout) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/jaydeep.chakrabarty/anaconda3/envs/v_conda_cam/lib/python3.12/urllib/request.py", line 515, in open response = self._open(req, data) ^^^^^^^^^^^^^^^^^^^^^ File "/Users/jaydeep.chakrabarty/anaconda3/envs/v_conda_cam/lib/python3.12/urllib/request.py", line 532, in _open result = self._call_chain(self.handle_open, protocol, protocol + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/jaydeep.chakrabarty/anaconda3/envs/v_conda_cam/lib/python3.12/urllib/request.py", line 492, in _call_chain result = func(args) ^^^^^^^^^^^ File "/Users/jaydeep.chakrabarty/anaconda3/envs/v_conda_cam/lib/python3.12/urllib/request.py", line 1392, in https_open return self.do_open(http.client.HTTPSConnection, req, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/jaydeep.chakrabarty/anaconda3/envs/v_conda_cam/lib/python3.12/urllib/request.py", line 1347, in do_open raise URLError(err) urllib.error.URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1000)>

Any idea?

svpino commented 1 week ago

Google how to fix this problem: "[SSL: CERTIFICATE_VERIFY_FAILED]". It's common on a Mac.

jaydeepc commented 1 week ago

Hi @svpino , thanks for the quick reply. I actually reached out after all the research done on this. The most worked solution

import ssl
ssl._create_default_https_context = ssl._create_unverified_context

Does not seem to work. So wanted to check if I was missing something. Anyway, I will keep checking

alioop222 commented 6 days ago

@jaydeepc Hi, did you get it working? Asking for a friend!