Audio play through remote HTTP

Hello,

I’m just starting with Rhasspy and I’m trying to work my way through a rpi4 setup which is on another location, i’m not at all familiar with any of the options provided in the audio Input/Output but i notice some allow for remote.

I’m currently attempting to use the Audio Play Remote HTTP option so that i can listen on the browser through node-red, i’ve set it up to send the audio to a HTTP endpoint and was able to play audio by posting a sample.wav with curl command but i’m having difficulty playing audio from rhasspy, the playload shows up in the debugging but the data doesn’t seem to be sent as “audio/wav”
image
This is the payload i’m getting when posting from Rhasspy.

The payload is the wave file published by Rhasspy.
Can you share a screenshot of your flow?

It’s something simple:

I understand it’s the payload but the it reads the string in TTS instead of playing the sound, while the sample i sent with curl shows a buffer as the payload.

I also tried changing the Audio play to command and use curl -H “Content-Type: audio/wav” --data-binary @- http://192.168.137.11:1880/input but i think the arguments field might be breaking stuff as rhasspy gets stuck saving the changes.

Edit: I’ve managed to setup the command to send the audio through curl, it looks like adding " or ’ to the string causes the [] to be removed which generates the error “TypeError: can only concatenate list (not “str”) to list”. I would still like to know why the “Remote HTTP” is sending the data with different content.

Ah ok, so is there maybe some setting on that play audio node?
If not, you said you were able to post a wave file and play it.

That is probably because when doing so, the wave file was the complete msg obejct and not the msg.payload.
Maybe it will work when you put a functionnode between audio input and play audio with something like

msg = msg.payload;
return msg;

in it.
Have not tried it however :wink:

Hey, thanks for the help.

I’ve tested what you recommended but it doesn’t accept it:
“Function tried to send a message of type Buffer”

I think i need to add a header to it with the content-type audio/wav but i’m not sure how to do it in node-red, the examples i’ve seen only show how to send them. I’ve tried modifying the req.rawHeaders but that doesn’t seem to have any effect.

Anyway, i’m going to stick with Command function as it seems to be basically the same as Remote HTTP and happens to give me more control over the arguments.