8
n8n 中文网amn8n.com

谷歌文本转语音生成器

高级

这是一个Content Creation, Multimodal AI领域的自动化工作流,包含 17 个节点。主要使用 If, Set, Wait, Airtable, FormTrigger 等节点。 使用谷歌文本转语音、云端硬盘和Airtable生成自然语音

前置要求
  • Airtable API Key
  • Google Drive API 凭证
  • 可能需要目标 API 的认证凭证
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "id": "yNlNZi8P0wL4Tj5u",
  "meta": {
    "instanceId": "df45e36346609887ad727e4340e992b711071baf718198c766e859ac499d59bf"
  },
  "name": "Google 文本转语音生成器",
  "tags": [],
  "nodes": [
    {
      "id": "2eb04401-8f1d-40c9-a832-aee4b71ed051",
      "name": "上传文件",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        420,
        40
      ],
      "parameters": {
        "name": "={{ $binary.data.fileName }}",
        "driveId": {
          "__rl": true,
          "mode": "list",
          "value": "My Drive"
        },
        "options": {},
        "folderId": {
          "__rl": true,
          "mode": "list",
          "value": "1Kmvt_nPFDbAO7y6zu95c5_snNC9A1P1n",
          "cachedResultUrl": "https://drive.google.com/drive/folders/1Kmvt_nPFDbAO7y6zu95c5_snNC9A1P1n",
          "cachedResultName": "Content Engine Storage"
        },
        "inputDataFieldName": "=data"
      },
      "credentials": {
        "googleDriveOAuth2Api": {
          "id": "23YHMzDMrJbpEXTr",
          "name": "Google Drive account"
        }
      },
      "typeVersion": 3
    },
    {
      "id": "07d8710d-bbb3-4cf7-8e9e-5601a27bee00",
      "name": "创建记录",
      "type": "n8n-nodes-base.airtable",
      "position": [
        1360,
        20
      ],
      "parameters": {
        "base": {
          "__rl": true,
          "mode": "list",
          "value": "appMBgjXji9DQtbY2",
          "cachedResultUrl": "https://airtable.com/appMBgjXji9DQtbY2",
          "cachedResultName": "Content Engine"
        },
        "table": {
          "__rl": true,
          "mode": "list",
          "value": "tblj8qQXJKjjRqaTq",
          "cachedResultUrl": "https://airtable.com/appMBgjXji9DQtbY2/tblj8qQXJKjjRqaTq",
          "cachedResultName": "Assets"
        },
        "columns": {
          "value": {
            "URL": "={{ $('Upload file').item.json.webContentLink }}",
            "Duration": "={{ $json.media.duration }}",
            "Asset Name": "=Voiceover Audio File",
            "Description": "=Script: {{ $('On form submission2').item.json.Script }}",
            "WebView URL": "={{ $('Upload file').item.json.webViewLink }}",
            "Content Type": "Audio"
          },
          "schema": [
            {
              "id": "Asset Name",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "Asset Name",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Description",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "Description",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Status",
              "type": "options",
              "display": true,
              "options": [
                {
                  "name": "Active",
                  "value": "Active"
                },
                {
                  "name": "Inactive",
                  "value": "Inactive"
                },
                {
                  "name": "Under Maintenance",
                  "value": "Under Maintenance"
                }
              ],
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "Status",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Linked Content",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "Linked Content",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Content Type",
              "type": "options",
              "display": true,
              "options": [
                {
                  "name": "Video",
                  "value": "Video"
                },
                {
                  "name": "Audio",
                  "value": "Audio"
                },
                {
                  "name": "Image",
                  "value": "Image"
                }
              ],
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "Content Type",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "URL",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "URL",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Width (px)",
              "type": "number",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "Width (px)",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Height (px)",
              "type": "number",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "Height (px)",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Aspect Ratio",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "Aspect Ratio",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Duration",
              "type": "number",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "Duration",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Content",
              "type": "array",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "Content",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "WebView URL",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "WebView URL",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Content 2",
              "type": "array",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "Content 2",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Content 3",
              "type": "array",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "Content 3",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "create"
      },
      "credentials": {
        "airtableTokenApi": {
          "id": "Gq4kelFrVUJLgEIs",
          "name": "Airtable Personal Access Token account"
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "58e6cfb8-06f4-4a76-b425-c5c351fb29d7",
      "name": "转换为文件",
      "type": "n8n-nodes-base.convertToFile",
      "position": [
        220,
        40
      ],
      "parameters": {
        "options": {},
        "operation": "toBinary",
        "sourceProperty": "audioContent"
      },
      "typeVersion": 1.1
    },
    {
      "id": "6d3aed5e-4770-4cc3-a3b1-91c9c0e3f453",
      "name": "便签 7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -880,
        -460
      ],
      "parameters": {
        "width": 460,
        "height": 1160,
        "content": "## 试试看!🗣️"
      },
      "typeVersion": 1
    },
    {
      "id": "5a80d6b6-236b-48d2-bd52-97b361e7d2d6",
      "name": "## 为什么选择 4o 模型?👆",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -360,
        280
      ],
      "parameters": {
        "color": 5,
        "width": 460,
        "height": 140,
        "content": "### 地理限制!"
      },
      "typeVersion": 1
    },
    {
      "id": "91db268c-9c73-4d22-a680-0cf155d173a8",
      "name": "便签 6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -360,
        -320
      ],
      "parameters": {
        "color": 7,
        "width": 320,
        "height": 320,
        "content": "## 1. 输入您的脚本,选择语言和语音"
      },
      "typeVersion": 1
    },
    {
      "id": "df31181c-5b54-4b8d-a1a5-3bbf92160d02",
      "name": "表单提交时2",
      "type": "n8n-nodes-base.formTrigger",
      "position": [
        -340,
        40
      ],
      "webhookId": "a2a32ec1-9470-4ed6-85fc-7d4745216f8f",
      "parameters": {
        "options": {},
        "formTitle": "Generate Text-to-Speech",
        "formFields": {
          "values": [
            {
              "fieldLabel": "Script",
              "placeholder": "The mystery of life isn't a problem to solve, but a reality to experience.",
              "requiredField": true
            },
            {
              "fieldType": "dropdown",
              "fieldLabel": "Voice",
              "fieldOptions": {
                "values": [
                  {
                    "option": "Aoede"
                  },
                  {
                    "option": "Puck"
                  },
                  {
                    "option": "Charon"
                  },
                  {
                    "option": "Kore"
                  },
                  {
                    "option": "Fenrir"
                  },
                  {
                    "option": "Leda"
                  },
                  {
                    "option": "Orus"
                  },
                  {
                    "option": "Zephyr"
                  },
                  {
                    "option": "Achird"
                  },
                  {
                    "option": "Algenib"
                  },
                  {
                    "option": "Algieba"
                  },
                  {
                    "option": "Alnilam"
                  },
                  {
                    "option": "Autonoe"
                  },
                  {
                    "option": "Callirrhoe"
                  },
                  {
                    "option": "Despina"
                  },
                  {
                    "option": "Enceladus"
                  },
                  {
                    "option": "Erinome"
                  },
                  {
                    "option": "Gacrux"
                  },
                  {
                    "option": "Iapetus"
                  },
                  {
                    "option": "Laomedeia"
                  },
                  {
                    "option": "Pulcherrima"
                  },
                  {
                    "option": "Rasalgethi"
                  },
                  {
                    "option": "Sadachbia"
                  },
                  {
                    "option": "Sadaltager"
                  },
                  {
                    "option": "Schedar"
                  },
                  {
                    "option": "Sulafat"
                  },
                  {
                    "option": "Umbriel"
                  },
                  {
                    "option": "Vindemiatrix"
                  },
                  {
                    "option": "Zubenelgenubi"
                  },
                  {
                    "option": "Achernar"
                  }
                ]
              },
              "requiredField": true
            },
            {
              "fieldType": "dropdown",
              "fieldLabel": "Langauge",
              "fieldOptions": {
                "values": [
                  {
                    "option": "en-US"
                  },
                  {
                    "option": "en-AU"
                  },
                  {
                    "option": "en-GB"
                  },
                  {
                    "option": "en-IN"
                  },
                  {
                    "option": "es-US"
                  },
                  {
                    "option": "de-DE"
                  },
                  {
                    "option": "fr-FR"
                  },
                  {
                    "option": "hi-IN"
                  },
                  {
                    "option": "pt-BR"
                  },
                  {
                    "option": "ar-XA"
                  },
                  {
                    "option": "es-ES"
                  },
                  {
                    "option": "fr-CA"
                  },
                  {
                    "option": "id-ID"
                  },
                  {
                    "option": "it-IT"
                  },
                  {
                    "option": "ja-JP"
                  },
                  {
                    "option": "tr-TR"
                  },
                  {
                    "option": "vi-VN"
                  },
                  {
                    "option": "bn-IN"
                  },
                  {
                    "option": "gu-IN"
                  },
                  {
                    "option": "kn-IN"
                  },
                  {
                    "option": "ml-IN"
                  },
                  {
                    "option": "mr-IN"
                  },
                  {
                    "option": "ta-IN"
                  },
                  {
                    "option": "te-IN"
                  },
                  {
                    "option": "nl-BE"
                  },
                  {
                    "option": "nl-NL"
                  },
                  {
                    "option": "ko-KR"
                  },
                  {
                    "option": "cmn-CN"
                  },
                  {
                    "option": "pl-PL"
                  },
                  {
                    "option": "ru-RU"
                  },
                  {
                    "option": "sw-KE"
                  },
                  {
                    "option": "th-TH"
                  },
                  {
                    "option": "ur-IN"
                  },
                  {
                    "option": "uk-UA"
                  }
                ]
              },
              "requiredField": true
            }
          ]
        },
        "formDescription": "Add your text you want generated and select a voice."
      },
      "typeVersion": 2.2
    },
    {
      "id": "96e92471-78e8-4a3d-bb86-3034876fef53",
      "name": "编辑字段",
      "type": "n8n-nodes-base.set",
      "position": [
        -160,
        40
      ],
      "parameters": {
        "mode": "raw",
        "options": {},
        "jsonOutput": "={\n  \"script\": \"{{ $json.Script }}\",\n  \"voice\": \"{{ $json.Langauge }}-Chirp3-HD-{{ $json.Voice }}\"\n}"
      },
      "typeVersion": 3.4
    },
    {
      "id": "3232d9e3-a1ff-407b-8aa0-121c420121f9",
      "name": "条件判断",
      "type": "n8n-nodes-base.if",
      "position": [
        1000,
        40
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "35b5c3da-9b1e-47ac-9f8e-cae257b54db4",
              "operator": {
                "name": "filter.operator.equals",
                "type": "string",
                "operation": "equals"
              },
              "leftValue": "={{ $json.status }}",
              "rightValue": "COMPLETED"
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "5feb467f-73c6-49de-bbeb-d946ab041f24",
      "name": "等待",
      "type": "n8n-nodes-base.wait",
      "position": [
        1180,
        180
      ],
      "webhookId": "7e197a7f-a920-4c18-aa08-69c6619772fc",
      "parameters": {
        "amount": 1
      },
      "typeVersion": 1.1
    },
    {
      "id": "591bfd72-ba48-49da-b374-f071ad451574",
      "name": "获取状态",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        820,
        40
      ],
      "parameters": {
        "url": "={{ $json.status_url }}",
        "options": {},
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth"
      },
      "credentials": {
        "httpHeaderAuth": {
          "id": "CGeuvZYLP5EnviQI",
          "name": "fal.ai n8n key"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "126d1809-86cd-447e-b8d3-5a33cd993a76",
      "name": "请求 TTS",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        20,
        40
      ],
      "parameters": {
        "url": "https://texttospeech.googleapis.com/v1/text:synthesize",
        "method": "POST",
        "options": {
          "response": {
            "response": {}
          }
        },
        "jsonBody": "={\n  \"input\": {\n    \"markup\": \"{{ $json.script }}\"\n  },\n  \"voice\": {\n    \"languageCode\": \"{{ $('On form submission2').item.json.Langauge }}\",\n    \"name\": \"{{ $json.voice }}\"\n  },\n  \"audio_config\": {\n    \"audio_encoding\": \"LINEAR16\",\n    \"speaking_rate\": 1.0\n  }\n}",
        "sendBody": true,
        "sendHeaders": true,
        "specifyBody": "json",
        "authentication": "predefinedCredentialType",
        "headerParameters": {
          "parameters": [
            {}
          ]
        },
        "nodeCredentialType": "googleOAuth2Api"
      },
      "credentials": {
        "httpHeaderAuth": {
          "id": "XBnDjMOflNcdDdAK",
          "name": "Google Text-to-Speech Key"
        },
        "googleOAuth2Api": {
          "id": "IkygAMMZ6UWQgRtS",
          "name": "Google n8n Client"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "069111f8-b712-424d-9428-2baa8a9d8b1b",
      "name": "请求时长",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        600,
        40
      ],
      "parameters": {
        "url": "https://queue.fal.run/fal-ai/ffmpeg-api/metadata",
        "method": "POST",
        "options": {},
        "jsonBody": "={\n  \"media_url\": \"{{ $json.webContentLink }}\"\n}",
        "sendBody": true,
        "specifyBody": "json",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth"
      },
      "credentials": {
        "httpHeaderAuth": {
          "id": "CGeuvZYLP5EnviQI",
          "name": "fal.ai n8n key"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "c6a310e0-ab35-4e70-b0e8-49cd59380dd6",
      "name": "获取时长",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1180,
        20
      ],
      "parameters": {
        "url": "={{ $json.response_url }}",
        "options": {},
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth"
      },
      "credentials": {
        "httpHeaderAuth": {
          "id": "CGeuvZYLP5EnviQI",
          "name": "fal.ai n8n key"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "943bfe16-c82a-4de2-b56b-df4cfeb756e7",
      "name": "便签",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        20,
        -320
      ],
      "parameters": {
        "color": 7,
        "width": 500,
        "height": 320,
        "content": "## 2. 请求并返回 TTS 音频。将 Base64 字符串转换为音频文件。"
      },
      "typeVersion": 1
    },
    {
      "id": "7e231d99-67b9-434d-ad92-4c2e6c3b817a",
      "name": "便签1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        600,
        -320
      ],
      "parameters": {
        "color": 7,
        "width": 680,
        "height": 320,
        "content": "## 3. 查找音频文件的时长"
      },
      "typeVersion": 1
    },
    {
      "id": "3da2e908-ee34-4114-ad72-c580d30ef7e5",
      "name": "便签2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1360,
        -320
      ],
      "parameters": {
        "color": 7,
        "width": 320,
        "height": 320,
        "content": "## 4. 使用新音频文件更新我们的数据库"
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "835bce29-cde5-40d5-8358-cf23271a66c0",
  "connections": {
    "If": {
      "main": [
        [
          {
            "node": "Get Duration",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Wait",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait": {
      "main": [
        [
          {
            "node": "Get Status",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Status": {
      "main": [
        [
          {
            "node": "If",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Edit Fields": {
      "main": [
        [
          {
            "node": "Request TTS ",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Upload file": {
      "main": [
        [
          {
            "node": "Request Duration",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Duration": {
      "main": [
        [
          {
            "node": "Create a record",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Request TTS ": {
      "main": [
        [
          {
            "node": "Convert to File",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Convert to File": {
      "main": [
        [
          {
            "node": "Upload file",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create a record": {
      "main": [
        []
      ]
    },
    "Request Duration": {
      "main": [
        [
          {
            "node": "Get Status",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "On form submission2": {
      "main": [
        [
          {
            "node": "Edit Fields",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

复制上方的 JSON 配置代码,在您的 n8n 实例中创建新工作流并选择「从 JSON 导入」,粘贴配置后根据需要修改凭证设置即可。

这个工作流适合什么场景?

高级 - 内容创作, 多模态 AI

需要付费吗?

本工作流完全免费,您可以直接导入使用。但请注意,工作流中使用的第三方服务(如 OpenAI API)可能需要您自行付费。

工作流信息
难度等级
高级
节点数量17
分类2
节点类型9
难度说明

适合高级用户,包含 16+ 个节点的复杂工作流

作者
Jesse White

Jesse White

@creativeaitools

Driven by a passion for innovation and systems design, I specialize in building creative automations and AI-powered tools that simplify workflows and drive results. With a strong background in web development, API integration, and no-code platforms like n8n, I create scalable solutions for content creators, startups, and small businesses. My focus is on combining efficiency with creativity—turning ideas into streamlined digital products.

外部链接
在 n8n.io 查看

分享此工作流