Skip to content

MidSpike/google-translate-tts

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

google-translate-tts

Installation

npm i github:MidSpike/google-translate-tts

Usage

const fs = require('node:fs');

const { GoogleTranslateTTS } = require('google-translate-tts');

async function main() {
    // creates an instance of a GoogleTranslateTTS
    const gt_tts = new GoogleTranslateTTS({
        language: 'en-us',
        text: 'Hello world!',
    });

    // creates a readable stream from the GoogleTranslateTTS instance
    const gt_tts_stream = await gt_tts.stream();

    // saves the readable stream to an mp3 file
    gt_tts_stream.pipe(fs.createWriteStream('./test.mp3'));
}

main();

Legal

Copyright MIT License

About

Create TTS audio streams using the Google Translate API

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •