Git Product home page Git Product logo

habitual69 / speakify-api Goto Github PK

View Code? Open in Web Editor NEW
2.0 1.0 1.0 10 KB

Speakify is a simple API that generates audio and subtitles from text using text-to-speech (TTS) technology. It provides an easy-to-use interface to convert text into audio files (in MP3 format) and corresponding subtitle files (in VTT format) with various available voices.

Home Page: https://speakify-api.vercel.app

Python 100.00%
fastapi python text-to-speech tts-api vtt-subtitles

speakify-api's Introduction

Speakify API

Speakify is a simple API that generates audio and subtitles from text using text-to-speech (TTS) technology. It provides an easy-to-use interface to convert text into audio files (in MP3 format) and corresponding subtitle files (in VTT format) with various available voices.

Usage

Base URL

The base URL for the API is https://speakify-api.vercel.app/api/v1.

Endpoints

  • POST /api/v1/convert: Generates audio and subtitles from input text.

    • Parameters:
      • input_text: The text to convert into audio and subtitles.
      • voice: The voice to use for TTS. Available voices can be obtained from the /api/v1/voices endpoint.
      • output_name: The desired name for the output audio and subtitle files.
    • Response: JSON object containing the URLs of the generated audio and subtitle files.
    • Use: Use this endpoint to convert text into audio and subtitles. This is useful for generating audio files with corresponding subtitles for various purposes such as video production, accessibility features, and language learning applications.
  • GET /api/v1/audio/{output_file}: Retrieves the generated audio file.

    • Parameters:
      • output_file: The name of the audio file generated from the conversion.
    • Response: The audio file in MP3 format.
    • Use: Use this endpoint to fetch the generated audio file. This is useful for downloading the audio file for playback or integration into other applications.
  • GET /api/v1/subtitles/{output_file}: Retrieves the generated subtitle file.

    • Parameters:
      • output_file: The name of the subtitle file generated from the conversion.
    • Response: The subtitle file in VTT format.
    • Use: Use this endpoint to fetch the generated subtitle file. This is useful for downloading the subtitle file for use in video editing software or for displaying subtitles alongside the audio.
  • GET /api/v1/voices: Retrieves the list of available voices for TTS.

    • Response: List of available voices with their names and language codes.
    • Use: Use this endpoint to get a list of available voices for text-to-speech conversion. This is useful for providing voice selection options to users or programmatically selecting voices based on language or preference.

Example

# Request
curl -X POST https://your-domain.com/api/v1/convert \
  -d 'input_text=Hello, how are you?' \
  -d 'voice=en-US-JennyNeural' \
  -d 'output_name=output'

# Response
{
  "audio_file": "output.mp3",
  "subtitle_file": "output.vtt"
}

Installation

  1. Clone this repository:
git clone https://github.com/habitual69/speakify-api.git
  1. Install dependencies:
cd speakify-api
pip install -r requirements.txt
  1. Run the application:
uvicorn main:app --host 0.0.0.0 --port 8000

Contributing

Contributions are welcome! Please feel free to submit a pull request or open an issue for any improvements or bug fixes.

License

This project is licensed under the MIT License - see the LICENSE file for details.

speakify-api's People

Contributors

habitual69 avatar

Watchers

 avatar

Forkers

fsmdeveloper

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.