Socket
Socket
Sign inDemoInstall

google-tts.js

Package Overview
Dependencies
3
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    google-tts.js

A wrapper for the Google Text To Speech API with various features.


Version published
Weekly downloads
7
increased by40%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

google-tts.js

A wrapper for the Google Text To Speech API with various features.

github
github

NPM

Installation

You can download this package from npmjs. With command:
npm i google-tts.js

Example

getUrl

const GoogleTts = require("google-tts.js") 

/*
GoogleTts.getUrl("text", "language codes")
*/
GoogleTts.getUrl("abc", "id").then(console.log)

Response

{
  success: true,
  url: 'https://translate.google.com/translate_tts?ie=UTF-8&q=abc&tl=id&total=1&idx=0&textlen=24&client=tw-ob&prev=input&ttsspeed=1'
}

saveFile

const GoogleTts = require("google-tts.js")

/*
GoogleTts.saveFile("text", "language codes", "the location that will be filled by the result mp3. (optional)")
*/
GoogleTts.saveFile("abc", "id", "./src/audio.mp3").then(console.log)



/* console log:
{ success: true, message: 'Saved audio in ./src/audio.mp3' }
*/

/* and
add the resulting file to the location you wrote earlier.
*/

Response

 console log:
{ success: true, message: 'Saved audio in ./src/audio.mp3' }


 and add the resulting file to the location you wrote earlier.

Events

Saved with .mp3 Result

GoogleTts.saveFile("text", "language codes", "the location that will be filled by the result mp3. (optional)")

Get the result url

GoogleTts.getUrl("text", "language codes")

Keywords

FAQs

Last updated on 26 Feb 2022

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc