Generate audio from text scripts using self-hosted Bark model and Google Drive
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 Bark model. 4. Upload ...
Template notes
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 Bark model. 4. Upload back to Drive.
š¦ Dependencies: - Python script: /scripts/generatevoice.py - Bark (voice generation system) - n8n instance with access to local shell - Google Drive OAuth2 credentials
āļø Notes: - Script filenames must end with .txt - Only works with plain text - No external API used = 100% free
š¦ /scripts/generatevoice.py: python import sys import torch import numpy import re from bark import SAMPLERATE, generateaudio, preloadmodels from scipy.io.wavfile import write as writewav
Patch to allow numpy.core.multiarray.scalar during loading torch.serialization.addsafeglobals([numpy.core.multiarray.scalar])
Monkey patch torch.load to force weightsonly=False originaltorchload = torch.load def patchedtorchload(f, args, kwargs): if 'weightsonly' not in kwargs: kwargs['weightsonly'] = False return originaltorchload(f, args, kwargs) torch.load = patchedtorchload