Block 1 - Start: External Trigger
- Type / Role
- n8n-nodes-base.executeWorkflowTrigger - executeWorkflowTrigger
- Config choices
- Version 1.1
This workflow is provided as-is. Please review and test before using in production.
Audio Generator – Documentation Purpose: Generate audio files from text scripts stored in Google Drive. Flow: 1. Receive repo IDs. 2. Fetch text scripts. 3. Generate .wav files using local Ba...
n8n-nodes-base.executeworkflowtrigger, n8n-nodes-base.manualtrigger, n8n-nodes-base.set, n8n-nodes-base.aggregate, n8n-nodes-base.googledrive, n8n-nodes-base.splitinbatches, n8n-nodes-base.readwritefile, n8n-nodes-base.executecommand
This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by Flavien.
Original n8n.io source🎯 Purpose: Generate audio files from text scripts stored in Google Drive.
🔁 Flow:
📦 Dependencies:
/scripts/generate_voice.py✏️ Notes:
.txt📦 /scripts/generate_voice.py:
import sys
import torch
import numpy
import re
from bark import SAMPLE_RATE, generate_audio, preload_models
from scipy.io.wavfile import write as write_wav
# Patch to allow numpy._core.multiarray.scalar during loading
torch.serialization.add_safe_globals([numpy._core.multiarray.scalar])
# Monkey patch torch.load to force weights_only=False
_original_torch_load = torch.load
def patched_torch_load(f, *args, **kwargs):
if 'weights_only' not in kwargs:
kwargs['weights_only'] = False
return _original_torch_load(f, *args, **kwargs)
torch.load = patched_torch_load
# Preload Bark models
preload_models()
def split_text(text, max_len=300):
# Split on punctuation to avoid mid-sentence cuts
sentences = re.split(r'(?<=[.?!])\s+', text)
chunks = []
current = ""
for sentence in sentences:
if len(current) + len(sentence) < max_len:
current += sentence + " "
else:
chunks.append(current.strip())
current = sentence + " "
if current:
chunks.append(current.strip())
return chunks
# Input text file and output path
input_text_path = sys.argv[1]
output_wav_path = sys.argv[2]
with open(input_text_path, 'r', encoding='utf-8') as f:
full_text = f.read()
voice_preset = "v2/en_speaker_7"
chunks = split_text(full_text)
# Generate and concatenate audio chunks
audio_arrays = []
for chunk in chunks:
print(f"Generating audio for chunk: {chunk[:50]}...")
audio = generate_audio(chunk, history_prompt=voice_preset)
audio_arrays.append(audio)
# Merge all audio chunks
final_audio = numpy.concatenate(audio_arrays)
# Write final .wav file
write_wav(output_wav_path, SAMPLE_RATE, final_audio)
print(f"Full audio generated at: {output_wav_path}")
This catalog entry is organized from the workflow JSON. The node-level section below shows the executable blocks available for review before importing the template.
| Workflow | Generate audio from text scripts using self-hosted Bark model and Google Drive |
|---|---|
| Complexity | intermediate |
| Nodes | 12 |
| Categories | Content Creation, Multimodal AI |
| Author | Flavien |
| Published | 20 May 2025 |
Use the JSON export at /data/workflows/4241/4241.json as the source template for this automation.
Open n8n, import the downloaded JSON, and review each node before activating the workflow.
Replace placeholder credentials, API keys, webhook URLs, account IDs, and environment-specific values with your own settings.
Run the workflow manually or in a staging workspace, inspect node output, and confirm downstream systems receive the expected data.
Enable the workflow only after testing, then monitor executions, errors, and rate limits during the first production runs.
Review imported nodes carefully before activation. This catalog entry is intended to help you inspect the workflow structure, understand required services, and find related templates faster.
Node names, credentials, schedules, webhook paths, and external service limits may need adjustment for your workspace.
Audio Generator – Documentation Purpose: Generate audio files from text scripts stored in Google Drive. Flow: 1. Receive repo IDs. 2. Fetch text scripts. 3. Generate .wav files using local Ba...
Review the workflow JSON, configure any required credentials in n8n, and test the automation in a safe workspace before using it in production.
Yes. Use the block-by-block analysis and the downloadable JSON to inspect each node, then adjust credentials, prompts, schedules, filters, or destinations for your Content Creation, Multimodal AI use case.