piducancore / serverless-tts-api

This is a minimal example of a serverless Text to Speech API using IBM Watson and Vercel.

Home Page:https://serverless-tts.vercel.app/api/demo?voice=es-LA_SofiaV3Voice&text=hola%20mundo

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

serverless-tts-api

This is a minimal example of a serverless Text to Speech API using IBM Watson and Vercel.

Usage

The API endpoint is at /api/demo and accepts two parameters: text and voice.

  • text (required): String

    Example: Hello world! or any string of text you want to turn into speech.

  • voice (optional): String

    Example: en-US_MichaelV3Voice (default) or any of the Allowable values listed here.

A sample query url would look like this: /api/demo?text="say something"

Run your own

First you need to register at IBM Cloud, create a new Text to Speech resource and take note of your API_KEY and SERVICE_URL.

Install the Vercel CLI if you haven't already:

yarn global add vercel

Create an .env file like the following and fill it using your Text to Speech resource credentials (your API_KEY and SERVICE_URL):

API_KEY=YOUR API KEY
SERVICE_URL=YOUR SERVICE URL

Finally run the project:

vercel dev

This will start a local development server at http://localhost:3000 and you can query the API at /api/demo?text="say something".

Deploy to Vercel

Use the button below and fill the environment variables with your API_KEY and SERVICE_URL.

Deploy with Vercel

About

This is a minimal example of a serverless Text to Speech API using IBM Watson and Vercel.

https://serverless-tts.vercel.app/api/demo?voice=es-LA_SofiaV3Voice&text=hola%20mundo


Languages

Language:JavaScript 100.0%