This is a simple Express.js server that uses the node-gtts
(Google Text-to-Speech) library to convert text to speech.
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.
- Node.js
- npm
- Clone the repository:
git clone https://github.com/yourusername/your-repo-name.git
- Navigate into the cloned repository:
cd your-repo-name
- Install the dependencies:
npm install
npm run build && npm run start
The server runs on port 3000 by default, but you can set a different port by setting the PORT environment variable.
To convert text to speech, make a GET request to the root (/) of the server with the following query parameters:
text: The text to convert to speech. locale: The locale to use for the speech (default is 'en'). Example:
http://localhost:3000/?text=Hello%20World&locale=en
This will return an audio file of the text "Hello World" spoken in English.