his Python script converts a text file into multiple MP3 audio files using Google Text-to-Speech (gTTS) and the pydub library. The script is intended to be run from the command line, requiring an input text file and an output prefix. Optional arguments allow adjustment of silence duration at the start and end of audio files. Key Features: Text segmentation, Audio synthesis, Silence padding. Output naming: Generated audio files are named with a given prefix followed by a zero-padded index number (e.g., voice000.mp3, voice001.mp3). Tested and running on linux Ubuntu 20.04 with python v.3.8
txt_2_mp3.py / Ugo Santosuosso, Lorella Bonaccorsi. - ELETTRONICO. - (2025).
txt_2_mp3.py
Ugo Santosuosso;Lorella Bonaccorsi
2025
Abstract
his Python script converts a text file into multiple MP3 audio files using Google Text-to-Speech (gTTS) and the pydub library. The script is intended to be run from the command line, requiring an input text file and an output prefix. Optional arguments allow adjustment of silence duration at the start and end of audio files. Key Features: Text segmentation, Audio synthesis, Silence padding. Output naming: Generated audio files are named with a given prefix followed by a zero-padded index number (e.g., voice000.mp3, voice001.mp3). Tested and running on linux Ubuntu 20.04 with python v.3.8I documenti in FLORE sono protetti da copyright e tutti i diritti sono riservati, salvo diversa indicazione.



