https://github.com/lazauk/aoai-texttospeech-sdkv1
Text-to-Speech generation with Azure OpenAI TTS models, using both Python SDK and REST API.
https://github.com/lazauk/aoai-texttospeech-sdkv1
ai azure openai python-sdk rest-api text-to-speech tts
Last synced: 3 months ago
JSON representation
Text-to-Speech generation with Azure OpenAI TTS models, using both Python SDK and REST API.
- Host: GitHub
- URL: https://github.com/lazauk/aoai-texttospeech-sdkv1
- Owner: LazaUK
- License: mit
- Created: 2024-03-18T14:18:00.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-03-21T19:06:19.000Z (about 1 year ago)
- Last Synced: 2025-01-12T05:11:10.503Z (4 months ago)
- Topics: ai, azure, openai, python-sdk, rest-api, text-to-speech, tts
- Language: Jupyter Notebook
- Homepage:
- Size: 594 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Text-to-Speech (TTS) generation with Azure OpenAI TTS models
_tts-1_ and _tts-1-hd_ are TTS models from OpenAI, which can produce audio content based on your textual input (prompt). You will find a Jupyter notebook in this repo, that utilises Azure OpenAI deployment of tts-1 to generate MP3 audio for a given textual menu content.To build this demo, I used the latest version of OpenAI Python SDK - v1.x. To upgrade your _openai_ Python package, please use the following pip command:
```
pip install --upgrade openai
```## Table of contents:
- [Part 1: Configuring solution environment](https://github.com/LazaUK/AOAI-TextToSpeech-SDKv1#part-1-configuring-solution-environment)
- [Part 2: Generating speech through Python SDK](https://github.com/LazaUK/AOAI-TextToSpeech-SDKv1#part-2-generating-speech-through-python-sdk)
- [Part 3: Generating speech through REST API](https://github.com/LazaUK/AOAI-TextToSpeech-SDKv1#part-3-generating-speech-through-rest-api)## Part 1: Configuring solution environment
1. To use Azure OpenAI backend, assign the API endpoint name, key and version, along with the Azure OpenAI deployment name of TTS model to **AZURE_OPENAI_API_BASE**, **AZURE_OPENAI_API_KEY**, **AZURE_OPENAI_API_VERSION** and **AZURE_OPENAI_API_DEPLOY_TTS** environment variables respectively.

2. Install the required Python packages, by using the **pip** command and the provided requirements.txt file.
```
pip install -r requirements.txt
```## Part 2: Generating speech through Python SDK
> Note: detailed description on the code logic to be provided soon..## Part 3: Generating speech through REST API
> Note: detailed description on the code logic to be provided soon..