New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Play an audio file with API #216
Comments
Sure 🙂 curl -X POST -H 'Content-Type: audio/wav' --data-binary @- 'http://localhost:12101/api/play-wav' < /path/to/my.wav The For MQTT, check out the |
Thank you for this answer. My original question is to use a Rhasspy API with a path of a wav file (stored on Rhasspy profile) to play them. |
Can you explain with a bit more detail of what you want to achieve? Playing wave file is already supported. |
Hello, I hope this explanation is more clear. |
If I understand correctly, you want an endpoint (like http://localhost:12101/api/play-sound) and you can post a filename to it (mysound.wav). Correct? |
@Romkabouter is correct. There are 3 modes for the play-wav API:
|
@Romkabouter, yes, this the idea. @synesthesiam, theses modes is already available on the current version of the API? |
Yes, it's currently in the API (
It's assumed to be an absolute path right now. One useful change might be to use a regex to check if its a URL first, and if not interpret as a path relative to the profile dir (or absolute path if it starts with |
Thank you @synesthesiam for this answer. |
Any idea what I'm doing wrong? 2023-05-03 02:45:05.875 ERROR (MainThread) [homeassistant.components.shell_command] Error running command: |
Here's the curl command I have set up as a shell command in my configuration file so I can call it from a script. Hope this helps guide you to a solution.
|
@C64ever thanks for replying. That was way more painful than it needed to be, but I just got it. For anyone else that stumbles on this post running rhasspy in Docker with the recommended Docker installation:
|
Is there a way to play an audio file stored locally (on profile folder for example) by a call of Rhasspy API (HTTP or MQTT)?
Regards
The text was updated successfully, but these errors were encountered: