Skip to content
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

Possible to synthesize speech via http request? #9

Open
jereskuta opened this issue Feb 22, 2024 · 2 comments
Open

Possible to synthesize speech via http request? #9

jereskuta opened this issue Feb 22, 2024 · 2 comments

Comments

@jereskuta
Copy link

Documentation doesn't tell me, if its possible to use piper via http requests. I have wyoming piper running in a separate server and home assistant is able to use it just fine.

I would like to use the tts functionality with another project as well by sending http request with the text and playing the output file in my program.

I think this is how home assistant is using piper so it should be possible?

@jerblack
Copy link

You can do this with a Home Assistant automation using the webhook trigger. Here's how I do the same thing:

alias: speak webhook
description: ""
trigger:
  - platform: webhook
    allowed_methods:
      - POST
      - PUT
    local_only: true
    webhook_id: speak
condition: []
action:
  - service: tts.speak
    target:
      entity_id: tts.piper
    data:
      cache: true
      media_player_entity_id: media_player.snapcast_tts
      message: |
        {{ trigger.json.text }}
mode: queued

And then I can POST text to that endpoint and Piper will speak the text through my Snapcast server.

curl -H "Content-Type: application/json" -X POST http://homeassistant.local:8123/api/webhook/speak -d '{"text":"the time is 3 12 pm"}'

@o-leary
Copy link

o-leary commented Oct 19, 2024

is there an openai compatible wrapper somewhere? would love to use with both open-webui and homeassistant.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants