Socket
Book a DemoInstallSign in
Socket

n8n-nodes-google-cloud-tts

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

n8n-nodes-google-cloud-tts

n8n community node for Google Cloud Text-to-Speech API

0.2.1
latest
Source
npmnpm
Version published
Weekly downloads
16
Maintainers
1
Weekly downloads
 
Created
Source
npm install n8n-nodes-google-cloud-tts

For Docker-based deployments, add the following to your n8n Dockerfile:

RUN npm install -g n8n-nodes-google-cloud-tts

Operations

Speech Resource

Synthesize

  • Description: Convert text to speech using Google Cloud Text-to-Speech API
  • Parameters:
    • text: The text to convert to speech (required)
    • languageCode: Language code (e.g., 'de-DE', 'en-US')
    • voiceName: Specific voice name (optional)
    • voiceGender: Voice gender (NEUTRAL, MALE, FEMALE)
    • audioEncoding: Audio format (MP3, LINEAR16, OGG_OPUS)
    • speakingRate: Speaking speed (0.25 to 4.0)
    • pitch: Voice pitch (-20.0 to 20.0)
    • outputFormat: Return format (Base64 String or Binary Data)

Voice Resource

List

  • Description: List available voices from Google Cloud Text-to-Speech
  • Parameters:
    • languageCodeFilter: Filter voices by language code (optional)

Credentials

This node supports two authentication methods:

  • Google OAuth2 API (Recommended) - Use n8n's built-in Google OAuth2 credentials
  • Service Account Key - Traditional JSON key file approach
  • Create a Google Cloud Project:

    • Go to Google Cloud Console
    • Create a new project or select an existing one
  • Enable the Text-to-Speech API:

    • Navigate to "APIs & Services" > "Library"
    • Search for "Cloud Text-to-Speech API"
    • Click "Enable"
  • Configure in n8n:

    • Create new credentials of type "Google OAuth2 API" (this is n8n's standard Google OAuth2 credential)
    • Set the scope to include: https://www.googleapis.com/auth/cloud-platform
    • Complete the OAuth flow by signing in with Google
    • This credential can be reused for multiple Google Cloud services

Method 2: Service Account Key

  • Create Service Account:

    • Go to "IAM & Admin" > "Service Accounts"
    • Click "Create Service Account"
    • Give it a name and description
    • Assign the "Cloud Text-to-Speech User" role
    • Generate and download the JSON key file
  • Configure in n8n:

    • Create new credentials of type "Google Cloud Text-to-Speech API"
    • Paste the entire JSON key file content into the "Service Account Key" field
    • Optionally set the Project ID

Compatibility

  • n8n version: 0.198.0 or later
  • Node.js: 18.10 or later

Usage

Basic Text-to-Speech Example

  • Add the Google Cloud TTS node to your workflow
  • Select "Speech" > "Synthesize"
  • Configure the parameters:
    Text: "Hello, this is a test message in German."
    Language Code: de-DE
    Voice Gender: FEMALE
    Audio Encoding: MP3
    
  • Run the workflow

The node will return the synthesized speech as either:

  • Base64 String: Audio data encoded as base64
  • Binary Data: Direct binary audio file

Advanced Example with Dynamic Text

{
  "nodes": [
    {
      "name": "Start",
      "type": "n8n-nodes-base.start",
      "position": [250, 300]
    },
    {
      "name": "Google Cloud TTS",
      "type": "n8n-nodes-google-cloud-tts.googleCloudTts",
      "position": [450, 300],
      "parameters": {
        "resource": "speech",
        "operation": "synthesize",
        "text": "={{ $json.message }}",
        "languageCode": "de-DE",
        "voiceGender": "FEMALE",
        "outputFormat": "binary"
      }
    }
  ]
}

List Available Voices

Use the "Voice" > "List" operation to discover available voices:

{
  "parameters": {
    "resource": "voice",
    "operation": "list",
    "languageCodeFilter": "de-DE"
  }
}

Supported Languages

The node supports all languages available in Google Cloud Text-to-Speech, including:

  • German (de-DE): Multiple neural and WaveNet voices
  • English (en-US, en-GB): Wide variety of voices
  • Spanish (es-ES): Male and female voices
  • French (fr-FR): Multiple voice options
  • Italian (it-IT): Neural voices available
  • Portuguese (pt-BR): Brazilian Portuguese
  • Japanese (ja-JP): Natural-sounding voices
  • Chinese (zh-CN): Mandarin Chinese
  • Korean (ko-KR): Korean voices

For a complete list, use the "List Voices" operation.

Examples

1. Multi-Language Text-to-Speech

// Input data
[
  {
    "text": "Hello World",
    "language": "en-US"
  },
  {
    "text": "Hallo Welt",
    "language": "de-DE"
  },
  {
    "text": "Bonjour le monde",
    "language": "fr-FR"
  }
]

// Node configuration
{
  "text": "={{ $json.text }}",
  "languageCode": "={{ $json.language }}",
  "voiceGender": "NEUTRAL",
  "outputFormat": "binary"
}

2. Dynamic Voice Selection

// Use different voices based on content type
{
  "text": "={{ $json.message }}",
  "languageCode": "de-DE",
  "voiceName": "={{ $json.isNews ? 'de-DE-News-K' : 'de-DE-Wavenet-F' }}",
  "speakingRate": "={{ $json.isUrgent ? 1.2 : 1.0 }}"
}

3. Batch Processing

// Process multiple texts in one workflow
{
  "resource": "speech",
  "operation": "synthesize",
  "text": "={{ $json.texts.join('. ') }}",
  "languageCode": "de-DE",
  "outputFormat": "binary"
}

Error Handling

The node includes comprehensive error handling:

  • Authentication errors: Invalid service account credentials
  • API errors: Quota exceeded, invalid parameters
  • Network errors: Connection timeout, DNS resolution
  • Validation errors: Missing required parameters

Enable "Continue on Fail" in the node settings to handle errors gracefully in your workflow.

Performance Tips

  • Batch Processing: Combine multiple short texts into longer requests
  • Caching: Store frequently used audio files to avoid repeated API calls
  • Audio Format: Use MP3 for smaller file sizes, LINEAR16 for highest quality
  • Voice Selection: Neural voices provide better quality but consume more quota

Resources

Support

For issues with this community node:

License

MIT

Version History

0.2.0

  • NEW: OAuth2 authentication support
  • Added Google Cloud Text-to-Speech OAuth2 API credentials
  • Improved authentication handling with fallback support
  • Updated documentation with OAuth2 setup instructions

0.1.0

  • Initial release
  • Speech synthesis with full parameter control
  • Voice listing functionality
  • Base64 and binary output formats
  • Support for all Google Cloud TTS languages
  • Comprehensive error handling

Keywords

n8n-community-node-package

FAQs

Package last updated on 28 Jun 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.