ok cool, so handly.py is working
The ${RHASSPY_PROFILE_DIR} is not found in handle.py, because that variable is not known there.
Try it with os.system(f"aplay /home/pi/.config/rhasspy/profiles/es/sounds/wake.wav")
Assuming you have that in your profile, please check the path.
What is it that you want to achieve? The original code: speech(random.choice(replies))
should activate the Text to speech
Does this work in a terminal? aplay /home/pi/.config/rhasspy/profiles/es/sounds/wake.wav
[DEBUG:2021-04-20 14:58:24,629] rhasspyremote_http_hermes: /home/pi/.config/rhasspy/profiles/es/wake.wav: No such file or directory
In Terminal works and reproduces well:
aplay /home/pi/.config/rhasspy/profiles/es/wake.wav
Playing WAVE '/home/pi/.config/rhasspy/profiles/es/wake.wav' : Signed 16 bit Little Endian, Rate 22050 Hz, Stereo
Is it honestly rare, there is some other way of playing audio? I will not use TTS.
It works on console, but not in the Python code of handle.py
[DEBUG:2021-04-20 18:05:55,459] rhasspyasr_deepspeech_hermes: Receiving audio
[DEBUG:2021-04-20 18:05:55,488] rhasspyremote_http_hermes: Warning: Couldn't read data from file "/home/pi/Desktop/wake.wav", this makes
Warning: an empty POST.
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 85 100 85 0 0 1024 0 --:--:-- --:--:-- --:--:-- 1024
[DEBUG:2021-04-20 21:23:20,467] rhasspyremote_http_hermes: Traceback (most recent call last):
File "/profiles/es/handle.py", line 5, in <module>
from playsound import playsound
ModuleNotFoundError: No module named 'playsound'
The problem is that that comes out with other dependencies, most. I have them installed correctly, in console runs well.
From what I have read in various topics, your biggest problem is not understanding how docker works. I assume you are trying to get the script to run as command script and therefore you are running inside docker and the path “/home/pi/Desktop/demo.wav” does not exist inside docker.
From the way it sounds when you write English is not your native language (it isn’t mine either) and most problems you face come from not recognizing what is available inside docker and what is outside. You should find yourself an introduction into docker in your language somewhere on the internet and visit the script problem after you know how to get files into docker, what is available inside docker and what is on the host system. That is not something, the rhasspy forum does cover naturally and while we try to help you, you seem to run into the same problem over and over when trying out different approaches to how to play sound from rhasspy.
You have stuff installec on the host system, and your commands work there, but the host system is completely different to the system rhasspy runs inside docker, so naturally everything you try in there doesn’t work if you try it the same way you do on the host system. The host system of course finds “/home/pi/Desktop/demo.wav”, but you can think of a docker container as a completely different linux system, and what you install on the host, or what files you have on the host, just is not available naturally in there. So you have to learn about how docker works and how to get stuff inside docker, about how the paths are different between host system and docker in regards to the profile folder ("/profiles/es" inside docker and “/home/pi/.config/rhasspy/profiles/es” on the host system). Without you having that understanding, there is not much we can help you with on this forum.
You could say and only with that would have been enough.
But, all the other you said will appreciate it and take your advice. You’re right, but, up I’ve commented that I’m new on the subject, so I hope it has not been a lot of trouble.