Tried this right now but it wont work, does the wav file has to be in a specific format? I just converted a mp3 to wav using audacity. (WAV Microsoft signed 16-bit PCM), put it in HAs www directory and send the url to the API (http://192.168.1.8:8123/local/kitchen-timer.wav)
That sounds like an error in how the service is called.
Can you try this on the commandline to see whether Rhasspy can play the WAV file?
curl -X POST "http://IPOFYOURRHASSPY:12101/api/play-wav" -H "Content-Type: audio/wav" --data-binary @"/local/path/of/kitchen-timer.wav"
When I call the above service with curl with the right URL and file path on my system (note the @ before the filename!), the WAV file is played on my Hermes audio player connected with Rhasspy via MQTT.
The play-wav service doesnât seem to accept a URL, though⌠At least that doesnât work here and if I read the source code correctly it just plays the request data of the POST request directly as a WAV file.
Ok your command works, but it only works with local files.
So the audiofile is send as data instead of a file path or url.
So to use this with node-red i have to read the file and then sends its content to the api. Lets see if i can get this working
UPDATE:
Ok got it working, put the file in a directory my nodered docker can read and then use the âfile readâ node and send its content as a single buffered object to the api.
Great! By the way, did you get a chance to run my Hermes Audio Server? I just published a new version with some bugs fixed. By trying to send some WAV files with Rhasspyâs API to answer your question, I discovered that the audio player crashed on invalid WAV files That doesnât happen anymore in the newest version.
Thanks for catching this. It is fixed in master, and will be rolled into the next version. I changed @Romkabouter original code to make the voice property uniform with the other TTS systems, but failed to make the change everywhere.
Hi @synesthesiam I have been playing with the new RASA 1.0 since last week and I have a first RASA NLU + Core assistant running. Does Rhasspy have a way to link its ASR and TTS to RASA?
Rhasspy worked with RASA NLU about a year ago, and theyâve made some pretty significant changes. I havenât been able to run their Docker image, so I canât even debug it.
The way itâs supposed to work is that Rhasspy produces the YAML file needed for training a RASA agent and POSTs it to the training endpoint. Then, during intent recognition, the text transcription is POST-ed to the RASA server and the JSON intent is used.
If youâre interested in RASA, you may also want to check out the flair recognizer that I added. It does something pretty similar to RASA â it trains an intent classifier and a set of named entity recognizers using magical machine learning!
Flair looks nice too, but one of the thing that I like about RASA is that it also has a dialogue manager (RASA Core) that uses a machine learning model trained on example conversations to decide what to do next, so you donât have to code a complex mess of if/then/else statements. And it also has an action server to do something with the recognized intents. For instance, I have now running RASA NLU + Core + actions on a toy example that lets me ask information about the state of a specific Home Assistant entity (using Home Assistantâs REST API) and answers me.
This is all using a text interface for now. But I have taken a look at the RASA integration in Rhasspyâs code and Iâll see if I can link my RASA setup to Rhasspy. I noticed that Rhasspy only uses RASA NLU, so I have to try if the RASA Core part keeps working then, because when I only train the NLU manually my RASA actions donât work (they need a trained Core model too).
Iâm not sure yet I will take the full RASA stack route. Itâs impressive, but Iâm probably not going to need it all. Currently Iâm running no dialogue manager and Iâm running actions in Home Assistantâs AppDaemon and that works fine for simple stuff. So just linking RASA NLU to Rhasspy is already very useful.
I also wasnât able to run their latest Docker image, but after some debugging the reason became clear: their TensorFlow package is compiled with AVX extensions and my CPU doesnât have these. So I just set up RASA in a Python virtual environment with an alternative TensorFlow wheel and this works.
if its not to much work it could be helpfull in the future? Such in option would benifit for more supported audio types like mp3 or ogg since you are most likely trying to playback a file from an external source.
What is the current status on some kind of dialog? Still working on my timer and tought it would ask the user if a timer is allready set if he wants to set a new one. So simple tts message and then listen for yes or no.
i could probably get this working with intents and events but for simple yes or no answers this is probably not the smartest solution.
Is something like that planned?
@koan:
I just tried your hermes-audio-server but it crashes with the following error: Configuration file [Errno 2] No such file or directory.
I have created the config in /etc/hermes-audio-server.json and even if i start the player with -c /PATHTOCONFIG.json it wont work.
Are the permissions right for the configuration file? It should be readable by the user running the audio server commands. In my setup itâs:
$ ls -l /etc/hermes-audio-server.json
-rw-r--r-- 1 root root 74 May 17 16:37 /etc/hermes-audio-server.json
About the dialogue: see above about my experiments with RASA. The RASA Core component is a powerful dialogue manager that can even learn your dialogues from example conversations. But itâs not yet integrated into Rhasspy.
as im running everything as root atm permission shouldnt be a problem and my output looks the same as yours.
btw running player or recorder list all ALSA devices and end with Connected to audio input/output default.
But i guessed this is normal behaviorâŚ
My json config looks exactly like the example on https://pypi.org/project/hermes-audio-server/ and i installed the server through pip. Of course i changed the config to connect to my own mqtt server and use the correct side id.
Are you sure you have double-checked the filename? I canât reproduce this error here. Are you running the last version (0.1.1)? I also donât get the list of all ALSA devices here. This is what hermes-audio-player outputs in my setup:
$ hermes-audio-player
hermes-audio-player 0.1.1
Connected to audio output default.
Connected to MQTT broker mqtt:1883 with result code 0.
Subscribed to hermes/audioServer/livingroom/playBytes/+.
And this is what hermes-audio-recorder outputs:
$ hermes-audio-recorder
hermes-audio-recorder 0.1.1
Connected to audio input default.
Connected to MQTT broker mqtt:1883 with result code 0.
Started broadcasting audio from device default on site livingroom
Or did you maybe install an older version before, but not as root? Maybe Python is still picking up the older modules from .local/lib/python. Because when I enter an invalid filename, I get the following error: