From df446fa8ac5cc5b4150a6add7bf0797719fb8b63 Mon Sep 17 00:00:00 2001 From: Travis Van Nimwegen Date: Sun, 20 Oct 2024 15:14:57 -0400 Subject: [PATCH 1/4] Update openai-edge-tts-integration.md --- .../openai-edge-tts-integration.md | 35 +++++++++++++++---- 1 file changed, 28 insertions(+), 7 deletions(-) diff --git a/docs/tutorials/integrations/openai-edge-tts-integration.md b/docs/tutorials/integrations/openai-edge-tts-integration.md index 28db49f..5e2e72f 100644 --- a/docs/tutorials/integrations/openai-edge-tts-integration.md +++ b/docs/tutorials/integrations/openai-edge-tts-integration.md @@ -3,7 +3,7 @@ sidebar_position: 18 title: "Edge TTS" --- -# Integrating `openai-edge-tts` with Open WebUI +# Integrating `openai-edge-tts` 🗣️ with Open WebUI ## What is `openai-edge-tts`, and how is it different from `openedai-speech`? @@ -13,7 +13,7 @@ Similar to [openedai-speech](https://github.com/matatonic/openedai-speech), [ope `openai-edge-tts` is a simpler option that uses a Python package called `edge-tts` to generate the audio. -`edge-tts` leverages the Edge browser's free "Read Aloud" feature to emulate a request to Microsoft / Azure in order to receive very high quality text-to-speech for free. +`edge-tts` ([repo](https://github.com/rany2/edge-tts)) leverages the Edge browser's free "Read Aloud" feature to emulate a request to Microsoft / Azure in order to receive very high quality text-to-speech for free. ## Requirements @@ -21,7 +21,7 @@ Similar to [openedai-speech](https://github.com/matatonic/openedai-speech), [ope - Open WebUI running - ffmpeg installed (required for audio format conversion and playback speed adjustments) -## Quick start +## ⚡️ Quick start The simplest way to get started without having to configure anything is to run the command below @@ -47,9 +47,15 @@ The default API key is the string `your_api_key_here`. You do not have to change See the [Usage](#usage) section for request examples. +# Please ⭐️ star the repo on GitHub if you find [OpenAI Edge TTS](https://github.com/travisvn/openai-edge-tts) useful + +:::tip +You can define the environment variables directly in the `docker run` command. See [Quick Config for Docker](#-quick-config-for-docker) below. +::: + ## Alternative Options -### Running with Python +### 🐍 Running with Python If you prefer to run this project directly with Python, follow these steps to set up a virtual environment, install dependencies, and start the server. @@ -176,10 +182,25 @@ curl -X POST http://localhost:5050/v1/audio/speech \ ##### Additional Endpoints -- **GET /v1/models**: Lists available TTS models. -- **GET /v1/voices**: Lists `edge-tts` voices for a given language / locale. -- **GET /v1/voices/all**: Lists all `edge-tts` voices, with language support information. +- **POST/GET /v1/models**: Lists available TTS models. +- **POST/GET /v1/voices**: Lists `edge-tts` voices for a given language / locale. +- **POST/GET /v1/voices/all**: Lists all `edge-tts` voices, with language support information. +## 🐳 Quick Config for Docker + +You can configure the environment variables in the command used to run the project + +```bash +docker run -d -p 5050:5050 \ + -e API_KEY=your_api_key_here \ + -e PORT=5050 \ + -e DEFAULT_VOICE=en-US-AndrewNeural \ + -e DEFAULT_RESPONSE_FORMAT=mp3 \ + -e DEFAULT_SPEED=1.0 \ + -e DEFAULT_LANGUAGE=en-US \ + -e REQUIRE_API_KEY=True \ + travisvn/openai-edge-tts:latest +``` ## Additional Resources From 4e1c164fab225293b275f1f8612a512d6a9fce50 Mon Sep 17 00:00:00 2001 From: Travis Van Nimwegen Date: Sun, 20 Oct 2024 19:38:01 +0000 Subject: [PATCH 2/4] Fix Prettier check failure --- docs/tutorials/_category_.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/tutorials/_category_.json b/docs/tutorials/_category_.json index 6bd9d6c..71b0705 100644 --- a/docs/tutorials/_category_.json +++ b/docs/tutorials/_category_.json @@ -4,4 +4,4 @@ "link": { "type": "generated-index" } -} \ No newline at end of file +} From 6699e08a1821718717337ea1c32c413b7bb7170f Mon Sep 17 00:00:00 2001 From: Travis Van Nimwegen Date: Sat, 26 Oct 2024 18:05:32 -0400 Subject: [PATCH 3/4] Update openai-edge-tts-integration.md to add link to voice sample page --- docs/tutorials/integrations/openai-edge-tts-integration.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/docs/tutorials/integrations/openai-edge-tts-integration.md b/docs/tutorials/integrations/openai-edge-tts-integration.md index 5e2e72f..5ad16d9 100644 --- a/docs/tutorials/integrations/openai-edge-tts-integration.md +++ b/docs/tutorials/integrations/openai-edge-tts-integration.md @@ -137,6 +137,10 @@ Generates audio from the input text. Available parameters: - **response_format** (string): Audio format. Options: `mp3`, `opus`, `aac`, `flac`, `wav`, `pcm` (default: `mp3`). - **speed** (number): Playback speed (0.25 to 4.0). Default is `1.0`. +:::tip +You can browse available voices and listen to sample previews at [tts.travisvn.com](tts.travisvn.com) +::: + Example request with `curl` and saving the output to an mp3 file: ```bash @@ -206,3 +210,6 @@ docker run -d -p 5050:5050 \ For more information on `openai-edge-tts`, you can visit the [GitHub repo](https://github.com/travisvn/openai-edge-tts) + +## 🎙️ Voice Samples +[Play voice samples and see all available Edge TTS voices](https://tts.travisvn.com/) From 974f2c6fa8fd6158c66b01d628e575552c11d3b5 Mon Sep 17 00:00:00 2001 From: Travis Van Nimwegen Date: Sat, 26 Oct 2024 18:09:21 -0400 Subject: [PATCH 4/4] Update openai-edge-tts-integration.md to fix link url --- docs/tutorials/integrations/openai-edge-tts-integration.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/tutorials/integrations/openai-edge-tts-integration.md b/docs/tutorials/integrations/openai-edge-tts-integration.md index 5ad16d9..7e254f6 100644 --- a/docs/tutorials/integrations/openai-edge-tts-integration.md +++ b/docs/tutorials/integrations/openai-edge-tts-integration.md @@ -138,7 +138,7 @@ Generates audio from the input text. Available parameters: - **speed** (number): Playback speed (0.25 to 4.0). Default is `1.0`. :::tip -You can browse available voices and listen to sample previews at [tts.travisvn.com](tts.travisvn.com) +You can browse available voices and listen to sample previews at [tts.travisvn.com](https://tts.travisvn.com) ::: Example request with `curl` and saving the output to an mp3 file: