Skip to content

Mortezanavidi/alice-tts

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Alice-tts

Alice-TTS is a text-to-speech (TTS) module of the AliceAI project, Alice-TTS has many modules inside itself but as of now, it's only leveraging the Edge TTS engine. It provides RESTful APIs to generate and stream TTS audio with customizable parameters like speech rate and volume.

Features

  • Generate TTS Audio: Convert text to speech and return the audio file.
  • Stream TTS Audio: Stream the TTS audio in real-time.
  • Customizable Speech: Adjust speech rate and volume (e.g., "-50%", "+20%").

Installation

With Docker

  1. Clone the repository:

    git clone https://github.com/yourusername/alice-tts.git
    cd alice-tts
  2. Build and run:

    cd docker
    docker-compose up --build
    
  3. Access: The API will be available at http://localhost:5500.

Without Docker

  1. Install dependencies:

    pip install -r requirements.txt
  2. Run the app:

    python main.py
  3. Access: The API will be available at http://localhost:5500.

API Endpoints

1. Generate TTS (POST /edgetts/gen)

Convert text to speech and download the audio.

Example Request:

curl -X POST "http://localhost:5500/edgetts/gen" \
-H "Content-Type: application/json" \
-d '{"message": "Hello World!", "voice": "en-GB-SoniaNeural"}' \
--output output.mp3

2. Stream TTS (POST /edgetts/stream)

Stream TTS audio without downloading the full file.

Example Request:

curl -X POST "http://localhost:5500/edgetts/stream" \
-H "Content-Type: application/json" \
-d '{"message": "Hello World!", "voice": "en-GB-SoniaNeural"}' \
--output output.mp3

Optional Parameters

  • rate: Speed adjustment (e.g., "-50%", "+20%").
  • volume: Volume adjustment (e.g., "-50%", "+20%").

About

TTS side of AliceAI

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages