Coder Social home page Coder Social logo

fonckchain / text2voice Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 36 KB

Node.js application that converts text to voice using Google Cloud Text-to-Speech API. Ideal for generating audio for videos, presentations, and more.

JavaScript 100.00%
ai google-cloud nodejs ssml text-to-speech

text2voice's Introduction

Google Cloud

Text-to-Speech Application

This application uses Google's Text-to-Speech API to convert text into speech

๐Ÿš€ Features ๐Ÿš€

  • Convert any text into speech
  • Save the generated speech as an MP3 file
  • Supports multiple voice profiles for customization
  • Easy to use and integrate into your projects

๐Ÿ› ๏ธ Setup ๐Ÿ› ๏ธ

  1. Make sure you have Node.js installed on your system. If you don't have it installed, you can download it from the official website.
  2. Clone this repository to your local machine.
  3. Run npm install to install the necessary dependencies. This application uses the following Node.js packages:
    • @google-cloud/text-to-speech: The Google Text-to-Speech API client library for Node.js.
    • dotenv: A module that loads environment variables from a .env file into process.env.
  4. Create a .env file in the root directory and add your Google Cloud credentials. You need to set the GOOGLE_APPLICATION_CREDENTIALS variable to the path of your Google Cloud service account key JSON file. For example:
    GOOGLE_APPLICATION_CREDENTIALS="/path/to/your/service-account-file.json"
    

๐Ÿ“ How to Use ๐Ÿ“

  1. Create a input.ssml file located in the root folder.
  2. Write your text in the input.ssml file. You can use SSML tags for more control over the speech output.
  3. Run node app.js to generate the speech.
  4. The generated speech will be saved as an MP3 file in the output directory.

๐ŸŽ›๏ธ Customization ๐ŸŽ›๏ธ

You can customize the voice profile used for the speech by editing the voiceProfiles.js file. Each voice profile is an object with the following properties:

  • languageCode: The language of the voice.
  • ssmlGender: The gender of the voice.
  • name: The name of the voice.

๐Ÿ“š Resources ๐Ÿ“š

๐Ÿ“ƒ License ๐Ÿ“ƒ

This project is licensed under the MIT License.

text2voice's People

Contributors

fonckchain avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.