Giter VIP home page Giter VIP logo

davinci's Introduction

Raspberry Pi’s newest OS (Bookworm) released on December 5, 2023, does not work well with this installation. For best results, use a Raspberry Pi 4 (not a Raspberry Pi 5) and use the legacy 64-bit OS. Instructions are in the Important - Please Read file on this repository.

DaVinci now uses GPT-4.

On March 26, 2024, OpenAI updated its billing system to require the pre-purchase of credits in order to use the API for most users. If you do not pre-purchase credits, you will get an API error.

Feb. 23, 2024 Update - I added an alternative voice to DaVinci that uses OpenAI’s text-to-speech model instead of Amazon Polly. The alternative file is called DaVinciAltVoice.py. If you decide to you use this version, you do not need to create an AWS account. In the rest of the instructions, you can skip “pip3 install boto” and “pip3 install awscli” and all of step 3 for configuring the AWS interface. Substitute “DaVinciAltVoice.py” for “DaVinci.py” everywhere it appears in the instructions.

I also added an Italian speaking version - DaVinciItalian.py. To use it, you must follow the additional instructions in the introductory comments in that program.

DaVinci Small

1

2

3

4

5

6

7

8A

8B

In10

In11

In12

davinci's People

Contributors

devmiser avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

davinci's Issues

Connection to Amazon AWS Broken

Havent changed anything and doublechecked Keys, created new user, updated all plugins with pip, tried really anything to get rid of that. It worked for 4 days without modifying anything.

jarvis detected

