Gathering detailed insights and metrics for extra-googletts
Gathering detailed insights and metrics for extra-googletts
Gathering detailed insights and metrics for extra-googletts
Gathering detailed insights and metrics for extra-googletts
Generate speech audio from super long text through machine (via "Google TTS", "ffmpeg").
npm install extra-googletts
Typescript
Module System
Node Version
NPM Version
JavaScript (100%)
Total Downloads
45,653
Last Day
6
Last Week
15
Last Month
266
Last Year
2,169
MIT License
5 Stars
94 Commits
2 Forks
2 Watchers
1 Branches
1 Contributors
Updated on Apr 08, 2025
Latest Version
1.6.31
Package Id
extra-googletts@1.6.31
Unpacked Size
23.15 kB
Size
7.95 kB
File Count
4
NPM Version
9.6.4
Node Version
20.0.0
Published on
Jul 20, 2023
Cumulative downloads
Total Downloads
Last Day
-25%
6
Compared to previous day
Last Week
0%
15
Compared to previous week
Last Month
236.7%
266
Compared to previous month
Last Year
38.3%
2,169
Compared to previous year
Generate speech audio from super long text through machine, via Google TTS, ffmpeg.
Do you want to:
- Share your ideas anonymously on YouTube?
- Pretend on phone that you are not a kid (Home Alone)?
- Learn good english pronunciation for a speech?
- Make your computer read out your school notes?
- Experiment with various voices from around the globe?
- Or, Upload Wikipedia TTS videos on YouTube?
Sample: "I want to order a stuffed crust pizza".
npm install -g extra-googletts
in console.npm install extra-googletts
.Cloud Text-to-Speech API
.No, I’m not using them
.What credentials do I need
?.googletts
(your choice).Project -> Owner
.googletts
(same as name).JSON
.Continue
.account_id.json
.account_id.json
.GOOGLE_APPLICATION_CREDENTIALS
to it.On Windows, use RapidEE to set environment variable.
1# on linux or macos console 2export GOOGLE_APPLICATION_CREDENTIALS="[PATH OF account_id.json]" 3 4# on windows powershell 5$env:GOOGLE_APPLICATION_CREDENTIALS="[PATH OF account_id.json]"
1googletts "I want to order a stuffed crust pizza" 2# out.mp3 created (yay!) 3 4googletts -t speech.txt -o speech.mp3 5# speech.mp3 created from text in speech.txt 6 7googletts "Hello 911, my husband is in danger!" -vg female 8# out.mp3 created with female voice 9 10echo "Dead man walking." | googletts --log -vn en-US-Wavenet-B 11# out.mp3 created with different male voice (log enabled)
Available TTS voices?
1googletts [options] <text> 2# text: input text 3 4# Options: 5# --help: show this help 6# -l, --log: enable log 7# -o, --output: set output audio file (out.mp3) 8# -t, --text: set input text file 9# -r, --retries: set speech synthesis retries (8) 10# -a, --acodec: set acodec (copy) 11# -ae, --audio_encoding: set audio encoding (MP3) 12# -af, --audio_frequency: set audio frequency/sample rate 13# -lc, --language_code: set language code (en-US) 14# -vn, --voice_name: set voice name 15# -vg, --voice_gender: set voice gender (neutral) 16# -vp, --voice_pitch: set voice pitch change (0.0) 17# -vr, --voice_rate: set voice speaking rate (1.0) 18# -vv, --voice_volume: set voice volume gain in dB (0.0) 19# -qb, --quote_break: set quoted text break time (250) 20# -qe, --quote_emphasis: set quoted text emphasis level (moderate) 21# -hb, --heading_break: set heading text break time (4000) 22# -hd, --heading_difference: set heading text break difference (250) 23# -he, --heading_emphasis: set heading text emphasis level (strong) 24# -eb, --ellipsis_break: set ellipsis break time (1500) 25# -db, --dash_break: set dash break time (500) 26# -nb, --newline_break: set newline break time (1000) 27# -bs, --block_separator: set block separator (.) 28# -bl, --block_length: set block length (5000) 29# -ccf, --config_credentials_file: set google credentials path 30 31# Environment variables: 32$TTS_LOG # enable log (0) 33$TTS_OUTPUT # set output audio file (out.mp3) 34$TTS_TEXT # set input text file 35$TTS_RETRIES # set speech synthesis retries (8) 36$TTS_ACODEC # set acodec (copy) 37$TTS_AUDIO_ENCODING # set audio encoding (MP3) 38$TTS_AUDIO_FREQUENCY # set audio frequency/sample rate 39$TTS_LANGUAGE_CODE # set language code (en-US) 40$TTS_VOICE_NAME # set voice name 41$TTS_VOICE_GENDER # set voice gender (neutral) 42$TTS_VOICE_PITCH # set voice pitch change (0.0) 43$TTS_VOICE_RATE # set voice speaking rate (1.0) 44$TTS_VOICE_VOLUME # set voice volume gain in dB (0.0) 45$TTS_QUOTE_BREAK # set quoted text break time (250) 46$TTS_QUOTE_EMPHASIS # set quoted text emphasis level (moderate) 47$TTS_HEADING_BREAK # set heading text break time (4000) 48$TTS_HEADING_DIFFERENCE # set heading text break difference (250) 49$TTS_HEADING_EMPHASIS # set heading text emphasis level (strong) 50$TTS_ELLIPSIS_BREAK # set ellipsis break time (1500) 51$TTS_DASH_BREAK # set dash break time (500) 52$TTS_NEWLINE_BREAK # set newline break time (1000) 53$TTS_BLOCK_SEPARATOR # set block separator (.) 54$TTS_BLOCK_LENGTH # set block length (5000) 55$GOOGLE_APPLICATION_CREDENTIALS # set google credentials path
1const googletts = require('extra-googletts'); 2 3await googletts('out.mp3', 'I want to order a stuffed crust pizza'); 4// out.mp3 created (yay!) 5 6const fs = require('fs'); 7var speech = fs.readFileSync('speech.txt', 'utf8'); 8await googletts('speech.mp3', speech) 9// speech.mp3 created from text in speech.txt 10 11await googletts('out.mp3', 'Hello 911, my husband is in danger!', { 12 voice: {gender: 'FEMALE'} 13}); 14// out.mp3 created with female voice 15 16await googletts('out.mp3', 'Dead man walking.', { 17 voice: {name: 'en-US-Wavenet-B'}, log: true 18}); 19// out.mp3 created with different male voice (log enabled)
1const googletts = require('extra-googletts'); 2 3googletts(output, text, options={}) 4// output: output audio file 5// text: input text 6// options: given below 7// -> Promise <table of contents> 8 9// Default options: 10options = { 11 stdio: [0, 1, 2], // set child process stdio 12 log: false, // enable log 13 retries: 8, // set speech synthesis retries 14 acodec: 'copy', // set audio acodec 15 audio: { 16 encoding: 'MP3', // set audio encoding 17 frequency: 0, // set audio frequency/sample rate 18 }, 19 language: { 20 code: 'en-US' // set language code 21 }, 22 voice: { 23 name: null, // set voice name 24 gender: 'NEUTRAL' // set voice SSML gender 25 pitch: 0.0, // set voice pitch change 26 rate: 1.0, // set voice speaking rate 27 volume: 0.0, // set voice volume gain in dB 28 } 29 quote: { 30 break: 250, // set quoted text break time 31 emphasis: 'moderate' // set quoted text emphasis level 32 }, 33 heading: { 34 break: 4000, // set heading text break time 35 difference: 250, // set heading text break difference 36 emphasis: 'strong', // set heading text emphasis level 37 }, 38 ellipsis: { 39 break: 1500 // set ellipsis break time 40 }, 41 dash: { 42 break: 500 // set dash break time 43 }, 44 newline: { 45 break: 1000 // set newline break time 46 }, 47 block: { 48 separator: '.' // set block separator 49 length: 5000, // set block length 50 }, 51 config: { 52 credentialsFile: null // set path to credentials 53 }, 54 params: null // set synthesize speech parameters "directly" 55}
Do you need anything similar?
Suggestions are welcome. Please create an issue.
References: SSML, TTS voices, TTS client docs.
No vulnerabilities found.