This repository features a Gradio interface designed to leverage the OpenAI Text-To-Speech (TTS) API. The interface lets users create speech from provided text using different models and voice options.
To begin using this interface, follow these steps:
Clone this repository to your local machine.
git clone https://github.com/arham-kk/openai-tts.git
cd openai-ttsInstall the required dependencies.
pip install -r requirements.txtEnsure that the following dependencies are installed:
gradioopenaiYou can install them using:
pip install -r requirements.txttts-1 or tts-1-hd) and a voice option from (alloy, echo, fable, onyx, nova, shimmer).The code is organized into two main components:
tts: This module contains the function responsible for interacting with the OpenAI API to generate speech.gradio_interface: This module sets up the Gradio interface, including input fields, buttons, and the speech output.Follow these steps to set up and run the Gradio interface:
Obtain your OpenAI API key.
Run the Gradio interface.
python app.pyInput your text and choose the desired model and voice options.
Click the "Generate" button or press Enter to generate speech.
This code is provided under the MIT License. Feel free to modify and distribute it as needed.