Traceback (most recent call last):
File "/home/pi/.local/lib/python3.9/site-packages/botocore/httpsession.py", line 451, in send
conn = manager.connection_from_url(request.url)
File "/usr/lib/python3/dist-packages/urllib3/poolmanager.py", line 297, in connection_from_url
u = parse_url(url)
File "/usr/lib/python3/dist-packages/urllib3/util/url.py", line 394, in parse_url
return six.raise_from(LocationParseError(source_url), None)
File "", line 2, in raise_from
urllib3.exceptions.LocationParseError: Failed to parse: https://polly.eu-central-1.amazonaws.com/v1/speech

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/home/pi/jarvis/DaVinci/DaVinci/DaVinci_Allg.py", line 323, in
voice(random.choice(prompt))
File "/home/pi/jarvis/DaVinci/DaVinci/DaVinci_Allg.py", line 114, in voice
voiceResponse = polly.synthesize_speech(Text=chat, Engine="neural", OutputFormat="mp3",
File "/home/pi/.local/lib/python3.9/site-packages/botocore/client.py", line 553, in _api_call
return self._make_api_call(operation_name, kwargs)
File "/home/pi/.local/lib/python3.9/site-packages/botocore/client.py", line 989, in _make_api_call
http, parsed_response = self._make_request(
File "/home/pi/.local/lib/python3.9/site-packages/botocore/client.py", line 1015, in _make_request
return self._endpoint.make_request(operation_model, request_dict)
File "/home/pi/.local/lib/python3.9/site-packages/botocore/endpoint.py", line 119, in make_request
return self._send_request(request_dict, operation_model)
File "/home/pi/.local/lib/python3.9/site-packages/botocore/endpoint.py", line 202, in _send_request
while self._needs_retry(
File "/home/pi/.local/lib/python3.9/site-packages/botocore/endpoint.py", line 354, in _needs_retry
responses = self._event_emitter.emit(
File "/home/pi/.local/lib/python3.9/site-packages/botocore/hooks.py", line 412, in emit
return self._emitter.emit(aliased_event_name, **kwargs)
File "/home/pi/.local/lib/python3.9/site-packages/botocore/hooks.py", line 256, in emit
return self._emit(event_name, kwargs)
File "/home/pi/.local/lib/python3.9/site-packages/botocore/hooks.py", line 239, in _emit
response = handler(**kwargs)
File "/home/pi/.local/lib/python3.9/site-packages/botocore/retryhandler.py", line 207, in call
if self._checker(**checker_kwargs):
File "/home/pi/.local/lib/python3.9/site-packages/botocore/retryhandler.py", line 284, in call
should_retry = self._should_retry(
File "/home/pi/.local/lib/python3.9/site-packages/botocore/retryhandler.py", line 307, in _should_retry
return self._checker(
File "/home/pi/.local/lib/python3.9/site-packages/botocore/retryhandler.py", line 363, in call
checker_response = checker(
File "/home/pi/.local/lib/python3.9/site-packages/botocore/retryhandler.py", line 247, in call
return self._check_caught_exception(
File "/home/pi/.local/lib/python3.9/site-packages/botocore/retryhandler.py", line 416, in _check_caught_exception
raise caught_exception
File "/home/pi/.local/lib/python3.9/site-packages/botocore/endpoint.py", line 281, in _do_get_response
http_response = self._send(request)
File "/home/pi/.local/lib/python3.9/site-packages/botocore/endpoint.py", line 377, in _send
return self.http_session.send(request)
File "/home/pi/.local/lib/python3.9/site-packages/botocore/httpsession.py", line 509, in send
raise HTTPClientError(error=e)
botocore.exceptions.HTTPClientError: An HTTP Client raised an unhandled exception: Failed to parse: https://polly.eu-central-1.amazonaws.com/v1/speech

Alot of traceback errors

I am doing this for a school project as part of my final. soon as I try and use it
Wake word detected

Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/urllib3/connection.py", line 169, in _new_conn
conn = connection.create_connection(
File "/usr/lib/python3/dist-packages/urllib3/util/connection.py", line 73, in create_connection
for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM):
File "/usr/lib/python3.9/socket.py", line 953, in getaddrinfo
for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
socket.gaierror: [Errno -2] Name or service not known

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/home/medwards/.local/lib/python3.9/site-packages/botocore/httpsession.py", line 465, in send
urllib_response = conn.urlopen(
File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 755, in urlopen
retries = retries.increment(
File "/usr/lib/python3/dist-packages/urllib3/util/retry.py", line 507, in increment
raise six.reraise(type(error), error, _stacktrace)
File "/usr/lib/python3/dist-packages/six.py", line 719, in reraise
raise value
File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 699, in urlopen
httplib_response = self._make_request(
File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 382, in _make_request
self._validate_conn(conn)
File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 1012, in _validate_conn
conn.connect()
File "/usr/lib/python3/dist-packages/urllib3/connection.py", line 353, in connect
conn = self._new_conn()
File "/usr/lib/python3/dist-packages/urllib3/connection.py", line 181, in _new_conn
raise NewConnectionError(
urllib3.exceptions.NewConnectionError: <botocore.awsrequest.AWSHTTPSConnection object at 0xdfbcbe68>: Failed to establish a new connection: [Errno -2] Name or service not known

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/home/medwards/DaVinci/DaVinci.py", line 294, in
voice(random.choice(prompt))
File "/home/medwards/DaVinci/DaVinci.py", line 99, in voice
voiceResponse = polly.synthesize_speech(Text=chat, OutputFormat="mp3",
File "/home/medwards/.local/lib/python3.9/site-packages/botocore/client.py", line 534, in _api_call
return self._make_api_call(operation_name, kwargs)
File "/home/medwards/.local/lib/python3.9/site-packages/botocore/client.py", line 959, in _make_api_call
http, parsed_response = self._make_request(
File "/home/medwards/.local/lib/python3.9/site-packages/botocore/client.py", line 982, in _make_request
return self._endpoint.make_request(operation_model, request_dict)
File "/home/medwards/.local/lib/python3.9/site-packages/botocore/endpoint.py", line 119, in make_request
return self._send_request(request_dict, operation_model)
File "/home/medwards/.local/lib/python3.9/site-packages/botocore/endpoint.py", line 202, in _send_request
while self._needs_retry(
File "/home/medwards/.local/lib/python3.9/site-packages/botocore/endpoint.py", line 354, in _needs_retry
responses = self._event_emitter.emit(
File "/home/medwards/.local/lib/python3.9/site-packages/botocore/hooks.py", line 412, in emit
return self._emitter.emit(aliased_event_name, **kwargs)
File "/home/medwards/.local/lib/python3.9/site-packages/botocore/hooks.py", line 256, in emit
return self._emit(event_name, kwargs)
File "/home/medwards/.local/lib/python3.9/site-packages/botocore/hooks.py", line 239, in _emit
response = handler(**kwargs)
File "/home/medwards/.local/lib/python3.9/site-packages/botocore/retryhandler.py", line 207, in call
if self._checker(**checker_kwargs):
File "/home/medwards/.local/lib/python3.9/site-packages/botocore/retryhandler.py", line 284, in call
should_retry = self._should_retry(
File "/home/medwards/.local/lib/python3.9/site-packages/botocore/retryhandler.py", line 320, in _should_retry
return self._checker(attempt_number, response, caught_exception)
File "/home/medwards/.local/lib/python3.9/site-packages/botocore/retryhandler.py", line 363, in call
checker_response = checker(
File "/home/medwards/.local/lib/python3.9/site-packages/botocore/retryhandler.py", line 247, in call
return self._check_caught_exception(
File "/home/medwards/.local/lib/python3.9/site-packages/botocore/retryhandler.py", line 416, in _check_caught_exception
raise caught_exception
File "/home/medwards/.local/lib/python3.9/site-packages/botocore/endpoint.py", line 281, in _do_get_response
http_response = self._send(request)
File "/home/medwards/.local/lib/python3.9/site-packages/botocore/endpoint.py", line 377, in _send
return self.http_session.send(request)
File "/home/medwards/.local/lib/python3.9/site-packages/botocore/httpsession.py", line 494, in send
raise EndpointConnectionError(endpoint_url=request.url, error=e)
botocore.exceptions.EndpointConnectionError: Could not connect to the endpoint URL: "https://polly.editing.amazonaws.com/v1/speech"
^CException ignored in: <module 'threading' from '/usr/lib/python3.9/threading.py'>
Traceback (most recent call last):
File "/usr/lib/python3.9/threading.py", line 1428, in _shutdown
lock.acquire()
KeyboardInterrupt:

Issue with outdated keyword file

Terminal output when attempting to run the program after fresh install

pi@raspberrypi:~/DaVinci $ python3 DaVinci.py
[ERROR] keyword file belongs to a different version of the library. keyword file is 2.1.0 while the library is 2.2.0.
[ERROR] loading keyword file at /home/pi/.local/lib/python3.9/site-packages/pvporcupine/resources/keyword_files/ raspberry-pi/DaVinci_raspberry-pi.ppn failed with INVALID_ARGUMENT
Traceback (most recent call last):
File "/home/pi/DaVinci/DaVinci.py", line 288, in
wake_word()
File "/home/pi/DaVinci/DaVinci.py", line 142, in wake_word
porcupine = pvporcupine.create(keywords=["computer", "jarvis", "DaVinci",],
File "/home/pi/.local/lib/python3.9/site-packages/pvporcupine/_factory.py", line 69, in create
return Porcupine(
File "/home/pi/.local/lib/python3.9/site-packages/pvporcupine/_porcupine.py", line 164, in init
raise self._PICOVOICE_STATUS_TO_EXCEPTIONstatus
pvporcupine._porcupine.PorcupineInvalidArgumentError
^CException ignored in: <module 'threading' from '/usr/lib/python3.9/threading.py'>
Traceback (most recent call last):
File "/usr/lib/python3.9/threading.py", line 1428, in _shutdown
lock.acquire()
KeyboardInterrupt:

Question about start-up

I was wondering if there was a good method to run the command /home/pi/DaVinci/DaVinci.py on startup. i tried using the command:

sudo chrontab -e

this was so I could go to the bottom of the file to add "@reboot python3 /home/pi/DaVinci/DaVinci.py &" so that it can run on startup. However upon rebooting the file nothing happens and I have to start the python script manually. Is there a good method to start the script automatically upon booting the pi?

DaVinciAltVoice.py is empty

Dear DevMiser,

Would you, please, help me with the steps how to put DaVinciAltVoice.py into the installation process for Raspberry P1 4B.

Thank you very much

Boris Ratner

ALSA lib error

On one of my DaVincis I am getting a lot of ALSA lib errors:

ALSA lib pcm.c:8545:(snd_pcm_recover) underrun occured

The assistant seems to work more or less, but these errors do cause the voice to be full of static for half a second or so...

Any idea where this might come from?

Issue with pip3 install, help please?

when I try running pip3 install, I get the following error message:

error: externally-managed-environment

× This environment is externally managed
╰─> To install Python packages system-wide, try apt install
python3-xyz, where xyz is the package you are trying to
install.

If you wish to install a non-Debian-packaged Python package,
create a virtual environment using python3 -m venv path/to/venv.
Then use path/to/venv/bin/python and path/to/venv/bin/pip. Make
sure you have python3-full installed.

If you wish to install a non-Debian packaged Python application,
it may be easiest to use pipx install xyz, which will manage a
virtual environment for you. Make sure you have pipx installed.

See /usr/share/doc/python3.11/README.venv for more information.

note: If you believe this is a mistake, please contact your Python installation or OS distribution provider.

A few errors...

So the script recognises the wake word and then listens... When I ask a question I get the following errors...

You have hit your assigned rate limit.
Traceback (most recent call last):
File "/home/ozroyalog/DaVinci/DaVinci.py", line 306, in
(res) = ChatGPT(transcript)
File "/home/ozroyalog/DaVinci/DaVinci.py", line 71, in ChatGPT
response = openai.ChatCompletion.create(
File "/home/ozroyalog/.local/lib/python3.9/site-packages/openai/api_resources/chat_completion.py", line 25, in create
return super().create(*args, **kwargs)
File "/home/ozroyalog/.local/lib/python3.9/site-packages/openai/api_resources/abstract/engine_api_resource.py", line 153, in create
response, _, api_key = requestor.request(
File "/home/ozroyalog/.local/lib/python3.9/site-packages/openai/api_requestor.py", line 298, in request
resp, got_stream = self._interpret_response(result, stream)
File "/home/ozroyalog/.local/lib/python3.9/site-packages/openai/api_requestor.py", line 700, in _interpret_response
self._interpret_response_line(
File "/home/ozroyalog/.local/lib/python3.9/site-packages/openai/api_requestor.py", line 763, in _interpret_response_line
raise self.handle_error_response(
openai.error.RateLimitError: Your account is not active, please check your billing details on our website.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/home/ozroyalog/DaVinci/DaVinci.py", line 345, in
voice("\nYou have hit your assigned rate limit.")
File "/home/ozroyalog/DaVinci/DaVinci.py", line 100, in voice
voiceResponse = polly.synthesize_speech(Text=chat, OutputFormat="mp3",
File "/home/ozroyalog/.local/lib/python3.9/site-packages/botocore/client.py", line 535, in _api_call
return self._make_api_call(operation_name, kwargs)
File "/home/ozroyalog/.local/lib/python3.9/site-packages/botocore/client.py", line 980, in _make_api_call
raise error_class(parsed_response, operation_name)
botocore.exceptions.ClientError: An error occurred (InvalidSignatureException) when calling the SynthesizeSpeech operation: The request signature we calculated does not match the signature you provided. Check your AWS Secret Access Key and signing method. Consult the service documentation for details.

All the Access Keys, APi keys etc are correct... Any ideas?

Quick question regarding OpenAI

Hi there

I set up DaVinci and it seems to be fully working. However, when I ask a question it says that openai has exceeded my current quota. So I applied for a pay as you go method. How long does it take for the api to work on the raspberry pi 4 again? Am I doing something wrong?

API Error

Trying to set this up. When entering cd /home/pi/DaVinci, I get the error "no such file or directory" Any help would be appreciated

Issue with wake word / keyword file

Terminal output is as follows(on fresh install):

sudo python3 DaVinci.py
Traceback (most recent call last):
File "/home/rickkpr/DaVinci/DaVinci.py", line 295, in
wake_word()
File "/home/rickkpr/DaVinci/DaVinci.py", line 146, in wake_word
porcupine = pvporcupine.create(keywords=["computer", "jarvis", "DaVinci",],
File "/usr/local/lib/python3.10/dist-packages/pvporcupine/init.py", line 67, in create
raise ValueError(
ValueError: One or more keywords are not available by default. Available default keywords are:\npicovoice, computer, grasshopper, hey barista, terminator, ok google, hey siri, bumblebee, grapefruit, jarvis, hey google, pico clock, porcupine, alexa, americano, blueberry
^CException ignored in: <module 'threading' from '/usr/lib/python3.10/threading.py'>
Traceback (most recent call last):
File "/usr/lib/python3.10/threading.py", line 1567, in _shutdown
lock.acquire()
KeyboardInterrupt:

I also tried using the below resolution, but it did not worked for me:

thatbitchsystem commented on Apr 16
Resolved issue with the following commands:
$ mv /home/pi/.local/lib/python3.9/site-packages/pvporcupine/resources/keyword_files/raspberry-pi/DaVinci_raspberry-pi.ppn /home/pi/DaVinci/
$ pip3 uninstall pvporcupine
$ pip3 install pvporcupine==2.1.0
$ mv /home/pi/DaVinci/DaVinci_raspberry-pi.ppn /home/pi/.local/lib/python3.9/site-packages/pvporcupine/resources/keyword_files/raspberry-pi
$ python3 DaVinci.py

Please note, in the above step/resolution, the file is named 'DaVinci_raspberry-pi.ppn' [single underscore in file name] however, in the latest build available, the file is named 'DaVinci__raspberry-pi.ppn' with two consecutive underscore in the name of file. I tried the above resolution and/or also tried to rename the file to 'DaVinci_raspberry-pi.ppn', but still it does not work. Please point me to the right direction/should I downgrade my python version to 3.9

FYI - my python version is 3.10, so I made the changes to the path accordingly. Thanks.

ALSA lib pcm_dsnoop.c:638:(snd_pcm_dsnoop_open) unable to open slave

Hi,
First, let me thank you for your great work.
I'm trying to use the script on Rpi 3 with a USB mic. and I'm getting the following error after the wake up response:

ALSA lib pcm_dsnoop.c:638:(snd_pcm_dsnoop_open) unable to open slave
ALSA lib pcm_dsnoop.c:638:(snd_pcm_dsnoop_open) unable to open slave
ALSA lib pcm_dsnoop.c:638:(snd_pcm_dsnoop_open) unable to open slave
ALSA lib pcm_dsnoop.c:638:(snd_pcm_dsnoop_open) unable to open slave
ALSA lib pcm_dsnoop.c:638:(snd_pcm_dsnoop_open) unable to open slave
Expression 'ret' failed in 'src/hostapi/alsa/pa_linux_alsa.c', line: 1736
Expression 'AlsaOpen( &alsaApi->baseHostApiRep, params, streamDir, &self->pcm )' failed in 'src/hostapi/alsa/pa_linux_alsa.c', line: 1904
Expression 'PaAlsaStreamComponent_Initialize( &self->capture, alsaApi, inParams, StreamDirection_In, NULL != callback )' failed in 'src/hostapi/alsa/pa_linux_alsa.c', line: 2171
Expression 'PaAlsaStream_Initialize( stream, alsaHostApi, inputParameters, outputParameters, sampleRate, framesPerBuffer, callback, streamFlags, userData )' failed in 'src/hostapi/alsa/pa_linux_alsa.c', line: 2839
Traceback (most recent call last):
  File "/opt/webplant/app.py", line 311, in <module>
    listen()
  File "/opt/webplant/app.py", line 205, in listen
    listen_audio_stream = listen_pa.open(
  File "/usr/lib/python3/dist-packages/pyaudio.py", line 750, in open
    stream = Stream(self, *args, **kwargs)
  File "/usr/lib/python3/dist-packages/pyaudio.py", line 441, in __init__
    self._stream = pa.open(**arguments)
OSError: [Errno -9985] Device unavailable```

Any thoughts?

Thanks


A question rather than an issue regarding real time access

As the title suggests, I'm wondering if this voice assistant will ever have real time internet access. I've done a bit of googling but it appears to be a much more complicated topic than I'm equipped to delve in to so I hope you don't mind me asking here.

Picovoice account gets deleted

Picovoice keeps deleting my accounts. This already happened twice, every time about a day after I opened the account.
Anybody having the same issue?

"An account registered with 'xxxxx' has been removed by the Picovoice Audit System. Accounts can be removed in cases of Picovoice Terms of Use violations, such as suspicious activities, creating multiple accounts, or providing false information."

The stereo usb speakers exhibit a lag

USB speakers chop off the first bit of some playback. For instance "How may I assist you" sounds like "may I assist you".
One suggested solution is to keep the volume low as a workaround. But in the past I have had more success with other audio player libraries in other "speech projects". For instance, vlc libraries or calling the os to run "ffplay".
I believe that this is due to the latest Raspian coming with Pipewire and PulseAudio rather than the old ALSA.

trackback error? how would you fix?

admin@raspberrypi:~/DaVinci $ python3 DaVinci.py
Traceback (most recent call last):
File "/home/admin/DaVinci/DaVinci.py", line 302, in
wake_word()
File "/home/admin/DaVinci/DaVinci.py", line 153, in wake_word
porcupine = pvporcupine.create(keywords=keywords,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/admin/.local/lib/python3.11/site-packages/pvporcupine/_factory.py", line 59, in create
raise ValueError(
ValueError: One or more keywords are not available by default. Available default keywords are:\nalexa, terminator, pico clock, hey siri, porcupine, hey google, grapefruit, hey barista, ok google, computer, picovoice, jarvis, bumblebee, grasshopper, blueberry, americano

Tried it on my new Raspberry Pi 5, processor not supported

Finished the install on a new Pi 5, and am getting the following traceback:

Traceback (most recent call last):
File "/home/ty/DaVinci/DaVinci.py", line 8, in
import pvcobra
File "/home/ty/.local/lib/python3.11/site-packages/pvcobra/init.py", line 12, in
from ._factory import *
File "/home/ty/.local/lib/python3.11/site-packages/pvcobra/_factory.py", line 15, in
from ._util import *
File "/home/ty/.local/lib/python3.11/site-packages/pvcobra/_util.py", line 64, in
_PV_SYSTEM, _PV_MACHINE = _pv_platform()
^^^^^^^^^^^^^^
File "/home/ty/.local/lib/python3.11/site-packages/pvcobra/_util.py", line 57, in _pv_platform
pv_machine = _pv_linux_machine(platform.machine())
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/ty/.local/lib/python3.11/site-packages/pvcobra/_util.py", line 48, in _pv_linux_machine
raise NotImplementedError('Unsupported CPU.\n%s' % cpu_info)
NotImplementedError: Unsupported CPU.
processor : 0
BogoMIPS : 108.00
Features : fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp cpuid asimdrdm lrcpc dcpop asimddp
CPU implementer : 0x41
CPU architecture: 8
CPU variant : 0x4
CPU part : 0xd0b
CPU revision : 1

processor : 1
BogoMIPS : 108.00
Features : fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp cpuid asimdrdm lrcpc dcpop asimddp
CPU implementer : 0x41
CPU architecture: 8
CPU variant : 0x4
CPU part : 0xd0b
CPU revision : 1

processor : 2
BogoMIPS : 108.00
Features : fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp cpuid asimdrdm lrcpc dcpop asimddp
CPU implementer : 0x41
CPU architecture: 8
CPU variant : 0x4
CPU part : 0xd0b
CPU revision : 1

processor : 3
BogoMIPS : 108.00
Features : fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp cpuid asimdrdm lrcpc dcpop asimddp
CPU implementer : 0x41
CPU architecture: 8
CPU variant : 0x4
CPU part : 0xd0b
CPU revision : 1

Revision : d04170
Serial : 28a0b219c4dec773
Model : Raspberry Pi 5 Model B Rev 1.0

Can DaVinci listen other language?

I want to make DaVinci be able to listen Japanese prompt.
I thought that by changing something in the line below, Davinci could recognize Japanese instead of English. Even after looking at the PicoVoice documentation, I can't find a way to change the language of SpeechToText. Is there any solution?

DaVinci.py line 153
`def listen():

cobra = pvcobra.create(access_key=pv_access_key)`

AttributeError: module 'pygame' has no attribute 'mixer'

Not sure what to make of this? It detects the hotword but then pygame has a problem

`pi@raspberrypi:~ $ python3 DaVinci/DaVinci.py

DaVinci detected

Traceback (most recent call last):
File "/home/pi/DaVinci/DaVinci.py", line 303, in
voice(random.choice(prompt))
File "/home/pi/DaVinci/DaVinci.py", line 121, in voice
pygame.mixer.init()
AttributeError: module 'pygame' has no attribute 'mixer'
^Z
[4]+ Stopped python3 DaVinci/DaVinci.py
`

Nothing happens?

Hi, thanks for the instructions, i tried to follow them as closely as possibile but nothing happens when i start the program, It Just stays blank for 5 minutes then goes back to the directory.
I'm new to Raspberry so i must be doing something wrong, i'm using a USB headset as microphone/speaker, could this be the problem?
Thank you so much.

Picovoice status to exception; keyword file 2.2 v 3.0; and wake word error

Excellent instructions. I'm hung up on just these few things. Any suggestions? I'm adding this into my CM4 XGO-lite Robot Kit V2 in hopes of making the robot intelligent =)

pi@raspberrypi:~ $ cd /home/pi/DaVinci
pi@raspberrypi:~/DaVinci $ python3 DaVinci.py
Traceback (most recent call last):
File "/home/pi/DaVinci/DaVinci.py", line 295, in
wake_word()
File "/home/pi/DaVinci/DaVinci.py", line 146, in wake_word
porcupine = pvporcupine.create(keywords=["computer", "jarvis", "DaVinci",],
File "/home/pi/.local/lib/python3.9/site-packages/pvporcupine/_factory.py", line 69, in create
return Porcupine(
File "/home/pi/.local/lib/python3.9/site-packages/pvporcupine/_porcupine.py", line 198, in init
raise self._PICOVOICE_STATUS_TO_EXCEPTION[status](
pvporcupine._porcupine.PorcupineInvalidArgumentError: Initialization failed:
[0] Keyword file (.ppn) file belongs to a different version of the library. File is 2.2.0 while library is 3.0.0.
[1] Loading keyword file at /home/pi/.local/lib/python3.9/site-packages/pvporcupine/resources/keyword_files/raspberry-pi/DaVinci_raspberry-pi.ppn failed with INVALID_ARGUMENT.

Use OpenAI Whisper Model

Hi DevMiser:

I suggest that instead of using Picovoice you just use OpenAI's speech-to-text API via their "whisper" model. Check my github for example code. This would simplify your code and prevent the need for multiple API keys.

Also might I suggest having your API keys in a .env file instead of in the code itself.

Thank you!

-Evan Alexander

Connection issues after saying keyword

Hi DevMiser,
thanks for this excellent work and instructions for use.
I installed everything acc your instructions- and getting the following fail messages, after saying the keyword:

Wake word detected

Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/urllib3/connection.py", line 169, in _new_conn
conn = connection.create_connection(
File "/usr/lib/python3/dist-packages/urllib3/util/connection.py", line 73, in create_connection
for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM):
File "/usr/lib/python3.9/socket.py", line 953, in getaddrinfo
for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
socket.gaierror: [Errno -2] Name or service not known

Can you help me please?
BR,
Andreas

Failed to initialize pv_recorder

Hi,
I am running on Rpi 4 with 4G memory, 128GB sd card, and 64bit os.
The Wakeup word is working, but second after the response, I'm getting the following error:

  File "/usr/lib/python3.9/threading.py", line 954, in _bootstrap_inner
    self.run()
  File "/opt/webplant/app.py", line 281, in run
    recorder = PvRecorder(device_index=-1, frame_length=1024)
  File "/usr/local/lib/python3.9/dist-packages/pvrecorder/pvrecorder.py", line 81, in __init__
    raise self._PVRECORDER_STATUS_TO_EXCEPTION[status]("Failed to initialize pv_recorder.")
RuntimeError: Failed to initialize pv_recorder.

Thanks

Rate Limit Reached on First Use?

Hello,

I got this setup on a SD flashed fresh with Bullseye on an RPI 4, and upon speaking the wake command (DaVinci) and asking a question, I immediately receive a rate limit reached. I am not using OpenAI or Picovoice APIs for anything else. Any thoughts on how to overcome this or where to look to troubleshoot? Thanks for your help!

API error

so close to getting it running, responds with wake word but then says api error

admin@raspberrypi:~ $ cd /home/admin/DaVinci
admin@raspberrypi:~/DaVinci $ python3 DaVinci.py

jarvis detected

Listening...
Voice detected
End of query detected

What would happen if the moon were to disappear.

There was an API error. Please try again in a few minutes.

Issue with moving the files

Step 6 in the read me file has been bugging me a bit. I've done all the correct prompts and created the correct accounts. However, when I type this final command I'm met with "mv: cannot move '/home/pi/DaVinci/Davinci_raspberry-pi.ppn' to '/home/pi/.local/lib/python3.9/site-packages/pvporcupine/resources/keyword_files/raspberry-pi': no such file or directory"

Any help will be greatly appreciated!

Last step problems

Hey DevMiser, having trouble with the very lest step before reboot and run, thoughts?

admin@raspberrypi:~ $ mv /home/admin/DaVinci/DaVinci_raspberry-pi.ppn/home/admin/.local/lib/python3.11/site-packages/pvporcupine/resources/keyword_files/raspberry-pi
mv: missing destination file operand after '/home/admin/DaVinci/DaVinci_raspberry-pi.ppn/home/admin/.local/lib/python3.11/site-packages/pvporcupine/resources/keyword_files/raspberry-pi'
Try 'mv --help' for more information.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.