Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add TTS FastAPI Endpoint and run-api.sh Script #950

Closed
wants to merge 19 commits into from

Conversation

m-aliabbas
Copy link

Pull Request Title

Add TTS FastAPI Endpoint and run-api.sh Script


Pull Request Description

Summary

This PR introduces:

  1. A new TTS (Text-to-Speech) endpoint in the FastAPI application.
  2. A run-api.sh script to streamline the API server startup process.

Changes Made

  • Added a new FastAPI endpoint: /tts.
    • Accepts input text as a JSON payload.
    • Returns a generated audio file (e.g., .wav or .mp3) as a response.
  • Added the run-api.sh script to simplify running the FastAPI server with uvicorn.

Files Added/Modified

  1. app.py:
    • Implemented the /tts endpoint.
    • Example usage:
      POST /tts
      {
        "text": "Hello, this is a TTS demo."
      }
      Response: An audio file generated from the input text.
  2. run-api.sh:
    • A script to run the FastAPI server.
    • Example usage:
      ./run-api.sh

How to Test

  1. Start the FastAPI server:
    ./run-api.sh
  2. Send a POST request to the /tts endpoint:
    curl -X POST http://127.0.0.1:8000/tts \
         -H "Content-Type: application/json" \
         -d '{"text": "Test text for TTS"}' --output output.wav
  3. Verify that the output.wav file is generated and playable.

Checklist

  • Implemented /tts endpoint.
  • Added run-api.sh for easy server startup.
  • Tested the /tts endpoint functionality locally.
  • Updated documentation (if applicable).

Screenshots/Demo

(Optional: Add screenshots or attach an audio file showcasing the functionality.)


Request for Review

Please review the following:

  • The accuracy of the /tts endpoint implementation.
  • The usability and functionality of the run-api.sh script.
  • Any edge cases or additional improvements.

@AznamirWoW
Copy link
Contributor

You may want to do a re-do of this, because it is quite a mess.

@blaisewf blaisewf self-requested a review January 14, 2025 06:38
@blaisewf blaisewf closed this Jan 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants