Socket
Socket
Sign inDemoInstall

adanjz-googletts

Package Overview
Dependencies
92
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    adanjz-googletts

A simple Node.js module that converts a given text into speech using the Google Cloud Text-to-Speech API.


Version published
Weekly downloads
1
Maintainers
1
Created
Weekly downloads
 

Readme

Source

Google Cloud Text-to-Speech API Wrapper

A simple Node.js module that converts a given text into speech using the Google Cloud Text-to-Speech API.

Prerequisites

  1. Node.js installed.
  2. A Google Cloud account and a service account key with Text-to-Speech permissions.
  3. Set up the Google Cloud SDK on your local machine.

Installation

  1. Clone this repository:
git clone https://github.com/adanzweig/nodejs-googletts.git
  1. Navigate to the project directory:
cd nodejs-googletts
  1. Install the dependencies:
npm install
  1. Set up your Google Cloud credentials:

Export your service account key:

export GOOGLE_APPLICATION_CREDENTIALS="<path_to_service_account_key.json>"

Replace <path_to_service_account_key.json> with the path to your Google Cloud service account key.

Usage

Here's how to use the transformTextToSpeachWithGoogle function:

const { transformTextToSpeachWithGoogle } = require('./path_to_your_file');

(async () => {
    const outputFile = await transformTextToSpeachWithGoogle('Your text here', 'output.mp3');
    console.log(`Audio saved to: ${outputFile}`);
})();

Replace 'Your text here' with the text you want to convert and 'output.mp3' with your desired output file name.

Contributing

Contributions are welcome. Please submit a pull request or open an issue to discuss the changes you'd like to make.

FAQs

Last updated on 11 Oct 2023

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