{
  "name": "TTS",
  "nodes": [
    {
      "parameters": {
        "formTitle": "TTS",
        "formDescription": "Generates an audio file",
        "formFields": {
          "values": [
            {
              "fieldLabel": "text",
              "fieldType": "textarea",
              "placeholder": "The text to speak",
              "requiredField": true
            },
            {
              "fieldLabel": "output",
              "placeholder": "output.wav",
              "requiredField": true
            },
            {
              "fieldLabel": "voice",
              "fieldType": "dropdown",
              "fieldOptions": {
                "values": [
                  {
                    "option": "af_heart"
                  },
                  {
                    "option": "af_alloy"
                  },
                  {
                    "option": "af_aoede"
                  },
                  {
                    "option": "af_bella"
                  },
                  {
                    "option": "af_nicole"
                  },
                  {
                    "option": "af_nova"
                  },
                  {
                    "option": "af_sarah"
                  },
                  {
                    "option": "af_sky"
                  },
                  {
                    "option": "am_fenrir"
                  },
                  {
                    "option": "am_michael"
                  },
                  {
                    "option": "am_puck"
                  },
                  {
                    "option": "bf_emma"
                  },
                  {
                    "option": "bf_isabella"
                  },
                  {
                    "option": "bm_fable"
                  },
                  {
                    "option": "bm_george"
                  }
                ]
              },
              "requiredField": true
            },
            {
              "fieldLabel": "speed",
              "fieldType": "number",
              "placeholder": "1.15"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.formTrigger",
      "typeVersion": 2.3,
      "position": [
        -80,
        48
      ],
      "id": "4ce46d21-b8dd-45df-aba9-f4f00afcc253",
      "name": "TTS"
    },
    {
      "parameters": {
        "content": "# TTS\nGenerate TTS audio",
        "height": 256,
        "width": 432
      },
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        -96,
        -48
      ],
      "id": "018431a6-19aa-49dd-b372-373bfd619070",
      "name": "Sticky Note6"
    },
    {
      "parameters": {
        "method": "POST",
        "url": "http://helm/tts",
        "sendBody": true,
        "bodyParameters": {
          "parameters": [
            {
              "name": "text",
              "value": "={{ $json.text }}"
            },
            {
              "name": "output",
              "value": "={{ $json.output }}"
            },
            {
              "name": "voice",
              "value": "={{ $json.voice }}"
            },
            {
              "name": "speed",
              "value": "={{ $json.speed }}"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        144,
        48
      ],
      "id": "70ae7881-ae67-4abf-a15f-d0f16b1982be",
      "name": "tts"
    },
    {
      "parameters": {
        "assignments": {
          "assignments": [
            {
              "id": "4756235c-538f-4a5c-aa35-06bf0ec5bd51",
              "name": "text",
              "value": "={{ $json.text }}",
              "type": "string"
            },
            {
              "id": "50d0af59-2998-4f36-b893-5d6d631f3052",
              "name": "output",
              "value": "=/documents/tts/{{ $json.output }}",
              "type": "string"
            },
            {
              "id": "263cb1c7-0ed0-4ef9-80ba-9b8ac1ace52c",
              "name": "voice",
              "value": "={{ $json.voice }}",
              "type": "string"
            },
            {
              "id": "91768971-28e3-473e-9bdf-918fbb5c7dd8",
              "name": "speed",
              "value": "={{ $json.speed == 0 ? 1 : Math.min(2, Math.max(0.5, $json.speed)) }}",
              "type": "number"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [
        32,
        48
      ],
      "id": "0f63a1f3-fa6d-491b-b9b3-e0932dbd5edc",
      "name": "mod"
    }
  ],
  "connections": {
    "TTS": {
      "main": [
        [
          {
            "node": "mod",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "mod": {
      "main": [
        [
          {
            "node": "tts",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "22048b2e-4f62-42d1-9050-be785015af11",
  "id": "54eJHKH5mHCkUSyt",
  "tags": []
}