Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4f80b39cd0 | ||
|
|
332582baea | ||
|
|
2bd7ebc514 | ||
|
|
7718bfd3ea | ||
|
|
002c5ad9db | ||
|
|
2c14847708 | ||
|
|
3647d69007 | ||
|
|
abaa56e8f4 | ||
|
|
d0dc9f3212 | ||
|
|
67dcc411ad | ||
|
|
b11a087dc8 | ||
|
|
e068115eef | ||
|
|
0ec580539a | ||
|
|
e9feae12ad | ||
|
|
e183e3a7bb | ||
|
|
67d2b1c5ea | ||
|
|
f3b44424ef | ||
|
|
3b5c4b9b68 | ||
|
|
e452a926f2 | ||
|
|
b28ecaf43e | ||
|
|
ba1328311c | ||
|
|
9e6b9396bc | ||
|
|
2e40db5fe5 | ||
|
|
720bf8697f | ||
|
|
1893d1a130 | ||
|
|
8472baf031 | ||
|
|
6cab618706 | ||
|
|
ebf3b362f7 | ||
|
|
2dd303f53c | ||
|
|
df69fb0b07 | ||
|
|
a0d9771fa6 | ||
|
|
a71c46bb98 | ||
|
|
995f317b4f | ||
|
|
6ef2de2923 | ||
|
|
37c4e86566 | ||
|
|
11071b279b | ||
|
|
5ab7463f35 | ||
|
|
74c9238e3a | ||
|
|
e874e46304 | ||
|
|
b32df6ac15 | ||
|
|
b76dd3561f | ||
|
|
60bfbdcabd | ||
|
|
c128d0851b | ||
|
|
2f3b7762e4 | ||
|
|
0e594f5098 | ||
|
|
14151d4dda | ||
|
|
94ab21fb15 | ||
|
|
1acac3d6c6 | ||
|
|
95ec2dc9d2 | ||
|
|
6b93eb6c1e | ||
|
|
838578a042 | ||
|
|
2f689f0438 | ||
|
|
022025ded6 | ||
|
|
320a7a6aba | ||
|
|
fa82870883 | ||
|
|
a094d4f9da | ||
|
|
bb028af694 | ||
|
|
aeb225ec7c | ||
|
|
06a632459e | ||
|
|
221efbddb4 | ||
|
|
e81a88938a | ||
|
|
65e257077c | ||
|
|
95659d5b7a | ||
|
|
ff57270286 | ||
|
|
4fc61ba99a | ||
|
|
3cd22081f4 | ||
|
|
d20ee95e67 | ||
|
|
cd47f6b123 | ||
|
|
53a2d0a65e |
No files matched your search
@@ -1,6 +1,7 @@
|
|||||||
voices/*.*
|
voices/*.*
|
||||||
models/*.*
|
models/*.*
|
||||||
outputs/*.*
|
outputs/*.*
|
||||||
|
finetune/*.*
|
||||||
config.json
|
config.json
|
||||||
confignew.json
|
confignew.json
|
||||||
models.json
|
models.json
|
||||||
|
|||||||
@@ -0,0 +1,9 @@
|
|||||||
|
{
|
||||||
|
"files.associations": {
|
||||||
|
"*.html": "jinja-html"
|
||||||
|
},
|
||||||
|
"emmet.includeLanguages": {
|
||||||
|
"jinja-html": "html",
|
||||||
|
"jinja2": "html"
|
||||||
|
},
|
||||||
|
}
|
||||||
@@ -1,17 +1,18 @@
|
|||||||
# AllTalk TTS
|
# AllTalk TTS
|
||||||
AllTalk is an updated version of the Coqui_tts extension for Text Generation web UI. Features include:
|
AllTalk is an updated version of the Coqui_tts extension for Text Generation web UI. Features include:
|
||||||
|
|
||||||
|
- **Can be run as a** [standalone](https://github.com/erew123/alltalk_tts?#-running-alltalk-as-a-standalone-app) **or part of** [Text-generation-webui](https://github.com/erew123/alltalk_tts?#-installation-on-text-generation-web-ui)
|
||||||
|
- **Model Finetuning:** Train the model specifically on a voice of your choosing for better reproduction.
|
||||||
|
- **Local/Custom models:** Use any of the XTTSv2 models (API Local and XTTSv2 Local).
|
||||||
|
- **Bulk TTS Generator/Editor:** Generate hours of TTS into one big file or have something read back to you.
|
||||||
|
- **DeepSpeed:** A 3-4x performance boost generating TTS. [DeepSpeed Windows/Linux Instructions](https://github.com/erew123/alltalk_tts?tab=readme-ov-file#deepspeed-installation-options) [Screenshot](https://github.com/erew123/alltalk_tts/assets/35898566/548619c8-5f1b-47d0-a73d-54d2fee3f3db)
|
||||||
|
- **Low VRAM mode:** Great for people with small GPU memory or if your VRAM is filled by your LLM. [Screenshot](https://github.com/erew123/alltalk_tts#screenshots)
|
||||||
- **Custom Start-up Settings:** Adjust your default start-up settings. [Screenshot](https://github.com/erew123/alltalk_tts#screenshots)
|
- **Custom Start-up Settings:** Adjust your default start-up settings. [Screenshot](https://github.com/erew123/alltalk_tts#screenshots)
|
||||||
- **Narrarator:** Use different voices for main character and narration. [Example Narration](https://vocaroo.com/18nrv7FR6wuA)
|
- **Narrarator:** Use different voices for main character and narration. [Example Narration](https://vocaroo.com/18nrv7FR6wuA)
|
||||||
- **Low VRAM mode:** Great for people with small GPU memory or if your VRAM is filled by your LLM. [Screenshot](https://github.com/erew123/alltalk_tts#screenshots)
|
|
||||||
- **DeepSpeed:** A 3-4x performance boost generating TTS. [DeepSpeed Windows/Linux Instructions](https://github.com/erew123/alltalk_tts?tab=readme-ov-file#deepspeed-installation-options) [Screenshot](https://github.com/erew123/alltalk_tts/assets/35898566/548619c8-5f1b-47d0-a73d-54d2fee3f3db)
|
|
||||||
- **Local/Custom models:** Use any of the XTTSv2 models (API Local and XTTSv2 Local).
|
|
||||||
- **Optional wav file maintenance:** Configurable deletion of old output wav files. [Screenshot](https://github.com/erew123/alltalk_tts#screenshots)
|
- **Optional wav file maintenance:** Configurable deletion of old output wav files. [Screenshot](https://github.com/erew123/alltalk_tts#screenshots)
|
||||||
- **Finetuning** Train the model specifically on a voice of your choosing for better reproduction.
|
|
||||||
- **Documentation:** Fully documented with a built in webpage. [Screenshot](https://github.com/erew123/alltalk_tts#screenshots)
|
- **Documentation:** Fully documented with a built in webpage. [Screenshot](https://github.com/erew123/alltalk_tts#screenshots)
|
||||||
- **Console output** Clear command line output for any warnings or issues.
|
- **Console output:** Clear command line output for any warnings or issues.
|
||||||
- **API Suite and 3rd Party support via JSON calls** Can be used with 3rd party applications via JSON calls.
|
- **API Suite and 3rd Party support via JSON calls:** Can be used with 3rd party applications via JSON calls.
|
||||||
- **Can be run as a standalone app** Not just inside of text-generation-webui.
|
|
||||||
|
|
||||||
## Index
|
## Index
|
||||||
|
|
||||||
@@ -22,13 +23,13 @@ AllTalk is an updated version of the Coqui_tts extension for Text Generation web
|
|||||||
- ⚫ [Finetuning a model](https://github.com/erew123/alltalk_tts?#-finetuning-a-model)
|
- ⚫ [Finetuning a model](https://github.com/erew123/alltalk_tts?#-finetuning-a-model)
|
||||||
- 🔵🟢🟡 [DeepSpeed Installation (Windows & Linux)](https://github.com/erew123/alltalk_tts?#-deepspeed-installation-options)
|
- 🔵🟢🟡 [DeepSpeed Installation (Windows & Linux)](https://github.com/erew123/alltalk_tts?#-deepspeed-installation-options)
|
||||||
- 🟦 [Running AllTalk as a standalone app](https://github.com/erew123/alltalk_tts?#-running-alltalk-as-a-standalone-app)
|
- 🟦 [Running AllTalk as a standalone app](https://github.com/erew123/alltalk_tts?#-running-alltalk-as-a-standalone-app)
|
||||||
|
- ⬜ [AllTalk TTS Generator](https://github.com/erew123/alltalk_tts?#-alltalk-tts-generator)
|
||||||
- 🟠 [API Suite and JSON-CURL](https://github.com/erew123/alltalk_tts?#-api-suite-and-json-curl)
|
- 🟠 [API Suite and JSON-CURL](https://github.com/erew123/alltalk_tts?#-api-suite-and-json-curl)
|
||||||
- 🔴 [Future to-do list & Upcoming updates](https://github.com/erew123/alltalk_tts?#-future-to-do-list)
|
- 🔴 [Future to-do list & Upcoming updates](https://github.com/erew123/alltalk_tts?#-future-to-do-list)
|
||||||
|
|
||||||
#### Updates
|
## 🔄 Updates
|
||||||
Dec 25th - Applied a small update to avoid a possible race condition on file naming with small sentences when generating narrator/character speech. Please update if you are experiencing missing small bits of missing audio on narrator/character.
|
Please check the below link to find a list of all recent updates and changes.
|
||||||
|
#### 🔄 **Updates list & bug fixes list** can be found [here](https://github.com/erew123/alltalk_tts/issues/25)
|
||||||
#### 🔄 **Minor updates/bug fixes list** can be found [here](https://github.com/erew123/alltalk_tts/issues/25)
|
|
||||||
|
|
||||||
## 🟩 Installation on Text generation web UI
|
## 🟩 Installation on Text generation web UI
|
||||||
This has been tested on the current Dec 2023 release of Text generation webUI. If you have not updated it for a while, you may wish to update Text generation webUI, [instructions here](https://github.com/oobabooga/text-generation-webui?tab=readme-ov-file#how-to-install)
|
This has been tested on the current Dec 2023 release of Text generation webUI. If you have not updated it for a while, you may wish to update Text generation webUI, [instructions here](https://github.com/oobabooga/text-generation-webui?tab=readme-ov-file#how-to-install)
|
||||||
@@ -70,17 +71,20 @@ Once the extension is loaded, please find all documentation and settings on the
|
|||||||
**Where to find voices** https://aiartes.com/voiceai or https://commons.wikimedia.org/ or interviews on youtube etc. Instructions on how to cut down and prepare a voice sample are within the built in documentation.
|
**Where to find voices** https://aiartes.com/voiceai or https://commons.wikimedia.org/ or interviews on youtube etc. Instructions on how to cut down and prepare a voice sample are within the built in documentation.
|
||||||
|
|
||||||
#### 🟩 The one thing I cant easily work around
|
#### 🟩 The one thing I cant easily work around
|
||||||
Narrator function specific - With a RP chat with your AI, **on your character card** `parameters menu` > `character tab` > `greeting` make sure that anything in there that is the **narrator is in asterisks** and anything **spoken is in double quotes**, then hit the `save` (💾) button. Greeting paragraphs/sentences are handled differently from how the AI sends text and so its difficut to account for them both.
|
Messages intended for the Narrator should be enclosed in asterisks `*` and those for the character inside quotation marks `"`. However, AI systems often deviate from these rules, resulting in text that is neither in quotes nor asterisks. Sometimes, text may appear with only a single asterisk, and AI models may vary their formatting mid-conversation. For example, they might use asterisks initially and then switch to unmarked text. A properly formatted line should look like this:
|
||||||
|
|
||||||
I could force a delimeter in at this stage, but I know it would/may affect things further down the line in the chat and I need a good think about that before just making a change. This issue **only** affects the greeting card/start of conversation and the "example" card that comes with text-generation-webui suffers this issue (if you want to try it for yourself). So you would put double quotes around like this (from the example card):
|
`"`Hey! I'm so excited to finally meet you. I've heard so many great things about you and I'm eager to pick your brain about computers.`"` `*`She walked across the room and picked up her cup of coffee`*`
|
||||||
|
|
||||||
`"`*Hey! I'm so excited to finally meet you. I've heard so many great things about you and I'm eager to pick your brain about computers. I'm sure you have a wealth of knowledge that I can learn from.*`"`
|
Most narrator/character systems switch voices upon encountering an asterisk or quotation marks, which is somewhat effective. AllTalk has undergone several revisions in its sentence splitting and identification methods. While some irregularities and AI deviations in message formatting are inevitable, any line beginning or ending with an asterisk should now be recognized as Narrator dialogue. Lines enclosed in double quotes are identified as Character dialogue. For any other text, you can choose how AllTalk handles it: whether it should be interpreted as Character or Narrator dialogue (most AI systems tend to lean more towards one format when generating text not enclosed in quotes or asterisks).
|
||||||
|
|
||||||
|
With improvements to the splitter/processor, I'm confident it's functioning well. You can monitor what AllTalk identifies as Narrator lines on the command line and adjust its behavior if needed (Text Not Inside - Function).
|
||||||
|
|
||||||
## 🟪 Updating
|
## 🟪 Updating
|
||||||
This is pretty much a repeat of the installation process.
|
This is pretty much a repeat of the installation process.
|
||||||
|
|
||||||
1) In a command prompt/terminal window you need to move into your Text generation webUI folder:<br><br>
|
1) In a command prompt/terminal window you need to move into your Text generation webUI folder:<br><br>
|
||||||
`cd text-generation-webui`
|
`cd text-generation-webui` and start the Python environment for your OS with whichever **one** of the below is correct for your OS:<br><br>
|
||||||
|
`cmd_windows.bat`, `./cmd_linux.sh`, `cmd_macos.sh` or `cmd_wsl.bat`<br>
|
||||||
|
|
||||||
2) Move into your extensions and alltalk_tts folder:<br><br>
|
2) Move into your extensions and alltalk_tts folder:<br><br>
|
||||||
`cd extensions` then `cd alltalk_tts`
|
`cd extensions` then `cd alltalk_tts`
|
||||||
@@ -102,6 +106,7 @@ I did leave a mistake in the `/extensions/alltalk_tts/.gitignore` file at one po
|
|||||||
voices/*.*
|
voices/*.*
|
||||||
models/*.*
|
models/*.*
|
||||||
outputs/*.*
|
outputs/*.*
|
||||||
|
finetune/*.*
|
||||||
config.json
|
config.json
|
||||||
confignew.json
|
confignew.json
|
||||||
models.json
|
models.json
|
||||||
@@ -146,6 +151,7 @@ Assuming its all working fine and you are happy, you can delete the old alltalk_
|
|||||||
|:---:|:---:|
|
|:---:|:---:|
|
||||||
| |  |
|
| |  |
|
||||||
| |  |
|
| |  |
|
||||||
|
| |
|
||||||
|
|
||||||
## 🟨 Help with problems
|
## 🟨 Help with problems
|
||||||
#### 🔄 **Minor updates/bug fixes list** can be found [here](https://github.com/erew123/alltalk_tts/issues/25)
|
#### 🔄 **Minor updates/bug fixes list** can be found [here](https://github.com/erew123/alltalk_tts/issues/25)
|
||||||
@@ -254,10 +260,29 @@ I would suggest following [Problems Updating](https://github.com/erew123/alltalk
|
|||||||
As far as I am aware, these are to do with the chrome browser the gradio text-generation-webui in some way. I raised an issue about this on the text-generation-webui [here](https://github.com/oobabooga/text-generation-webui/issues/4788) where you can see that AllTalk is not loaded and the messages persist. Either way, this is more a warning than an actual issue, so shouldnt affect any functionality of either AllTalk or text-generation-webui, they are more just an annoyance.
|
As far as I am aware, these are to do with the chrome browser the gradio text-generation-webui in some way. I raised an issue about this on the text-generation-webui [here](https://github.com/oobabooga/text-generation-webui/issues/4788) where you can see that AllTalk is not loaded and the messages persist. Either way, this is more a warning than an actual issue, so shouldnt affect any functionality of either AllTalk or text-generation-webui, they are more just an annoyance.
|
||||||
</details>
|
</details>
|
||||||
|
|
||||||
|
#### 🟨 I have multiple GPU's and I have problems running Finetuning
|
||||||
|
|
||||||
|
<details>
|
||||||
|
<summary>Click to expand</summary><br>
|
||||||
|
|
||||||
|
Finetuning pulls in various other scripts and some of those scripts can have issues with multiple Nvidia GPU's being present. Until the people that created those other scripts fix up their code, there is a workaround to temporarily tell your system to only use the 1x of your Nvidia GPU's. To do this:
|
||||||
|
|
||||||
|
- **Windows** - You will start the script with `set CUDA_VISIBLE_DEVICES=0 && python finetune.py`<br>
|
||||||
|
After you have completed training, you can reset back with `set CUDA_VISIBLE_DEVICES=`<br>
|
||||||
|
|
||||||
|
- **Linux** - You will start the script with `CUDA_VISIBLE_DEVICES=0 python finetune.py`<br>
|
||||||
|
After you have completed training, you can reset back with `unset CUDA_VISIBLE_DEVICES`<br>
|
||||||
|
|
||||||
|
Rebooting your system will also unset this. The setting is only applied temporarily.
|
||||||
|
|
||||||
|
Depending on which of your Nvidia GPU's is the more powerful one, you can change the `0` to `1` or whichever of your GPU's is the most powerful.
|
||||||
|
|
||||||
|
</details>
|
||||||
|
|
||||||
## ⚫ Finetuning a model
|
## ⚫ Finetuning a model
|
||||||
If you have a voice that the model doesnt quite reproduce correctly, or indeed you just want to improve the reproduced voice, then finetuning is a way to train your "XTTSv2 local" model **(stored in `/alltalk_tts/models/xxxxx/`)** on a specific voice. For this you will need:
|
If you have a voice that the model doesnt quite reproduce correctly, or indeed you just want to improve the reproduced voice, then finetuning is a way to train your "XTTSv2 local" model **(stored in `/alltalk_tts/models/xxxxx/`)** on a specific voice. For this you will need:
|
||||||
|
|
||||||
- An Nvidia graphics card
|
- An Nvidia graphics card. (Please see this [note](https://github.com/erew123/alltalk_tts#-i-have-multiple-gpus-and-i-have-problems-running-finetuning) if you have multiple Nvidia GPU's).
|
||||||
- To install a few portions of the Nvidia CUDA 11.8 Toolkit (this will not impact text-generation-webui's cuda setup.
|
- To install a few portions of the Nvidia CUDA 11.8 Toolkit (this will not impact text-generation-webui's cuda setup.
|
||||||
- 18GB of disk space free (most of this is used temporarily)
|
- 18GB of disk space free (most of this is used temporarily)
|
||||||
- At least 2 minutes of good quality speech from your chosen speaker in mp3, wav or flacc format, in one or more files (have tested as far as 20 minutes worth of audio).
|
- At least 2 minutes of good quality speech from your chosen speaker in mp3, wav or flacc format, in one or more files (have tested as far as 20 minutes worth of audio).
|
||||||
@@ -315,6 +340,18 @@ As mentioned you must have a small portion of the Nvidia CUDA Toolkit **11.8** i
|
|||||||
11) Follow the on-screen instructions when the web interface starts up.
|
11) Follow the on-screen instructions when the web interface starts up.
|
||||||
12) When you have finished finetuning, the final tab will tell you what to do with your files and how to move your newly trained model to the correct location on disk.
|
12) When you have finished finetuning, the final tab will tell you what to do with your files and how to move your newly trained model to the correct location on disk.
|
||||||
|
|
||||||
|
#### ⚫ Using a Finetuned model in Text-generation-webui
|
||||||
|
|
||||||
|
At the end of the finetune process, you will have an option to `Compact and move model to /trainedmodel/` this will compact the raw training file and move it to `/model/trainedmodel/`. When AllTalk starts up within Text-generation-webui, if it finds a model in this location a new loader will appear in the interface for `XTTSv2 FT` and you can use this to load your finetuned model. <br><br>**Be careful** not to train a new model from the base model, then overwrite your current `/model/trainedmodel/` **if** you want a seperately trained model. This is why there is an `OPTION B` to move your just trained model to `/models/lastfinetuned/`.
|
||||||
|
|
||||||
|
#### ⚫ Training one model with multiple voices
|
||||||
|
|
||||||
|
At the end of the finetune process, you will have an option to `Compact and move model to /trainedmodel/` this will compact the raw training file and move it to `/model/trainedmodel/`. This model will become available when you start up finetuning. You will have a choice to train the Base Model or the `Existing finetuned model` (which is the one in `/model/trainedmodel/`). So you can use this to keep further training this model with additional voices, then copying it back to `/model/trainedmodel/` at the end of training.
|
||||||
|
|
||||||
|
#### ⚫ Do I need to keep the raw training data/model?
|
||||||
|
|
||||||
|
If you've compacted and moved your model, its highly unlikely you would want to keep that data, however the choice is there to keep it if you wish. It will be between 5-10GB in size, so most people will want to delete it.
|
||||||
|
|
||||||
## 🔵🟢🟡 DeepSpeed Installation Options
|
## 🔵🟢🟡 DeepSpeed Installation Options
|
||||||
**NOTE**: You **DO NOT** need to set Text-generation-webUI's **--deepspeed** setting for AllTalk to be able to use DeepSpeed. These are two completely separate things and incorrectly setting that on Text-generation-webUI may cause other complications.
|
**NOTE**: You **DO NOT** need to set Text-generation-webUI's **--deepspeed** setting for AllTalk to be able to use DeepSpeed. These are two completely separate things and incorrectly setting that on Text-generation-webUI may cause other complications.
|
||||||
|
|
||||||
@@ -471,35 +508,141 @@ def get_shm_size():
|
|||||||
## 🟦 Running AllTalk as a standalone app
|
## 🟦 Running AllTalk as a standalone app
|
||||||
AllTalk will run as a standalone app, as long as you install its requirements files into whatever Python environment you are using. You can follow the steps to install the AllTalk's requirements into whatever Python environment you wish. Because I dont know what Python environment you are wanting to use, I can only give you a loose set of installation instructions.
|
AllTalk will run as a standalone app, as long as you install its requirements files into whatever Python environment you are using. You can follow the steps to install the AllTalk's requirements into whatever Python environment you wish. Because I dont know what Python environment you are wanting to use, I can only give you a loose set of installation instructions.
|
||||||
|
|
||||||
Please note, at time of writing, the TTS engine requires Python **3.9.x** to **3.11.x** [TTS Engine details here](https://pypi.org/project/TTS/)
|
Please note, at time of writing, the TTS engine requires Python **3.9.x** to **3.11.x** [TTS Engine details here](https://pypi.org/project/TTS/). AllTalk and its requirements are tested on Python **3.11.x**.
|
||||||
|
|
||||||
#### 🟦 (Option 1) I already have AllTalk installed as an extension of Text-generation-webui
|
#### 🟦 (Option 1) I already have AllTalk installed as an extension of Text-generation-webui
|
||||||
If you already have AllTalk as a extension of Text-generation-webui, and wish to run it as standalone, load Text-generation-webui's Python environment `cmd_windows.bat`, `./cmd_linux.sh`, `cmd_macos.sh` or `cmd_wsl.bat`, move into the AllTalk folder `cd extensions` > `cd alltalk_tts` and start AllTalk with `python script.py`. There is nothing beyond this you would need to do.
|
If you already have AllTalk as a extension of Text-generation-webui, and wish to run it as standalone, load Text-generation-webui's Python environment `cmd_windows.bat`, `./cmd_linux.sh`, `cmd_macos.sh` or `cmd_wsl.bat`, move into the AllTalk folder `cd extensions` > `cd alltalk_tts` and start AllTalk with `python script.py`. There is nothing beyond this you would need to do.
|
||||||
|
|
||||||
#### 🟦 (Option 2) I wish to do a custom install of AllTalk
|
#### 🟦 (Option 2) I wish to do a custom install of AllTalk
|
||||||
1) In your chosen disk location git clone this repository:<br><br>
|
#### 🔹 A very quick understanding of Python Environments.
|
||||||
`git clone https://github.com/erew123/alltalk_tts`
|
Different Python applications have different requirements, some of those requirement’s conflict with other Python applications requirements. To work around this problem, you can create different Python environments that remain separated from one another. A simple way of looking at Python environments, is just like how your house has different rooms for specific purposes (Kitchen, Bathroom, Bedroom etc). You can create a Python environment that is built/customised specifically for your current applications needs/purposes and will **not** interfere with any other Python applications environments/installations. <br><br>If you are adept at managing Python environments, have an existing Python environment and know that you won’t cause any conflicts by installing AllTalk's requirements within that Python environment, then load up your Python environment and install the requirements. For everyone else, here is a basic guide on installing AllTalk in its own custom Python environment (there will be small variations between OS's, but the principle is the same).
|
||||||
|
|
||||||
2) Move into the **alltalk_tts** folder:<br><br>
|
**Note:** A standard VENV can cause module path issues, hence Conda is the correct method to create a Python environment for AllTalk.
|
||||||
`cd alltalk_tts`
|
|
||||||
|
|
||||||
3) If you have a custom Python environment, now is the time to load it!
|
#### 🔹 Building a custom Python Environment with Miniconda
|
||||||
|
1) Open a terminal/command prompt, and confirm that both `python --version` and `pip` both work. Neither of them should give an error message. If they do you may need to install Python (and maybe Pip).<br><br>[Python Website](https://www.python.org/downloads/)<br>[Pip Website](https://pip.pypa.io/en/stable/installation/)<br><br>Once you have those working you can now continue on.<br><br>
|
||||||
|
|
||||||
4) Install one of the two requirements files. Whichever one of the two is correct for your machine type:<br><br>
|
2) Assuming you don't already have Miniconda installed, we will need to download and install Minoconda as this is what we will use to build our custom Python environment.<br><br>[Miniconda Website](https://docs.conda.io/projects/miniconda/en/latest/)<br><br>Download the Miniconda version that is correct for your OS and then install it. Miniconda will create some items in your Start Menu or Application Launcher called something like `Anaconda Prompt`<br><br> You will start the `Anaconda Prompt` and your prompt in your terminal/command prompt will say something like: <br><br>`(base) C:\users\myaccount\>`<br><br> The important bit is that it has the `(base)`, the location after that doesn't matter. `(base)` signifies we are in the base conda Python environment and can now create custom Python environments with Conda.<br><br>
|
||||||
|
|
||||||
|
3) In your Anaconda Prompt command prompt/terminal, move into the folder where you want to download AllTalk to and then git clone this repository. For simplicity I am going to assume that location is `c:\myfiles\`. So you will:<br><br>`cd myfiles`<br><br>`git clone https://github.com/erew123/alltalk_tts`<br><br>
|
||||||
|
|
||||||
|
4) Now we will create our custom Conda Python 3.11.5 environment and give it the name alltalkenv by typing the following at the prompt:<br><br>`conda create --name alltalkenv python=3.11.5`<br><br>You will be prompted if you want to continue and you say yes.<br><br>Once that process has completed, we now need to change from the `(base)` Conda Python environment, to our newly created `(alltalkenv)` environment. So type the following:<br><br>`conda activate alltalkenv`<br><br>Your prompt should now change from `(base) C:\myfiles\>` to `(alltalkenv) C:\myfiles\>`<br><br>
|
||||||
|
|
||||||
|
5) **If you are NOT using an Nvidia card and CUDA, skip to step 6**. To force PyTorch to install with CUDA, perform the following:<br><br>`pip cache purge` (Clear the current Pip cache)<br><br>`pip uninstall torch torchaudio` (Uninstall Torch and Torchaudio from the `alltalkenv` environment)<br><br>
|
||||||
|
You can now either install the CUDA 11.8 or 12.1 version of Torch and Torchaudio with **one** of the following<br><br>**CUDA 11.8** > `pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118`<br><br>**CUDA 12.1** > `pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu121`<br><br>
|
||||||
|
|
||||||
|
6) Move into the alltalk_tts folder and install one of the two requirements files. Whichever one of the two is correct for your machine type:<br><br>`cd alltalk_tts`<br><br>
|
||||||
**Nvidia graphics card machines** - `pip install -r requirements_nvidia.txt`<br><br>
|
**Nvidia graphics card machines** - `pip install -r requirements_nvidia.txt`<br><br>
|
||||||
**Other machines (mac, amd etc)** - `pip install -r requirements_other.txt`
|
**Other machines (mac, amd etc)** - `pip install -r requirements_other.txt`<br><br>
|
||||||
|
|
||||||
5) Start AllTalk with `python script.py`
|
7) Start AllTalk with `python script.py`<br><br>
|
||||||
|
|
||||||
Deepspeed and other such things can be installed. Please read the relevant instructions for those items, however, make the relevant changes to load your correct Python environment when installing any requirements files and starting AllTalk.
|
🔹Anytime you wish to use AllTalk, update its requirements, install some other requirements such as DeepSpeed, you will need to start its Conda Python Environment in the terminal/prompt, which you will do with `conda activate alltalkenv` as long as the Conda executable is accessible at the command prompt/terminal you are in.<br><br>It is fully possible to create a batch file or script file that you can use as a launcher from your Start Menu/Application Launcher that will start the environment and AllTalk for you.
|
||||||
|
|
||||||
|
Deepspeed and other such things can be installed. Please read the relevant instructions for those items, however, make the relevant changes to load your correct Python environment when installing any requirements files and starting AllTalk.<br><br>
|
||||||
|
|
||||||
|
## ⬜ AllTalk TTS Generator
|
||||||
|
AllTalk TTS Generator is the solution for converting large volumes of text into speech using the voice of your choice. Whether you're creating audio content or just want to hear text read aloud, the TTS Generator is equipped to handle it all efficiently.<br><br>The link to open the TTS generator can be found on the built-in Settings and Documentation page.
|
||||||
|
|
||||||
|
#### ⬜ Quick Start
|
||||||
|
- **Text Input:** Enter the text you wish to convert into speech in the 'Text Input' box.
|
||||||
|
- **Generate TTS:** Hit this to start the text-to-speech conversion.
|
||||||
|
- **Pause/Resume:** Used to pause and resume the playback of the initial generation of wavs or the stream.
|
||||||
|
- **Stop Playback:** This will stop the current audio playing back. It does not stop the text from being generated however.
|
||||||
|
Once you have sent text off to be generated, either as a stream or wav file generation, the TTS server will remain busy until this process has competed. As such, think carefully as to how much you want to send to the server.
|
||||||
|
If you are generating wav files and populating the queue, you can generate one lot of text to speech, then input your next lot of text and it will continue adding to the list.
|
||||||
|
#### ⬜ TTS Generation Modes
|
||||||
|
- **Wav Chunks:** Perfect for creating audio books, or anything you want to keep long term. Breaks down your text into manageable wav files and queues them up. Generation begins automatically, and playback will start after a few chunks have been prepared ahead. You can set the volume to 0 if you don’t want to hear playback. With Wav chunks, you can edit and/or regenerate portions of the TTS as needed.
|
||||||
|
- **Streaming:** For immediate playback without the ability to save. Ideal for on-the-fly speech generation and listening. This will not generate wav files and it will play back through your browser. You cannot stop the server generating the TTS once it has been sent.
|
||||||
|
With wav chunks you can either playback “In Browser” which is the web page you are on, or “On Server” which is through the console/terminal where AllTalk is running from. Only generation “In Browser” can play back smoothly and populate the Generated TTS List. Setting the Volume will affect the volume level played back both “In Browser” and “On Server”.
|
||||||
|
#### ⬜ Playback and List Management
|
||||||
|
- **Playback Controls:** Utilize 'Play List' to start from the beginning or 'Stop Playback' to halt at any time.
|
||||||
|
- **Custom Start:** Jump into your list at a specific ID to hear a particular section.
|
||||||
|
- **Regeneration and Editing:** If a chunk isn't quite right, you can opt to regenerate it or edit the text directly. Click off the text to save changes and hit regenerate for the specific line.
|
||||||
|
- **Export/Import List:** Save your TTS list as a JSON file or import one. Note: Existing wav files are needed for playback. Exporting is handy if you want to take your files away into another program and have a list of which wav is which, or if you keep your audio files, but want to come back at a later date, edit one or two lines, regenerate the speech and re-combine the wav’s into one new long wav.
|
||||||
|
#### ⬜ Exporting Your Audio
|
||||||
|
- **Export to WAV:** Combine all generated TTS from the list, into one single WAV file for easy download and distribution.
|
||||||
|
#### ⬜ Customization and Preferences
|
||||||
|
- **Character Voice:** Choose the voice that will read your text.
|
||||||
|
- **Language:** Select the language of your text.
|
||||||
|
- **Chunk Sizes:** Decide the size of text chunks for generation. Smaller sizes are recommended for better TTS quality.
|
||||||
|
#### ⬜ Interface and Accessibility
|
||||||
|
- **Dark/Light Mode:** Switch between themes for your visual comfort.
|
||||||
|
- **Word Count and Generation Queue:** Keep track of the word count and the generation progress.
|
||||||
|
#### ⬜ Notes on Usage
|
||||||
|
- For seamless TTS generation, it's advised to keep text chunks under 250 characters, which you can control with the Chunk sizes.
|
||||||
|
- Generated audio can be played back from the list, which also highlights the currently playing chunk.
|
||||||
|
- The TTS Generator remembers your settings, so you can pick up where you left off even after refreshing the page.
|
||||||
|
|
||||||
## 🟠 API Suite and JSON-CURL
|
## 🟠 API Suite and JSON-CURL
|
||||||
### 🟠Overview
|
### 🟠Overview
|
||||||
The Text-to-Speech (TTS) Generation API allows you to generate speech from text input using various configuration options. This API supports both character and narrator voices, providing flexibility for creating dynamic and engaging audio content.
|
The Text-to-Speech (TTS) Generation API allows you to generate speech from text input using various configuration options. This API supports both character and narrator voices, providing flexibility for creating dynamic and engaging audio content.
|
||||||
|
|
||||||
- URL: `http://127.0.0.1:7851/api/tts-generate`<br>
|
#### 🟠 Ready Endpoint<br>
|
||||||
- Method: `POST`<br>
|
Check if the Text-to-Speech (TTS) service is ready to accept requests.
|
||||||
- Content-Type: `application/x-www-form-urlencoded`<br>
|
|
||||||
|
- URL: `http://127.0.0.1:7851/api/ready`<br> - Method: `GET`<br>
|
||||||
|
|
||||||
|
`curl -X GET "http://127.0.0.1:7851/api/ready"`
|
||||||
|
|
||||||
|
Response: `Ready`
|
||||||
|
|
||||||
|
#### 🟠 Voices List Endpoint<br>
|
||||||
|
Retrieve a list of available voices for generating speech.
|
||||||
|
|
||||||
|
- URL: `http://127.0.0.1:7851/api/voices`<br> - Method: `GET`<br>
|
||||||
|
|
||||||
|
`curl -X GET "http://127.0.0.1:7851/api/voices"`
|
||||||
|
|
||||||
|
JSON return: `{"voices": ["voice1.wav", "voice2.wav", "voice3.wav"]}`
|
||||||
|
|
||||||
|
#### 🟠 Preview Voice Endpoint
|
||||||
|
Generate a preview of a specified voice with hardcoded settings.
|
||||||
|
|
||||||
|
- URL: `http://127.0.0.1:7851/api/previewvoice/`<br> - Method: `POST`<br> - Content-Type: `application/x-www-form-urlencoded`<br>
|
||||||
|
|
||||||
|
`curl -X POST "http://127.0.0.1:7851/api/previewvoice/" -F "voice=female_01.wav"`
|
||||||
|
|
||||||
|
Replace `female_01.wav` with the name of the voice sample you want to hear.
|
||||||
|
|
||||||
|
JSON return: `{"status": "generate-success", "output_file_path": "/path/to/outputs/api_preview_voice.wav", "output_file_url": "http://127.0.0.1:7851/audio/api_preview_voice.wav"}`
|
||||||
|
|
||||||
|
#### 🟠 Switching Model Endpoint<br>
|
||||||
|
|
||||||
|
- URL: `http://127.0.0.1:7851/api/reload`<br> - Method: `POST`<br><br>
|
||||||
|
`curl -X POST "http://127.0.0.1:7851/api/reload?tts_method=API%20Local"`<br>
|
||||||
|
`curl -X POST "http://127.0.0.1:7851/api/reload?tts_method=API%20TTS"`<br>
|
||||||
|
`curl -X POST "http://127.0.0.1:7851/api/reload?tts_method=XTTSv2%20Local"`<br>
|
||||||
|
|
||||||
|
Switch between the 3 models respectively.
|
||||||
|
|
||||||
|
`curl -X POST "http://127.0.0.1:7851/api/reload?tts_method=XTTSv2%20FT"`<br>
|
||||||
|
|
||||||
|
If you have a finetuned model in `/models/trainedmodel/` (will error otherwise)
|
||||||
|
|
||||||
|
JSON return `{"status": "model-success"}`
|
||||||
|
|
||||||
|
#### 🟠 Switch DeepSpeed Endpoint<br>
|
||||||
|
|
||||||
|
- URL: `http://127.0.0.1:7851/api/deepspeed`<br> - Method: `POST`<br><br>
|
||||||
|
`curl -X POST "http://127.0.0.1:7851/api/deepspeed?new_deepspeed_value=True"`
|
||||||
|
|
||||||
|
Replace True with False to disable DeepSpeed mode.
|
||||||
|
|
||||||
|
JSON return `{"status": "deepspeed-success"}`
|
||||||
|
|
||||||
|
#### 🟠 Switching Low VRAM Endpoint<br>
|
||||||
|
|
||||||
|
- URL: `http://127.0.0.1:7851/api/lowvramsetting`<br> - Method: `POST`<br><br>
|
||||||
|
`curl -X POST "http://127.0.0.1:7851/api/lowvramsetting?new_low_vram_value=True"`
|
||||||
|
|
||||||
|
Replace True with False to disable Low VRAM mode.
|
||||||
|
|
||||||
|
JSON return `{"status": "lowvram-success"}`
|
||||||
|
|
||||||
|
### 🟠 TTS Generation Endpoint
|
||||||
|
|
||||||
|
- URL: `http://127.0.0.1:7851/api/tts-generate`<br> - Method: `POST`<br> - Content-Type: `application/x-www-form-urlencoded`<br>
|
||||||
|
|
||||||
### 🟠 Example command lines
|
### 🟠 Example command lines
|
||||||
Standard TTS speech Example (standard text) generating a time-stamped file<br>
|
Standard TTS speech Example (standard text) generating a time-stamped file<br>
|
||||||
@@ -556,22 +699,22 @@ Example:
|
|||||||
|
|
||||||
🟠 **language**: Choose the language for TTS. Options:
|
🟠 **language**: Choose the language for TTS. Options:
|
||||||
|
|
||||||
`ar Arabic`<br>
|
`ar` Arabic<br>
|
||||||
`zh-cn Chinese (Simplified)`<br>
|
`zh-cn` Chinese (Simplified)<br>
|
||||||
`cs Czech`<br>
|
`cs` Czech<br>
|
||||||
`nl Dutch`<br>
|
`nl` Dutch<br>
|
||||||
`en English`<br>
|
`en` English<br>
|
||||||
`fr French`<br>
|
`fr` French<br>
|
||||||
`de German`<br>
|
`de` German<br>
|
||||||
`hu Hungarian`<br>
|
`hu` Hungarian<br>
|
||||||
`it Italian`<br>
|
`it` Italian<br>
|
||||||
`ja Japanese`<br>
|
`ja` Japanese<br>
|
||||||
`ko Korean`<br>
|
`ko` Korean<br>
|
||||||
`pl Polish`<br>
|
`pl` Polish<br>
|
||||||
`pt Portuguese`<br>
|
`pt` Portuguese<br>
|
||||||
`ru Russian`<br>
|
`ru` Russian<br>
|
||||||
`es Spanish`<br>
|
`es` Spanish<br>
|
||||||
`tr Turkish`<br>
|
`tr` Turkish<br>
|
||||||
|
|
||||||
`-d "language=en"`<br>
|
`-d "language=en"`<br>
|
||||||
|
|
||||||
@@ -584,12 +727,12 @@ Example:
|
|||||||
`-d "output_file_timestamp=true"`<br>
|
`-d "output_file_timestamp=true"`<br>
|
||||||
`-d "output_file_timestamp=false"`
|
`-d "output_file_timestamp=false"`
|
||||||
|
|
||||||
🟠 **autoplay**: Feature not yet available. Enable or disable autoplay. Still needs to be specified in the JSON request.
|
🟠 **autoplay**: Enable or disable playing the generated TTS to your standard sound output device at time of TTS generation.
|
||||||
|
|
||||||
`-d "autoplay=true"`<br>
|
`-d "autoplay=true"`<br>
|
||||||
`-d "autoplay=false"`
|
`-d "autoplay=false"`
|
||||||
|
|
||||||
🟠 **autoplay_volume**: Feature not yet available. Set the autoplay volume. Should be between 0.1 and 1.0. Still needs to be specified in the JSON request.
|
🟠 **autoplay_volume**: Set the autoplay volume. Should be between 0.1 and 1.0. Needs to be specified in the JSON request even if autoplay is false.
|
||||||
|
|
||||||
`-d "autoplay_volume=0.8"`
|
`-d "autoplay_volume=0.8"`
|
||||||
|
|
||||||
@@ -598,37 +741,14 @@ The API returns a JSON object with the following properties:
|
|||||||
|
|
||||||
- **status** Indicates whether the generation was successful (generate-success) or failed (generate-failure).<br>
|
- **status** Indicates whether the generation was successful (generate-success) or failed (generate-failure).<br>
|
||||||
- **output_file_path** The on-disk location of the generated WAV file.<br>
|
- **output_file_path** The on-disk location of the generated WAV file.<br>
|
||||||
- **output_file_url** The HTTP location for accessing the generated WAV file.<br>
|
- **output_file_url** The HTTP location for accessing the generated WAV file for browser playback.<br>
|
||||||
|
- **output_cache_url** The HTTP location for accessing the generated WAV file as a pushed download.<br>
|
||||||
|
|
||||||
Example JSON TTS Generation Response:
|
Example JSON TTS Generation Response:
|
||||||
|
|
||||||
`{"status": "generate-success", "output_file_path": "C:\text-generation-webui\extensions\alltalk_tts\outputs\myoutputfile_1703149973.wav", "output_file_url": "http://127.0.0.1:7851/audio/myoutputfile_1703149973.wav"}`
|
`{"status":"generate-success","output_file_path":"C:\\text-generation-webui\\extensions\\alltalk_tts\\outputs\\myoutputfile_1704141936.wav","output_file_url":"http://127.0.0.1:7851/audio/myoutputfile_1704141936.wav","output_cache_url":"http://127.0.0.1:7851/audiocache/myoutputfile_1704141936.wav"}`
|
||||||
|
|
||||||
🟠 **Switching Model**<br><br>
|
|
||||||
`curl -X POST "http://127.0.0.1:7851/api/reload?tts_method=API%20Local"`<br>
|
|
||||||
`curl -X POST "http://127.0.0.1:7851/api/reload?tts_method=API%20TTS"`<br>
|
|
||||||
`curl -X POST "http://127.0.0.1:7851/api/reload?tts_method=XTTSv2%20Local"`<br>
|
|
||||||
|
|
||||||
Switch between the 3 models respectively.
|
|
||||||
|
|
||||||
JSON return `{"status": "model-success"}`
|
|
||||||
|
|
||||||
🟠 **Switch DeepSpeed**<br><br>
|
|
||||||
`curl -X POST "http://127.0.0.1:7851/api/deepspeed?new_deepspeed_value=True"`
|
|
||||||
|
|
||||||
Replace True with False to disable DeepSpeed mode.
|
|
||||||
|
|
||||||
JSON return `{"status": "deepspeed-success"}`
|
|
||||||
|
|
||||||
🟠 **Switching Low VRAM**<br><br>
|
|
||||||
`curl -X POST "http://127.0.0.1:7851/api/lowvramsetting?new_low_vram_value=True"`
|
|
||||||
|
|
||||||
Replace True with False to disable Low VRAM mode.
|
|
||||||
|
|
||||||
JSON return `{"status": "lowvram-success"}`
|
|
||||||
|
|
||||||
### 🔴 Future to-do list
|
### 🔴 Future to-do list
|
||||||
- Voice output within the command prompt/terminal (TBD).
|
- SillyTavern Support
|
||||||
- Correct a few spelling mistakes in the documentation.
|
|
||||||
- Possibly add some additional TTS engines (TBD).
|
- Possibly add some additional TTS engines (TBD).
|
||||||
- Have a break!
|
- Have a break!
|
||||||
@@ -48,6 +48,20 @@ else:
|
|||||||
print("[FINETUNE] \033[91mWarning\033[0m modeldownload.json is missing. Please run this script in the /alltalk_tts/ folder")
|
print("[FINETUNE] \033[91mWarning\033[0m modeldownload.json is missing. Please run this script in the /alltalk_tts/ folder")
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
|
##################################################
|
||||||
|
#### Check to see if a finetuned model exists ####
|
||||||
|
##################################################
|
||||||
|
# Set the path to the directory
|
||||||
|
trained_model_directory = this_dir / "models" / "trainedmodel"
|
||||||
|
# Check if the directory "trainedmodel" exists
|
||||||
|
finetuned_model = trained_model_directory.exists()
|
||||||
|
# If the directory exists, check for the existence of the required files
|
||||||
|
# If true, this will add a extra option in the Gradio interface for loading Xttsv2 FT
|
||||||
|
if finetuned_model:
|
||||||
|
required_files = ["model.pth", "config.json", "vocab.json", "mel_stats.pth", "dvae.pth"]
|
||||||
|
finetuned_model = all((trained_model_directory / file).exists() for file in required_files)
|
||||||
|
basemodel_or_finetunedmodel = True
|
||||||
|
|
||||||
#####################
|
#####################
|
||||||
#### STEP 1 BITS ####
|
#### STEP 1 BITS ####
|
||||||
#####################
|
#####################
|
||||||
@@ -272,6 +286,8 @@ def format_audio_list(target_language, whisper_model, out_path, gradio_progress=
|
|||||||
# deallocate VRAM and RAM
|
# deallocate VRAM and RAM
|
||||||
del asr_model, final_eval_set, final_training_set, new_data_df, existing_metadata
|
del asr_model, final_eval_set, final_training_set, new_data_df, existing_metadata
|
||||||
gc.collect()
|
gc.collect()
|
||||||
|
existing_train_df = None
|
||||||
|
existing_eval_df = None
|
||||||
print("[FINETUNE] Train CSV:", train_metadata_path)
|
print("[FINETUNE] Train CSV:", train_metadata_path)
|
||||||
print("[FINETUNE] Eval CSV:", eval_metadata_path)
|
print("[FINETUNE] Eval CSV:", eval_metadata_path)
|
||||||
print("[FINETUNE] Audio Total:", audio_total_size)
|
print("[FINETUNE] Audio Total:", audio_total_size)
|
||||||
@@ -289,6 +305,13 @@ from TTS.tts.layers.xtts.trainer.gpt_trainer import GPTArgs, GPTTrainer, GPTTrai
|
|||||||
from TTS.utils.manage import ModelManager
|
from TTS.utils.manage import ModelManager
|
||||||
|
|
||||||
|
|
||||||
|
def basemodel_or_finetunedmodel_choice(value):
|
||||||
|
global basemodel_or_finetunedmodel
|
||||||
|
if value == "Base Model":
|
||||||
|
basemodel_or_finetunedmodel = True
|
||||||
|
elif value == "Existing finetuned model":
|
||||||
|
basemodel_or_finetunedmodel = False
|
||||||
|
|
||||||
def train_gpt(language, num_epochs, batch_size, grad_acumm, train_csv, eval_csv, output_path, max_audio_length=255995):
|
def train_gpt(language, num_epochs, batch_size, grad_acumm, train_csv, eval_csv, output_path, max_audio_length=255995):
|
||||||
# Logging parameters
|
# Logging parameters
|
||||||
RUN_NAME = "XTTS_FT"
|
RUN_NAME = "XTTS_FT"
|
||||||
@@ -321,12 +344,22 @@ def train_gpt(language, num_epochs, batch_size, grad_acumm, train_csv, eval_csv,
|
|||||||
# Add here the configs of the datasets
|
# Add here the configs of the datasets
|
||||||
DATASETS_CONFIG_LIST = [config_dataset]
|
DATASETS_CONFIG_LIST = [config_dataset]
|
||||||
|
|
||||||
# XTTS model checkpoints for fine-tuning.
|
if basemodel_or_finetunedmodel:
|
||||||
TOKENIZER_FILE = str(this_dir / base_path / model_path / "vocab.json") # vocab.json file
|
# BASE XTTS model checkpoints for fine-tuning.
|
||||||
XTTS_CHECKPOINT = str(this_dir / base_path / model_path / "model.pth") # model.pth file
|
print("[FINETUNE] Starting finetuning on Base Model")
|
||||||
XTTS_CONFIG_FILE = str(this_dir / base_path / model_path / "config.json") # config.json file
|
TOKENIZER_FILE = str(this_dir / base_path / model_path / "vocab.json")
|
||||||
|
XTTS_CHECKPOINT = str(this_dir / base_path / model_path / "model.pth")
|
||||||
|
XTTS_CONFIG_FILE = str(this_dir / base_path / model_path / "config.json")
|
||||||
DVAE_CHECKPOINT = str(this_dir / base_path / model_path / "dvae.pth")
|
DVAE_CHECKPOINT = str(this_dir / base_path / model_path / "dvae.pth")
|
||||||
MEL_NORM_FILE = str(this_dir / base_path / model_path / "mel_stats.pth")
|
MEL_NORM_FILE = str(this_dir / base_path / model_path / "mel_stats.pth")
|
||||||
|
else:
|
||||||
|
# FINETUNED XTTS model checkpoints for fine-tuning.
|
||||||
|
print("[FINETUNE] Starting finetuning on Existing Finetuned Model")
|
||||||
|
TOKENIZER_FILE = str(this_dir / base_path / "trainedmodel" / "vocab.json")
|
||||||
|
XTTS_CHECKPOINT = str(this_dir / base_path / "trainedmodel" / "model.pth")
|
||||||
|
XTTS_CONFIG_FILE = str(this_dir / base_path / "trainedmodel" / "config.json")
|
||||||
|
DVAE_CHECKPOINT = str(this_dir / base_path / "trainedmodel" / "dvae.pth")
|
||||||
|
MEL_NORM_FILE = str(this_dir / base_path / "trainedmodel" / "mel_stats.pth")
|
||||||
|
|
||||||
# init args and config
|
# init args and config
|
||||||
model_args = GPTArgs(
|
model_args = GPTArgs(
|
||||||
@@ -417,9 +450,14 @@ def train_gpt(language, num_epochs, batch_size, grad_acumm, train_csv, eval_csv,
|
|||||||
trainer_out_path = trainer.output_path
|
trainer_out_path = trainer.output_path
|
||||||
|
|
||||||
# deallocate VRAM and RAM
|
# deallocate VRAM and RAM
|
||||||
del model, trainer, train_samples, eval_samples
|
del model, trainer, train_samples, eval_samples, config, model_args, config_dataset
|
||||||
gc.collect()
|
gc.collect()
|
||||||
|
train_samples = None
|
||||||
|
eval_samples = None
|
||||||
|
config_dataset = None
|
||||||
|
trainer = None
|
||||||
|
model = None
|
||||||
|
model_args = None
|
||||||
return XTTS_CONFIG_FILE, XTTS_CHECKPOINT, TOKENIZER_FILE, trainer_out_path, speaker_ref
|
return XTTS_CONFIG_FILE, XTTS_CHECKPOINT, TOKENIZER_FILE, trainer_out_path, speaker_ref
|
||||||
|
|
||||||
##########################
|
##########################
|
||||||
@@ -514,7 +552,7 @@ def compact_model():
|
|||||||
|
|
||||||
# Check if the best model file exists
|
# Check if the best model file exists
|
||||||
if best_model_path_str is None:
|
if best_model_path_str is None:
|
||||||
print("No trained model was found.")
|
print("[FINETUNE] No trained model was found.")
|
||||||
return "No trained model was found."
|
return "No trained model was found."
|
||||||
|
|
||||||
# Convert model_path_str to Path
|
# Convert model_path_str to Path
|
||||||
@@ -524,7 +562,7 @@ def compact_model():
|
|||||||
try:
|
try:
|
||||||
checkpoint = torch.load(best_model_path, map_location=torch.device("cpu"))
|
checkpoint = torch.load(best_model_path, map_location=torch.device("cpu"))
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print("Error loading checkpoint:", e)
|
print("[FINETUNE] Error loading checkpoint:", e)
|
||||||
raise
|
raise
|
||||||
|
|
||||||
del checkpoint["optimizer"]
|
del checkpoint["optimizer"]
|
||||||
@@ -565,20 +603,128 @@ def compact_model():
|
|||||||
return "Model copied to '/models/trainedmodel/'"
|
return "Model copied to '/models/trainedmodel/'"
|
||||||
|
|
||||||
|
|
||||||
|
def compact_lastfinetuned_model():
|
||||||
|
this_dir = Path(__file__).parent.resolve()
|
||||||
|
|
||||||
|
best_model_path_str = find_latest_best_model(this_dir / "finetune" / "tmp-trn" / "training")
|
||||||
|
|
||||||
|
# Check if the best model file exists
|
||||||
|
if best_model_path_str is None:
|
||||||
|
print("[FINETUNE] No trained model was found.")
|
||||||
|
return "No trained model was found."
|
||||||
|
|
||||||
|
# Convert model_path_str to Path
|
||||||
|
best_model_path = Path(best_model_path_str)
|
||||||
|
|
||||||
|
# Attempt to load the model
|
||||||
|
try:
|
||||||
|
checkpoint = torch.load(best_model_path, map_location=torch.device("cpu"))
|
||||||
|
except Exception as e:
|
||||||
|
print("[FINETUNE] Error loading checkpoint:", e)
|
||||||
|
raise
|
||||||
|
|
||||||
|
del checkpoint["optimizer"]
|
||||||
|
|
||||||
|
for key in list(checkpoint["model"].keys()):
|
||||||
|
if "dvae" in key:
|
||||||
|
del checkpoint["model"][key]
|
||||||
|
|
||||||
|
# Define the target directory
|
||||||
|
target_dir = this_dir / "models" / "lastfinetuned"
|
||||||
|
|
||||||
|
# Create the target directory if it doesn't exist
|
||||||
|
target_dir.mkdir(parents=True, exist_ok=True)
|
||||||
|
|
||||||
|
# Save the modified checkpoint in the target directory
|
||||||
|
torch.save(checkpoint, target_dir / "model.pth")
|
||||||
|
|
||||||
|
# Specify the files you want to copy
|
||||||
|
files_to_copy = ["vocab.json", "config.json", "dvae.pth", "mel_stats.pth"]
|
||||||
|
|
||||||
|
for file_name in files_to_copy:
|
||||||
|
src_path = this_dir / base_path / base_model_path / file_name
|
||||||
|
dest_path = target_dir / file_name
|
||||||
|
shutil.copy(str(src_path), str(dest_path))
|
||||||
|
|
||||||
|
source_wavs_dir = this_dir / "finetune" / "tmp-trn" / "wavs"
|
||||||
|
target_wavs_dir = target_dir / "wavs"
|
||||||
|
target_wavs_dir.mkdir(parents=True, exist_ok=True)
|
||||||
|
|
||||||
|
# Iterate through files in the source directory
|
||||||
|
for file_path in source_wavs_dir.iterdir():
|
||||||
|
# Check if it's a file and larger than 1000 KB
|
||||||
|
if file_path.is_file() and file_path.stat().st_size > 1000 * 1024:
|
||||||
|
# Copy the file to the target directory
|
||||||
|
shutil.copy(str(file_path), str(target_wavs_dir / file_path.name))
|
||||||
|
|
||||||
|
print("[FINETUNE] Model copied to '/models/lastfinetuned/'")
|
||||||
|
return "Model copied to '/models/lastfinetuned/'"
|
||||||
|
|
||||||
|
|
||||||
|
def compact_legacy_model():
|
||||||
|
this_dir = Path(__file__).parent.resolve()
|
||||||
|
|
||||||
|
best_model_path_str = os.path.join(this_dir, "finetune", "best_model.pth")
|
||||||
|
|
||||||
|
# Check if the best model file exists
|
||||||
|
if not os.path.exists(best_model_path_str):
|
||||||
|
print("[FINETUNE] No model called best_model.pth was found in /finetune/")
|
||||||
|
return "No model called best_model.pth was found in /finetune/"
|
||||||
|
|
||||||
|
# Convert model_path_str to Path
|
||||||
|
best_model_path = Path(best_model_path_str)
|
||||||
|
|
||||||
|
# Attempt to load the model
|
||||||
|
try:
|
||||||
|
checkpoint = torch.load(best_model_path, map_location=torch.device("cpu"))
|
||||||
|
except Exception as e:
|
||||||
|
print("[FINETUNE] Error loading checkpoint:", e)
|
||||||
|
raise
|
||||||
|
|
||||||
|
del checkpoint["optimizer"]
|
||||||
|
|
||||||
|
for key in list(checkpoint["model"].keys()):
|
||||||
|
if "dvae" in key:
|
||||||
|
del checkpoint["model"][key]
|
||||||
|
|
||||||
|
# Define the target directory
|
||||||
|
target_dir = this_dir / "finetune"
|
||||||
|
|
||||||
|
# Create the target directory if it doesn't exist
|
||||||
|
target_dir.mkdir(parents=True, exist_ok=True)
|
||||||
|
|
||||||
|
# Save the modified checkpoint in the target directory
|
||||||
|
torch.save(checkpoint, target_dir / "model.pth")
|
||||||
|
|
||||||
|
print("[FINETUNE] model.pth created in '/finetune/'")
|
||||||
|
return "model.pth created in '/finetune/'"
|
||||||
|
|
||||||
|
|
||||||
def delete_training_data():
|
def delete_training_data():
|
||||||
# Define the folder to be deleted
|
# Define the folder to be deleted
|
||||||
folder_to_delete = Path(this_dir / "finetune" / "tmp-trn")
|
folder_to_delete = Path(this_dir / "finetune" / "tmp-trn")
|
||||||
|
|
||||||
# Check if the folder exists before deleting
|
# Check if the folder exists before deleting
|
||||||
if folder_to_delete.exists():
|
if folder_to_delete.exists():
|
||||||
# Delete the folder and its contents
|
# Iterate over all files and subdirectories
|
||||||
shutil.rmtree(folder_to_delete)
|
for item in folder_to_delete.iterdir():
|
||||||
print(f"[FINETUNE] Folder {folder_to_delete} and its contents deleted successfully.")
|
# Exclude trainer_0_log.txt from deletion
|
||||||
return "Folder '/finetune/tmp-trn/' and its contents deleted successfully."
|
if item.name != "trainer_0_log.txt":
|
||||||
|
try:
|
||||||
|
if item.is_file():
|
||||||
|
item.unlink()
|
||||||
|
elif item.is_dir():
|
||||||
|
shutil.rmtree(item)
|
||||||
|
except PermissionError:
|
||||||
|
print(f"[FINETUNE] PermissionError: Could not delete {item}. Skipping.")
|
||||||
|
|
||||||
|
print(f"[FINETUNE] Folder {folder_to_delete} contents (excluding trainer_0_log.txt) deleted successfully.")
|
||||||
|
return "Folder '/finetune/tmp-trn/' contents (excluding trainer_0_log.txt) deleted successfully."
|
||||||
else:
|
else:
|
||||||
print(f"[FINETUNE] Folder {folder_to_delete} does not exist.")
|
print(f"[FINETUNE] Folder {folder_to_delete} does not exist.")
|
||||||
return "Folder '/finetune/tmp-trn/' does not exist."
|
return "Folder '/finetune/tmp-trn/' does not exist."
|
||||||
|
|
||||||
|
|
||||||
def delete_voice_sample_contents():
|
def delete_voice_sample_contents():
|
||||||
# Define the folder to be cleared
|
# Define the folder to be cleared
|
||||||
folder_to_clear = Path(this_dir / "finetune" / "put-voice-samples-in-here")
|
folder_to_clear = Path(this_dir / "finetune" / "put-voice-samples-in-here")
|
||||||
@@ -729,20 +875,21 @@ if __name__ == "__main__":
|
|||||||
f"""
|
f"""
|
||||||
## <u>Finetuning Information</u><br>
|
## <u>Finetuning Information</u><br>
|
||||||
### 🟥 <u>Important Note</u>
|
### 🟥 <u>Important Note</u>
|
||||||
#### 🟥 <span style="color: #3366ff;">finetune.py</span> needs to be run from the <span style="color: #3366ff;">/alltalk_tts/</span> folder. Don't move the location of this script.
|
#### - <span style="color: #3366ff;">finetune.py</span> needs to be run from the <span style="color: #3366ff;">/alltalk_tts/</span> folder. Don't move the location of this script.
|
||||||
#### 🟥 Have you run AllTalk at least once? It needs to have downloaded+updated the voice model, before we can finetune it.
|
#### - Have you run AllTalk at least once? It needs to have downloaded+updated the voice model, before we can finetune it.
|
||||||
### 🟦 <u>What you need to run finetuning</u>
|
### 🟦 <u>What you need to run finetuning</u>
|
||||||
#### 🟦 An Nvidia GPU. Tested on Windows with extended shared VRAM and training used about 16GB's total (which worked on a 12GB card).
|
#### - An Nvidia GPU. Tested on Windows with extended shared VRAM and training used about 16GB's total (which worked on a 12GB card).
|
||||||
#### 🟦 I have not been able to test this on a GPU with less than 12GB of VRAM, so cannot say if it will work or how that would affect performance.
|
#### - If you have multiple Nvidia GPU's in your system, please see this [important note](https://github.com/erew123/alltalk_tts#-i-have-multiple-gpus-and-i-have-problems-running-finetuning).
|
||||||
#### 🟦 <span style="color: red;">Version 11.8</span> of Nvidia cuBLAS and cuDNN (guide below). Only 11.8 of cuBLAS and cuDNN work for this process currently.
|
#### - I have not been able to test this on a GPU with less than 12GB of VRAM, so cannot say if it will work or how that would affect performance.
|
||||||
#### 🟦 Minimum <span style="color: red;">18GB</span> free disk space (most of it is used temporarily).
|
#### - <span style="color: red;">Version 11.8</span> of Nvidia cuBLAS and cuDNN (guide below). Only 11.8 of cuBLAS and cuDNN work for this process currently.
|
||||||
#### 🟦 Some decent quality audio, multiple files if you like. Minimum of 2 minutes and Ive tested up to 20 minutes of audio.
|
#### - Minimum <span style="color: red;">18GB</span> free disk space (most of it is used temporarily).
|
||||||
#### 🟦 There is no major need to chop down your audio files into small slices as Step 1 will do that for you automatically and prepare the training set. Ive been testing with 5 minute long clips.
|
#### - Some decent quality audio, multiple files if you like. Minimum of 2 minutes and Ive tested up to 20 minutes of audio.
|
||||||
#### 🟦 This process will need access to all your GPU and VRAM, so close any other software that's using your GPU currently.
|
#### - There is no major need to chop down your audio files into small slices as Step 1 will do that for you automatically and prepare the training set. Ive been testing with 5 minute long clips.
|
||||||
|
#### - This process will need access to all your GPU and VRAM, so close any other software that's using your GPU currently.
|
||||||
### 🟨 <u>Setting up cuBLAS and cuDNN <span style="color: red;">Version 11.8</span></u>
|
### 🟨 <u>Setting up cuBLAS and cuDNN <span style="color: red;">Version 11.8</span></u>
|
||||||
#### 🟨 If you have the <span style="color: #3366ff;;">Nvidia CUDA Toolkit Version 11.8</span> installed and can type <span style="color: #3366ff;;">nvcc --version</span> at the command prompt/terminal and it reports <span style="color: #00a000;">Cuda compilation tools, release 11.8</span> you should be good to go.
|
#### - If you have the <span style="color: #3366ff;;">Nvidia CUDA Toolkit Version 11.8</span> installed and can type <span style="color: #3366ff;;">nvcc --version</span> at the command prompt/terminal and it reports <span style="color: #00a000;">Cuda compilation tools, release 11.8</span> you should be good to go.
|
||||||
#### 🟨 If you dont have the toolkit installed, the idea is just to install the smallest bit possible and this will not affect or impact other things on your system.
|
#### - If you dont have the toolkit installed, the idea is just to install the smallest bit possible and this will not affect or impact other things on your system.
|
||||||
#### 🟨 You will need to download the Nvidia Cuda Toolkit 11.8<span style="color: #3366ff;"> network</span> install from [here](https://developer.nvidia.com/cuda-11-8-0-download-archive)
|
#### - You will need to download the Nvidia Cuda Toolkit 11.8<span style="color: #3366ff;"> network</span> install from [here](https://developer.nvidia.com/cuda-11-8-0-download-archive)
|
||||||
#### 1) Run the installer and select <span style="color: #3366ff;">Custom Advanced</span> Uncheck <span style="color: #3366ff;">everything</span> at the top then expand <span style="color: #3366ff;">CUDA</span>, <span style="color: #3366ff;">Development</span> > <span style="color: #3366ff;">Compiler</span> > and select <span style="color: #3366ff;;">nvcc</span> then expand <span style="color: #3366ff;;">Libraries</span> and select <span style="color: #3366ff;;">CUBLAS</span>.
|
#### 1) Run the installer and select <span style="color: #3366ff;">Custom Advanced</span> Uncheck <span style="color: #3366ff;">everything</span> at the top then expand <span style="color: #3366ff;">CUDA</span>, <span style="color: #3366ff;">Development</span> > <span style="color: #3366ff;">Compiler</span> > and select <span style="color: #3366ff;;">nvcc</span> then expand <span style="color: #3366ff;;">Libraries</span> and select <span style="color: #3366ff;;">CUBLAS</span>.
|
||||||
#### 2) Back at the top of <span style="color: #3366ff;">CUDA</span>, expand <span style="color: #3366ff;">Runtime</span> > <span style="color: #3366ff;">Libraries</span> and select <span style="color: #3366ff;">CUBLAS</span>. Click <span style="color: #3366ff;;">Next</span>, accept the default path (taking a note of its location) and let the install run.
|
#### 2) Back at the top of <span style="color: #3366ff;">CUDA</span>, expand <span style="color: #3366ff;">Runtime</span> > <span style="color: #3366ff;">Libraries</span> and select <span style="color: #3366ff;">CUBLAS</span>. Click <span style="color: #3366ff;;">Next</span>, accept the default path (taking a note of its location) and let the install run.
|
||||||
#### 3) You should be able to drop to your terminal or command prompt and type <span style="color: #3366ff;">nvcc --version</span> and have it report <span style="color: #00a000;">Cuda compilation tools, release 11.8</span>. If it does you are good to go. If it doesn't > Step 4.
|
#### 3) You should be able to drop to your terminal or command prompt and type <span style="color: #3366ff;">nvcc --version</span> and have it report <span style="color: #00a000;">Cuda compilation tools, release 11.8</span>. If it does you are good to go. If it doesn't > Step 4.
|
||||||
@@ -766,16 +913,16 @@ if __name__ == "__main__":
|
|||||||
f"""
|
f"""
|
||||||
## <u>STEP 1 - Preparing Audio/Generating the dataset</u><br>
|
## <u>STEP 1 - Preparing Audio/Generating the dataset</u><br>
|
||||||
### 🟦 <u>What you need to do</u>
|
### 🟦 <u>What you need to do</u>
|
||||||
#### 🟦 Please read Coqui's guide on what makes a good dataset [here](https://docs.coqui.ai/en/latest/what_makes_a_good_dataset.html#what-makes-a-good-dataset)
|
#### - Please read Coqui's guide on what makes a good dataset [here](https://docs.coqui.ai/en/latest/what_makes_a_good_dataset.html#what-makes-a-good-dataset)
|
||||||
#### 🟦 Place your audio files in <span style="color: #3366ff;">{str(audio_folder)}</span>
|
#### - Place your audio files in <span style="color: #3366ff;">{str(audio_folder)}</span>
|
||||||
#### 🟦 Your audio samples can be in the format <span style="color: #3366ff;">mp3, wav,</span> or <span style="color: #3366ff;">flac.</span>
|
#### - Your audio samples can be in the format <span style="color: #3366ff;">mp3, wav,</span> or <span style="color: #3366ff;">flac.</span>
|
||||||
#### 🟦 You will need a minimum of <span style="color: #3366ff;">2 minutes</span> of audio in either one or multiple audio files.
|
#### - You will need a minimum of <span style="color: #3366ff;">2 minutes</span> of audio in either one or multiple audio files. Very small sample files cause errors, so I would suggest 30 seconds and longer samples.
|
||||||
#### 🟦 When you have completed Steps 1, 2, and 3, you are welcome to delete your samples from "put-voice-samples-in-here".<br>
|
#### - When you have completed Steps 1, 2, and 3, you are welcome to delete your samples from "put-voice-samples-in-here".<br>
|
||||||
### 🟨 <u>What this step is doing</u>
|
### 🟨 <u>What this step is doing</u>
|
||||||
#### 🟨 With step one, we are going to be stripping your audio file(s) into smaller files, using Whisper to find spoken words/sentences, compile that into excel sheets of training data, ready for finetuning the model on Step 2.
|
#### - With step one, we are going to be stripping your audio file(s) into smaller files, using Whisper to find spoken words/sentences, compile that into excel sheets of training data, ready for finetuning the model on Step 2.
|
||||||
#### 🟨 Whilst you can choose multiple Whisper models, its best only to use the 1 model as each one is about 3GB in size and will download to your local huggingface cache on first-time use. If and when you have completed training, you wish to delete this 3GB model from your system, you are welcome to do so.
|
#### - Whilst you can choose multiple Whisper models, its best only to use the 1 model as each one is about 3GB in size and will download to your local huggingface cache on first-time use. If and when you have completed training, you wish to delete this 3GB model from your system, you are welcome to do so.
|
||||||
### 🟩 <u>How long will this take?</u>
|
### 🟩 <u>How long will this take?</u>
|
||||||
#### 🟩 First time, it needs to download the Whisper model which is 3GB. After that a few minutes on an average 3-4 year old system.
|
#### - First time, it needs to download the Whisper model which is 3GB. After that a few minutes on an average 3-4 year old system.
|
||||||
"""
|
"""
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -784,7 +931,7 @@ if __name__ == "__main__":
|
|||||||
value=out_path,
|
value=out_path,
|
||||||
visible=False,
|
visible=False,
|
||||||
)
|
)
|
||||||
|
with gr.Row():
|
||||||
whisper_model = gr.Dropdown(
|
whisper_model = gr.Dropdown(
|
||||||
label="Whisper Model",
|
label="Whisper Model",
|
||||||
value="large-v3",
|
value="large-v3",
|
||||||
@@ -863,23 +1010,24 @@ if __name__ == "__main__":
|
|||||||
f"""
|
f"""
|
||||||
## <u>STEP 2 - Fine-tuning the XTTS Encoder</u><br>
|
## <u>STEP 2 - Fine-tuning the XTTS Encoder</u><br>
|
||||||
### 🟦 <u>What you need to do</u>
|
### 🟦 <u>What you need to do</u>
|
||||||
#### 🟦 The <span style="color: #3366ff;">Train CSV</span> and <span style="color: #3366ff;">Eval CSV</span> should already be populated. If not, just go back to Step 1 and click the button again.
|
#### - The <span style="color: #3366ff;">Train CSV</span> and <span style="color: #3366ff;">Eval CSV</span> should already be populated. If not, just go back to Step 1 and click the button again.
|
||||||
#### 🟦 If for any reason it crashed, close the app and re-start the finetuning and kick it off again, clicking through setp 1 (it doesnt need to regenerate the data)
|
#### - If for any reason it crashed, close the app and re-start the finetuning and kick it off again, clicking through setp 1 (it doesnt need to regenerate the data)
|
||||||
#### 🟦 The settings below are factory and should be ok.<br>
|
#### - The settings below are factory and should be ok.<br>
|
||||||
### 🟨 <u>What this step is doing</u>
|
### 🟨 <u>What this step is doing</u>
|
||||||
#### 🟨 Very simply put, it's taking all our wav files generated in Step 1, along with our recorded speech in out excel documents and its training the model on that voice.
|
#### - Very simply put, it's taking all our wav files generated in Step 1, along with our recorded speech in out excel documents and its training the model on that voice.
|
||||||
### 🟩 <u>How long will this take?</u>
|
### 🟩 <u>How long will this take?</u>
|
||||||
#### 🟩 On a RTX 4070 with factory settings (as below) and 20 minutes of audio, this took 20 minutes. Again, it will vary by system and how much audio you are throwing at it. You have time to go make a coffee.
|
#### - On a RTX 4070 with factory settings (as below) and 20 minutes of audio, this took 20 minutes. Again, it will vary by system and how much audio you are throwing at it. You have time to go make a coffee.
|
||||||
#### 🟩 Look at your command prompt/terminal window if you want to see what it is doing.
|
#### - Look at your command prompt/terminal window if you want to see what it is doing.
|
||||||
"""
|
"""
|
||||||
)
|
)
|
||||||
|
with gr.Row():
|
||||||
train_csv = gr.Textbox(
|
train_csv = gr.Textbox(
|
||||||
label="Train CSV:",
|
label="Train CSV:",
|
||||||
)
|
)
|
||||||
eval_csv = gr.Textbox(
|
eval_csv = gr.Textbox(
|
||||||
label="Eval CSV:",
|
label="Eval CSV:",
|
||||||
)
|
)
|
||||||
|
with gr.Row():
|
||||||
num_epochs = gr.Slider(
|
num_epochs = gr.Slider(
|
||||||
label="Number of epochs:",
|
label="Number of epochs:",
|
||||||
minimum=1,
|
minimum=1,
|
||||||
@@ -908,6 +1056,21 @@ if __name__ == "__main__":
|
|||||||
step=1,
|
step=1,
|
||||||
value=args.max_audio_length,
|
value=args.max_audio_length,
|
||||||
)
|
)
|
||||||
|
with gr.Row():
|
||||||
|
model_to_train_choices = ["Base Model"]
|
||||||
|
if finetuned_model:
|
||||||
|
model_to_train_choices.append("Existing finetuned model")
|
||||||
|
model_to_train = gr.Radio(
|
||||||
|
choices=model_to_train_choices,
|
||||||
|
label="Which model do you want to train?",
|
||||||
|
value="Base Model"
|
||||||
|
)
|
||||||
|
gr.Markdown(
|
||||||
|
f"""
|
||||||
|
##### If you have an existing finetuned model in <span style="color: #3366ff;">/models/trainedmodel/</span> you will have an option to select <span style="color: #3366ff;">Existing finetuned model</span>, allowing you to further train it. Otherwise, you will only have Base Model as an option.
|
||||||
|
"""
|
||||||
|
)
|
||||||
|
|
||||||
progress_train = gr.Label(
|
progress_train = gr.Label(
|
||||||
label="Progress:"
|
label="Progress:"
|
||||||
)
|
)
|
||||||
@@ -949,16 +1112,16 @@ if __name__ == "__main__":
|
|||||||
f"""
|
f"""
|
||||||
## <u>STEP 3 - Inference/Testing</u><br>
|
## <u>STEP 3 - Inference/Testing</u><br>
|
||||||
### 🟥 <u>Important Note</u>
|
### 🟥 <u>Important Note</u>
|
||||||
#### 🟥 This step will error if you are using TTS version 0.22.0. Please re-run <span style="color: #3366ff;">pip install -r requirements_finetune.txt</span> if it errors loading the model.
|
#### - This step will error if you are using TTS version 0.22.0. Please re-run <span style="color: #3366ff;">pip install -r requirements_finetune.txt</span> if it errors loading the model.
|
||||||
#### 🟥 If you dont see multiple speaker reference files and you used more than 3 minutes of speech, try refreshing the page as it may not have loaded them correctly.
|
#### - If you dont see multiple speaker reference files and you used more than 3 minutes of speech, try refreshing the page as it may not have loaded them correctly.
|
||||||
### 🟦 <u>What you need to do</u>
|
### 🟦 <u>What you need to do</u>
|
||||||
#### 🟦 The model is now trained and you are at the testing stage. Hopefully all the dropdowns should be pre-populated now.
|
#### - The model is now trained and you are at the testing stage. Hopefully all the dropdowns should be pre-populated now.
|
||||||
#### 🟦 You need to <span style="color: #3366ff;">Load Fine-tuned XTTS model</span> and then select your <span style="color: #3366ff;">Speaker Reference Audio</span>. You can choose various <span style="color: #3366ff;">Speaker Reference Audios</span> to see which works best.
|
#### - You need to <span style="color: #3366ff;">Load Fine-tuned XTTS model</span> and then select your <span style="color: #3366ff;">Speaker Reference Audio</span>. You can choose various <span style="color: #3366ff;">Speaker Reference Audios</span> to see which works best.
|
||||||
#### 🟦 All the <span style="color: #3366ff;">Speaker Reference Audios</span> in the dropdown are ones that are <span style="color: #3366ff;">8 seconds</span> long or more. You can use one of these later for your voice sample in All Talk, so remember the one you like.
|
#### - All the <span style="color: #3366ff;">Speaker Reference Audios</span> in the dropdown are ones that are <span style="color: #3366ff;">8 seconds</span> long or more. You can use one of these later for your voice sample in All Talk, so remember the one you like.
|
||||||
#### 🟦 Some <span style="color: #3366ff;">Speaker Reference Audios</span> are a bit long and may cause issues generating the TTS, so try different ones.
|
#### - Some <span style="color: #3366ff;">Speaker Reference Audios</span> are a bit long and may cause issues generating the TTS, so try different ones.
|
||||||
#### 🟦 Once you are happy, move to the next tab for instruction on cleaning out the training data and how to copy your newly trained model over your current model.
|
#### - Once you are happy, move to the next tab for instruction on cleaning out the training data and how to copy your newly trained model over your current model.
|
||||||
### 🟨 <u>What this step is doing</u>
|
### 🟨 <u>What this step is doing</u>
|
||||||
#### 🟨 Its loading the finetuned model into memory, loading a voice sample and generating TTS, so that you can test out how well fine tuning worked.
|
#### - Its loading the finetuned model into memory, loading a voice sample and generating TTS, so that you can test out how well fine tuning worked.
|
||||||
"""
|
"""
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -1051,25 +1214,57 @@ if __name__ == "__main__":
|
|||||||
f"""
|
f"""
|
||||||
## <u>What to do next</u><br>
|
## <u>What to do next</u><br>
|
||||||
### 🟦 <u>What you need to do</u>
|
### 🟦 <u>What you need to do</u>
|
||||||
#### 🟦 There are 3x buttons below:
|
#### - You have a few options below:
|
||||||
#### 🔹 Compact & move model. This will compress the trained model and move it, along with any large enough wav files created to <span style="color: #3366ff;">/models/trainedmodel/</span>. You can use the wav files as sample voices..
|
#### 🔹 Compact & move model. This will compress the raw finetuned model and move it, along with any large enough wav files created to one of two locations (please read text next to the button).<br> You can use the wav files in that location as sample voices with your model. Models moved to <span style="color: #3366ff;">/models/trainedmodel/</span> will be loadable within Text-gen-webui on the <span style="color: #3366ff;">XTTSv2 FT</span> loader.
|
||||||
#### 🔹 Delete Generated Training data. This will delete the finetuned model and any other training data generated during this process. You will more than likely want to do this after you have Compacted & moved the model.
|
#### 🔹 Delete Generated Training data. This will delete the finetuned model and any other training data generated during this process. You will more than likely want to do this after you have Compacted & moved the model.
|
||||||
#### 🔹 Delete original voice samples. This will delete the voice samples you placed in put-voice-samples-in-here (if you no longer have a use for them).
|
#### 🔹 Delete original voice samples. This will delete the voice samples you placed in put-voice-samples-in-here (if you no longer have a use for them).
|
||||||
#### 🟦 I will at some point add an option within AllTalk to load a finetuned model as a seperate model. However, for now, you will have to copy it over the model in the <span style="color: #3366ff;">/models/xttsv2_2.0.2/</span> model, if you wish to use it.
|
#### 🔹 Compress a legacy finetuned model. For any models that were generated pre the current version of finetuning, you can still compact them down.
|
||||||
#### 🟦 If you wish to further train this model, you will also need to copy it over the model in the <span style="color: #3366ff;">/models/xttsv2_2.0.2/</span> model folder..
|
#### - Instructions on using the finetuned model in Text-generation-webui and also further tuning this model you just created are on <span style="color: #3366ff;">OPTION A - Compact and move model to '/trainedmodel/'</span>.
|
||||||
### 🟨 <u>Clearing up disk space</u>
|
### 🟨 <u>Clearing up disk space</u>
|
||||||
#### 🟨 If you are not going to train anything again, you can delete the whisper model from inside of your huggingface cache (3GB approx)
|
#### - If you are not going to train anything again, you can delete the whisper model from inside of your huggingface cache (3GB approx)
|
||||||
#### Linux <span style="color: #3366ff;">~/.cache/huggingface/hub/(folder-here)</span>
|
#### Linux <span style="color: #3366ff;">~/.cache/huggingface/hub/(folder-here)</span>
|
||||||
#### Windows <span style="color: #3366ff;">C:\users(your-username)\.cache\huggingface\hub\(folder-here)</span>.
|
#### Windows <span style="color: #3366ff;">C:\users(your-username)\.cache\huggingface\hub\(folder-here)</span>.
|
||||||
#### 🟨 You can also uninstall the Nvidia CUDA 11.8 Toolkit if you wish and remove your environment variable entries.
|
#### - You can also uninstall the Nvidia CUDA 11.8 Toolkit if you wish and remove your environment variable entries.
|
||||||
"""
|
"""
|
||||||
)
|
)
|
||||||
final_progress_data = gr.Label(
|
final_progress_data = gr.Label(
|
||||||
label="Progress:"
|
label="Progress:"
|
||||||
)
|
)
|
||||||
compact_btn = gr.Button(value="Compact and move model to '/models/trainedmodel/' (THIS WILL OVER-WRITE ANY MODEL IN THAT LOCATION)")
|
with gr.Row():
|
||||||
|
compact_btn = gr.Button(value="OPTION A - Compact and move model to '/trainedmodel/'")
|
||||||
|
gr.Markdown(
|
||||||
|
f"""
|
||||||
|
##### This will compact the model and move it, along with the reference wav's to <span style="color: #3366ff;">/models/trainedmodel/</span> and will <span style="color: red;">OVERWRITE</span> any model in that location. This model will become available to load in Text-gen-webui with the <span style="color: #3366ff;">XTTSv2 FT</span> loader. It will also be detected by Finetune as a model that can be further trained (Reload finetune.py).
|
||||||
|
"""
|
||||||
|
)
|
||||||
|
with gr.Row():
|
||||||
|
compact_lastfinetuned_btn = gr.Button(value="OPTION B - Compact and move model to '/lastfinetuned/'")
|
||||||
|
gr.Markdown(
|
||||||
|
f"""
|
||||||
|
##### This will compact the model and move it, along with the reference wav's to <span style="color: #3366ff;">/models/lastfinetuned/</span> and will <span style="color: red;">OVERWRITE</span> any model in that location. This will just leave you a finetuned model that you can do with as you please. It will <span style="color: red;">NOT</span> be available in Text-gen-webui unless you copy it over one of the other model loader locations.
|
||||||
|
"""
|
||||||
|
)
|
||||||
|
with gr.Row():
|
||||||
delete_training_btn = gr.Button(value="Delete generated training data")
|
delete_training_btn = gr.Button(value="Delete generated training data")
|
||||||
|
gr.Markdown(
|
||||||
|
f"""
|
||||||
|
##### This will <span style="color: red;">DELETE</span> your training data and the raw finetuned model from <span style="color: #3366ff;">/finetune/tmp-trn/</span>.
|
||||||
|
"""
|
||||||
|
)
|
||||||
|
with gr.Row():
|
||||||
delete_voicesamples_btn = gr.Button(value="Delete original voice samples")
|
delete_voicesamples_btn = gr.Button(value="Delete original voice samples")
|
||||||
|
gr.Markdown(
|
||||||
|
f"""
|
||||||
|
##### This will <span style="color: red;">DELETE</span> your original voice samples from <span style="color: #3366ff;">/finetune/put-voice-samples-in-here/</span>.
|
||||||
|
"""
|
||||||
|
)
|
||||||
|
with gr.Row():
|
||||||
|
compact_legacy_btn = gr.Button(value="Compact a legacy finetuned model")
|
||||||
|
gr.Markdown(
|
||||||
|
f"""
|
||||||
|
##### This will compact your old finetuned models from 5GB to 1.9GB. Place your 5GB <span style="color: #3366ff;">base_model.pth</span> file in <span style="color: #3366ff;">/finetune/</span> (rename your file to <span style="color: #3366ff;">base_model.pth</span> if necessary). This will generate you a <span style="color: #3366ff;">model.pth</span> file.
|
||||||
|
"""
|
||||||
|
)
|
||||||
|
|
||||||
prompt_compute_btn.click(
|
prompt_compute_btn.click(
|
||||||
fn=preprocess_dataset,
|
fn=preprocess_dataset,
|
||||||
@@ -1125,6 +1320,10 @@ if __name__ == "__main__":
|
|||||||
fn=compact_model,
|
fn=compact_model,
|
||||||
outputs=[final_progress_data],
|
outputs=[final_progress_data],
|
||||||
)
|
)
|
||||||
|
compact_lastfinetuned_btn.click(
|
||||||
|
fn=compact_lastfinetuned_model,
|
||||||
|
outputs=[final_progress_data],
|
||||||
|
)
|
||||||
delete_training_btn.click(
|
delete_training_btn.click(
|
||||||
fn=delete_training_data,
|
fn=delete_training_data,
|
||||||
outputs=[final_progress_data],
|
outputs=[final_progress_data],
|
||||||
@@ -1133,6 +1332,11 @@ if __name__ == "__main__":
|
|||||||
fn=delete_voice_sample_contents,
|
fn=delete_voice_sample_contents,
|
||||||
outputs=[final_progress_data],
|
outputs=[final_progress_data],
|
||||||
)
|
)
|
||||||
|
compact_legacy_btn.click(
|
||||||
|
fn=compact_legacy_model,
|
||||||
|
outputs=[final_progress_data],
|
||||||
|
)
|
||||||
|
model_to_train.change(basemodel_or_finetunedmodel_choice, model_to_train, None)
|
||||||
|
|
||||||
demo.queue().launch(
|
demo.queue().launch(
|
||||||
show_api=False,
|
show_api=False,
|
||||||
|
|||||||
@@ -8,6 +8,7 @@
|
|||||||
"model.pth": "https://huggingface.co/coqui/XTTS-v2/resolve/v2.0.2/model.pth?download=true",
|
"model.pth": "https://huggingface.co/coqui/XTTS-v2/resolve/v2.0.2/model.pth?download=true",
|
||||||
"dvae.pth": "https://huggingface.co/coqui/XTTS-v2/resolve/v2.0.2/dvae.pth?download=true",
|
"dvae.pth": "https://huggingface.co/coqui/XTTS-v2/resolve/v2.0.2/dvae.pth?download=true",
|
||||||
"mel_stats.pth": "https://huggingface.co/coqui/XTTS-v2/resolve/v2.0.2/mel_stats.pth?download=true",
|
"mel_stats.pth": "https://huggingface.co/coqui/XTTS-v2/resolve/v2.0.2/mel_stats.pth?download=true",
|
||||||
|
"speakers_xtts.pth": "https://huggingface.co/coqui/XTTS-v2/resolve/v2.0.2/speakers_xtts.pth?download=true",
|
||||||
"vocab.json": "https://huggingface.co/coqui/XTTS-v2/resolve/v2.0.2/vocab.json?download=true"
|
"vocab.json": "https://huggingface.co/coqui/XTTS-v2/resolve/v2.0.2/vocab.json?download=true"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -11,3 +11,5 @@ tqdm>=4.66.1
|
|||||||
importlib-metadata>=4.8.1
|
importlib-metadata>=4.8.1
|
||||||
packaging>=23.2
|
packaging>=23.2
|
||||||
pydantic>=1.10.13
|
pydantic>=1.10.13
|
||||||
|
sounddevice>=0.4.6
|
||||||
|
python-multipart>=0.0.6
|
||||||
@@ -11,3 +11,5 @@ tqdm>=4.66.1
|
|||||||
importlib-metadata>=4.8.1
|
importlib-metadata>=4.8.1
|
||||||
packaging>=23.2
|
packaging>=23.2
|
||||||
pydantic>=1.10.13
|
pydantic>=1.10.13
|
||||||
|
sounddevice>=0.4.6
|
||||||
|
python-multipart>=0.0.6
|
||||||
@@ -77,6 +77,8 @@ with open(this_dir / "languages.json", encoding="utf8") as f:
|
|||||||
languages = json.load(f)
|
languages = json.load(f)
|
||||||
# Create a global lock
|
# Create a global lock
|
||||||
process_lock = threading.Lock()
|
process_lock = threading.Lock()
|
||||||
|
# Base setting for a possible FineTuned model existing and the loader being available
|
||||||
|
tts_method_xtts_ft = False
|
||||||
|
|
||||||
# Gather the voice files
|
# Gather the voice files
|
||||||
def get_available_voices():
|
def get_available_voices():
|
||||||
@@ -139,10 +141,23 @@ def check_required_files():
|
|||||||
subprocess.run(["python", str(download_script_path)])
|
subprocess.run(["python", str(download_script_path)])
|
||||||
print(f"[{params['branding']}Startup] All required files are present.")
|
print(f"[{params['branding']}Startup] All required files are present.")
|
||||||
|
|
||||||
|
|
||||||
# STARTUP Call Check routine
|
# STARTUP Call Check routine
|
||||||
check_required_files()
|
check_required_files()
|
||||||
|
|
||||||
|
##################################################
|
||||||
|
#### Check to see if a finetuned model exists ####
|
||||||
|
##################################################
|
||||||
|
# Set the path to the directory
|
||||||
|
trained_model_directory = this_dir / "models" / "trainedmodel"
|
||||||
|
# Check if the directory "trainedmodel" exists
|
||||||
|
finetuned_model = trained_model_directory.exists()
|
||||||
|
# If the directory exists, check for the existence of the required files
|
||||||
|
# If true, this will add a extra option in the Gradio interface for loading Xttsv2 FT
|
||||||
|
if finetuned_model:
|
||||||
|
required_files = ["model.pth", "config.json", "vocab.json"]
|
||||||
|
finetuned_model = all((trained_model_directory / file).exists() for file in required_files)
|
||||||
|
if finetuned_model:
|
||||||
|
print(f"[{params['branding']}Startup] Finetuned model \033[93mDetected\033[0m")
|
||||||
|
|
||||||
####################################################
|
####################################################
|
||||||
#### SET GRADIO BUTTONS BASED ON confignew.json ####
|
#### SET GRADIO BUTTONS BASED ON confignew.json ####
|
||||||
@@ -252,7 +267,7 @@ else:
|
|||||||
timeout = 120 # Adjust the timeout as needed
|
timeout = 120 # Adjust the timeout as needed
|
||||||
|
|
||||||
# Introduce a delay before starting the check loop
|
# Introduce a delay before starting the check loop
|
||||||
time.sleep(25) # Wait 25 secs before checking if the tts_server.py has started up.
|
time.sleep(26) # Wait 26 secs before checking if the tts_server.py has started up.
|
||||||
start_time = time.time()
|
start_time = time.time()
|
||||||
while time.time() - start_time < timeout:
|
while time.time() - start_time < timeout:
|
||||||
try:
|
try:
|
||||||
@@ -264,7 +279,7 @@ while time.time() - start_time < timeout:
|
|||||||
print(
|
print(
|
||||||
f"[{params['branding']}Startup] \033[91mWarning\033[0m TTS Subprocess has NOT started up yet, Will keep trying for 120 seconds maximum. Please wait."
|
f"[{params['branding']}Startup] \033[91mWarning\033[0m TTS Subprocess has NOT started up yet, Will keep trying for 120 seconds maximum. Please wait."
|
||||||
)
|
)
|
||||||
time.sleep(1)
|
time.sleep(4)
|
||||||
else:
|
else:
|
||||||
print(
|
print(
|
||||||
f"[{params['branding']}Startup] Startup timed out. Check the server logs for more information."
|
f"[{params['branding']}Startup] Startup timed out. Check the server logs for more information."
|
||||||
@@ -272,11 +287,13 @@ else:
|
|||||||
# Cleanly kill off this script, but allow text-generation-webui to keep running, albeit without this alltalk_tts
|
# Cleanly kill off this script, but allow text-generation-webui to keep running, albeit without this alltalk_tts
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
|
|
||||||
#####################################
|
#####################################
|
||||||
#### MODEL LOADING AND UNLOADING ####
|
#### MODEL LOADING AND UNLOADING ####
|
||||||
#####################################
|
#####################################
|
||||||
# MODEL - Swap model based on Gradio selection API TTS, API Local, XTTSv2 Local
|
# MODEL - Swap model based on Gradio selection API TTS, API Local, XTTSv2 Local
|
||||||
def send_reload_request(tts_method):
|
def send_reload_request(tts_method):
|
||||||
|
global tts_method_xtts_ft
|
||||||
try:
|
try:
|
||||||
params["tts_model_loaded"] = False
|
params["tts_model_loaded"] = False
|
||||||
url = f"{base_url}/api/reload"
|
url = f"{base_url}/api/reload"
|
||||||
@@ -295,17 +312,26 @@ def send_reload_request(tts_method):
|
|||||||
params["tts_method_api_tts"] = True
|
params["tts_method_api_tts"] = True
|
||||||
params["deepspeed_activate"] = False
|
params["deepspeed_activate"] = False
|
||||||
audio_path = this_dir / "templates" / "apitts.wav"
|
audio_path = this_dir / "templates" / "apitts.wav"
|
||||||
|
tts_method_xtts_ft = False
|
||||||
elif tts_method == "API Local":
|
elif tts_method == "API Local":
|
||||||
params["tts_method_api_tts"] = False
|
params["tts_method_api_tts"] = False
|
||||||
params["tts_method_xtts_local"] = False
|
params["tts_method_xtts_local"] = False
|
||||||
params["tts_method_api_local"] = True
|
params["tts_method_api_local"] = True
|
||||||
params["deepspeed_activate"] = False
|
params["deepspeed_activate"] = False
|
||||||
audio_path = this_dir / "templates" / "apilocal.wav"
|
audio_path = this_dir / "templates" / "apilocal.wav"
|
||||||
|
tts_method_xtts_ft = False
|
||||||
elif tts_method == "XTTSv2 Local":
|
elif tts_method == "XTTSv2 Local":
|
||||||
params["tts_method_api_tts"] = False
|
params["tts_method_api_tts"] = False
|
||||||
params["tts_method_api_local"] = False
|
params["tts_method_api_local"] = False
|
||||||
params["tts_method_xtts_local"] = True
|
params["tts_method_xtts_local"] = True
|
||||||
audio_path = this_dir / "templates" / "xttslocal.wav"
|
audio_path = this_dir / "templates" / "xttslocal.wav"
|
||||||
|
tts_method_xtts_ft = False
|
||||||
|
elif tts_method == "XTTSv2 FT":
|
||||||
|
params["tts_method_api_tts"] = False
|
||||||
|
params["tts_method_api_local"] = False
|
||||||
|
params["tts_method_xtts_local"] = False
|
||||||
|
audio_path = this_dir / "templates" / "xttsfinetuned.wav"
|
||||||
|
tts_method_xtts_ft = True
|
||||||
return f'<audio src="file/{audio_path}" controls autoplay></audio>'
|
return f'<audio src="file/{audio_path}" controls autoplay></audio>'
|
||||||
except requests.exceptions.RequestException as e:
|
except requests.exceptions.RequestException as e:
|
||||||
# Handle the HTTP request error
|
# Handle the HTTP request error
|
||||||
@@ -483,8 +509,53 @@ def voice_preview(string):
|
|||||||
return f"[{params['branding']}Server] Audio generation failed. Status: {generate_response.get('status')}"
|
return f"[{params['branding']}Server] Audio generation failed. Status: {generate_response.get('status')}"
|
||||||
|
|
||||||
|
|
||||||
def replace_asterisk(match):
|
def process_text(text):
|
||||||
return match.group(0) + '"<*'
|
# Normalize HTML encoded quotes
|
||||||
|
text = html.unescape(text)
|
||||||
|
|
||||||
|
# Replace ellipsis with a single dot
|
||||||
|
text = re.sub(r'\.{3,}', '.', text)
|
||||||
|
|
||||||
|
# Pattern to identify combined narrator and character speech
|
||||||
|
combined_pattern = r'(\*[^*"]+\*|"[^"*]+")'
|
||||||
|
|
||||||
|
# List to hold parts of speech along with their type
|
||||||
|
ordered_parts = []
|
||||||
|
|
||||||
|
# Track the start of the next segment
|
||||||
|
start = 0
|
||||||
|
|
||||||
|
# Find all matches
|
||||||
|
for match in re.finditer(combined_pattern, text):
|
||||||
|
# Add the text before the match, if any, as ambiguous
|
||||||
|
if start < match.start():
|
||||||
|
ambiguous_text = text[start:match.start()].strip()
|
||||||
|
if ambiguous_text:
|
||||||
|
ordered_parts.append(('ambiguous', ambiguous_text))
|
||||||
|
|
||||||
|
# Add the matched part as either narrator or character
|
||||||
|
matched_text = match.group(0)
|
||||||
|
if matched_text.startswith('*') and matched_text.endswith('*'):
|
||||||
|
ordered_parts.append(('narrator', matched_text.strip('*').strip()))
|
||||||
|
elif matched_text.startswith('"') and matched_text.endswith('"'):
|
||||||
|
ordered_parts.append(('character', matched_text.strip('"').strip()))
|
||||||
|
else:
|
||||||
|
# In case of mixed or improperly formatted parts
|
||||||
|
if '*' in matched_text:
|
||||||
|
ordered_parts.append(('narrator', matched_text.strip('*').strip('"')))
|
||||||
|
else:
|
||||||
|
ordered_parts.append(('character', matched_text.strip('"').strip('*')))
|
||||||
|
|
||||||
|
# Update the start of the next segment
|
||||||
|
start = match.end()
|
||||||
|
|
||||||
|
# Add any remaining text after the last match as ambiguous
|
||||||
|
if start < len(text):
|
||||||
|
ambiguous_text = text[start:].strip()
|
||||||
|
if ambiguous_text:
|
||||||
|
ordered_parts.append(('ambiguous', ambiguous_text))
|
||||||
|
|
||||||
|
return ordered_parts
|
||||||
|
|
||||||
#################################
|
#################################
|
||||||
#### TTS STANDARD GENERATION ####
|
#### TTS STANDARD GENERATION ####
|
||||||
@@ -494,7 +565,7 @@ def output_modifier(string, state):
|
|||||||
if not params["activate"]:
|
if not params["activate"]:
|
||||||
return string
|
return string
|
||||||
original_string = string
|
original_string = string
|
||||||
print("ORGINAL STRING: ", original_string)
|
#print("ORIGINAL STRING IS:", original_string)
|
||||||
cleaned_string = before_audio_generation(string, params)
|
cleaned_string = before_audio_generation(string, params)
|
||||||
if cleaned_string is None:
|
if cleaned_string is None:
|
||||||
return
|
return
|
||||||
@@ -505,83 +576,55 @@ def output_modifier(string, state):
|
|||||||
if process_lock.acquire(blocking=False):
|
if process_lock.acquire(blocking=False):
|
||||||
try:
|
try:
|
||||||
if params["narrator_enabled"]:
|
if params["narrator_enabled"]:
|
||||||
#print(original_string)
|
processed_parts = process_text(original_string)
|
||||||
# Do Some basic stripping and remove any double CR's
|
|
||||||
processed_string = (
|
|
||||||
original_string
|
|
||||||
.replace("***", "*")
|
|
||||||
.replace("**", "*")
|
|
||||||
.replace("\n\n", "\n")
|
|
||||||
.replace("\n", "")
|
|
||||||
)
|
|
||||||
processed_string = re.sub(r'\.\*\n\*', '. ', processed_string)
|
|
||||||
processed_string = (processed_string .replace('"\n\n*', '"<*'))
|
|
||||||
processed_string = (processed_string .replace('"\n', '< '))
|
|
||||||
processed_string = (processed_string .replace("'", "'"))
|
|
||||||
processed_string = (processed_string .replace("\n", " "))
|
|
||||||
processed_string = (processed_string .replace('"', '"<'))
|
|
||||||
processed_string = (processed_string .replace('"', '"<'))
|
|
||||||
#pattern = re.compile(r'(?<=[a-zA-Z!])"<(?=[a-zA-Z])')
|
|
||||||
pattern = re.compile(r'(?<=[a-zA-Z!?\.])"<(?=[a-zA-Z])')
|
|
||||||
processed_string = pattern.sub('" ', processed_string)
|
|
||||||
pattern = re.compile(r'(?<=[a-zA-Z])\*(?=[a-zA-Z])')
|
|
||||||
processed_string = pattern.sub('*"', processed_string)
|
|
||||||
processed_string = processed_string.replace('"<. *', '"< *"')
|
|
||||||
processed_string = processed_string.replace('< *"', '< *')
|
|
||||||
processed_string = processed_string.replace('. *', '< *')
|
|
||||||
processed_string = processed_string.replace('! *', '"< *')
|
|
||||||
processed_string = processed_string.replace('? *', '< *')
|
|
||||||
processed_string = processed_string.replace('* ', '* "<')
|
|
||||||
processed_string = processed_string.replace('*. ', '* "<')
|
|
||||||
processed_string = re.sub(r'\*(?=[a-zA-Z])', replace_asterisk, processed_string)
|
|
||||||
# Set up a tracking of the individual wav files.
|
|
||||||
audio_files_all_paragraphs = []
|
audio_files_all_paragraphs = []
|
||||||
# Split the line using " and ".* " (so end of sentences, leaving special characters added to the start of all OTHER sentences, bar possibly the first one if its starting with a *
|
for part_type, part in processed_parts:
|
||||||
parts = re.split(r'"|\.\*', processed_string)
|
|
||||||
audio_files_paragraph = []
|
|
||||||
for i, part in enumerate(parts):
|
|
||||||
# Skip parts that are too short
|
# Skip parts that are too short
|
||||||
if len(part.strip()) <= 3:
|
if len(part.strip()) <= 3:
|
||||||
continue
|
continue
|
||||||
# Figure out which type of line it is, then replace characters as necessary to avoid TTS trying to pronunce them, htmlunescape after.
|
|
||||||
# Character will always be a < with a letter immediately after it
|
# Determine the voice to use based on the part type
|
||||||
if '<' in part and '< *' not in part and '<*' not in part and '< *' not in part and '< ' not in part and '< ' not in part:
|
if part_type == 'narrator':
|
||||||
cleaned_part = html.unescape(part.replace('<', ''))
|
|
||||||
voice_to_use = params["voice"]
|
|
||||||
#Narrator will always be an * or < with an * a position or two after it.
|
|
||||||
elif '<*' in part or '< *' in part or '< *' in part or '*' in part:
|
|
||||||
cleaned_part = html.unescape(part.replace('<*', '').replace('< *', '').replace('< *', '').replace('*', ''))
|
|
||||||
voice_to_use = params["narrator_voice"]
|
voice_to_use = params["narrator_voice"]
|
||||||
#If the other two dont capture it, aka, the AI gave no * or " on the line, use non_quoted_text_is aka user interface, user can choose Char or Narrator
|
print(f"[{params['branding']}TTSGen] \033[92mNarrator\033[0m") # Green
|
||||||
elif non_quoted_text_is:
|
elif part_type == 'character':
|
||||||
cleaned_part = html.unescape(part.replace('< ', '').replace('< ', '').replace('< ', ''))
|
|
||||||
voice_to_use = params["voice"]
|
voice_to_use = params["voice"]
|
||||||
|
print(f"[{params['branding']}TTSGen] \033[36mCharacter\033[0m") # Yellow
|
||||||
else:
|
else:
|
||||||
cleaned_part = html.unescape(part.replace('< ', '').replace('< ', '').replace('< ', ''))
|
# Handle ambiguous parts based on user preference
|
||||||
voice_to_use = params["narrator_voice"]
|
voice_to_use = params["voice"] if non_quoted_text_is else params["narrator_voice"]
|
||||||
# Generate that TTS and output to a file
|
voice_description = "\033[36mCharacter (Text-not-inside)\033[0m" if non_quoted_text_is else "\033[92mNarrator (Text-not-inside)\033[0m"
|
||||||
|
print(f"[{params['branding']}TTSGen] {voice_description}")
|
||||||
|
|
||||||
|
# Replace multiple exclamation marks, question marks, or other punctuation with a single instance
|
||||||
|
cleaned_part = re.sub(r'([!?.])\1+', r'\1', part)
|
||||||
|
# Further clean to remove any other unwanted characters
|
||||||
|
cleaned_part = re.sub(r'[^a-zA-Z0-9\s\.,;:!?\-\'"\u0400-\u04FFÀ-ÿ\u0150\u0151\u0170\u0171\$]', '', cleaned_part)
|
||||||
|
# Remove all newline characters (single or multiple)
|
||||||
|
cleaned_part = re.sub(r'\n+', ' ', cleaned_part)
|
||||||
|
|
||||||
|
# Generate TTS and output to a file
|
||||||
output_filename = get_output_filename(state)
|
output_filename = get_output_filename(state)
|
||||||
generate_response = send_generate_request(
|
generate_response = send_generate_request(
|
||||||
cleaned_part, voice_to_use, language_code, output_filename
|
cleaned_part, voice_to_use, language_code, output_filename
|
||||||
)
|
)
|
||||||
audio_path = generate_response.get("data", {}).get("audio_path")
|
audio_path = generate_response.get("data", {}).get("audio_path")
|
||||||
audio_files_paragraph.append(audio_path)
|
audio_files_all_paragraphs.append(audio_path)
|
||||||
# Accumulate audio files within the paragraph
|
|
||||||
audio_files_all_paragraphs.extend(audio_files_paragraph)
|
|
||||||
# Combine audio files across paragraphs
|
# Combine audio files across paragraphs
|
||||||
final_output_file = combine(
|
final_output_file = combine(
|
||||||
audio_files_all_paragraphs, params["output_folder_wav"], state
|
audio_files_all_paragraphs, params["output_folder_wav"], state
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
processed_string = (
|
# Decode HTML entities first
|
||||||
original_string
|
cleaned_part = html.unescape(original_string)
|
||||||
.replace("***", "")
|
# Replace multiple instances of certain punctuation marks with a single instance
|
||||||
.replace("**", "")
|
cleaned_part = re.sub(r'([!?.])\1+', r'\1', cleaned_part)
|
||||||
.replace("*", "")
|
# Further clean to remove any other unwanted characters
|
||||||
.replace("\n\n", "\n")
|
cleaned_part = re.sub(r'[^a-zA-Z0-9\s\.,;:!?\-\'"\u0400-\u04FFÀ-ÿ\u0150\u0151\u0170\u0171\$]', '', cleaned_part)
|
||||||
.replace("'", "'")
|
# Remove all newline characters (single or multiple)
|
||||||
)
|
cleaned_part = re.sub(r'\n+', ' ', cleaned_part)
|
||||||
cleaned_part = html.unescape(processed_string)
|
|
||||||
# Process the part and give it a non-character name if being used vai API or standalone.
|
# Process the part and give it a non-character name if being used vai API or standalone.
|
||||||
if "character_menu" in state:
|
if "character_menu" in state:
|
||||||
output_file = Path(f'{params["output_folder_wav"]}/{state["character_menu"]}_{int(time.time())}.wav')
|
output_file = Path(f'{params["output_folder_wav"]}/{state["character_menu"]}_{int(time.time())}.wav')
|
||||||
@@ -689,10 +732,6 @@ def input_modifier(string, state):
|
|||||||
shared.processing_message = "*Is recording a voice message...*"
|
shared.processing_message = "*Is recording a voice message...*"
|
||||||
return string
|
return string
|
||||||
|
|
||||||
def custom_css():
|
|
||||||
path_to_css = Path(f"{this_dir}/style.css")
|
|
||||||
return open(path_to_css, "r").read()
|
|
||||||
|
|
||||||
|
|
||||||
def ui():
|
def ui():
|
||||||
with gr.Accordion(params["branding"] + " TTS (XTTSv2)"):
|
with gr.Accordion(params["branding"] + " TTS (XTTSv2)"):
|
||||||
@@ -786,8 +825,11 @@ def ui():
|
|||||||
deepspeed_checkbox_play = gr.HTML(visible=False)
|
deepspeed_checkbox_play = gr.HTML(visible=False)
|
||||||
|
|
||||||
with gr.Row():
|
with gr.Row():
|
||||||
|
model_loader_choices=["API TTS", "API Local", "XTTSv2 Local"]
|
||||||
|
if finetuned_model:
|
||||||
|
model_loader_choices.append("XTTSv2 FT")
|
||||||
tts_radio_buttons = gr.Radio(
|
tts_radio_buttons = gr.Radio(
|
||||||
choices=["API TTS", "API Local", "XTTSv2 Local"],
|
choices=model_loader_choices,
|
||||||
label="Select TTS Generation Method (Read NOTE)",
|
label="Select TTS Generation Method (Read NOTE)",
|
||||||
value=gr_modelchoice, # Set the default value
|
value=gr_modelchoice, # Set the default value
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -1,8 +0,0 @@
|
|||||||
.SDAP .hires_opts input[type="number"] {
|
|
||||||
width: 6em !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* silero_tts preview */
|
|
||||||
.form:has(> #silero_preview_text) {
|
|
||||||
min-width: 75%
|
|
||||||
}
|
|
||||||
|
After Width: | Height: | Size: 1.1 KiB |
@@ -0,0 +1,179 @@
|
|||||||
|
export interface CrunkerConstructorOptions {
|
||||||
|
/**
|
||||||
|
* Sample rate for Crunker's internal audio context.
|
||||||
|
*
|
||||||
|
* @default 44100
|
||||||
|
*/
|
||||||
|
sampleRate: number;
|
||||||
|
}
|
||||||
|
export type CrunkerInputTypes = string | File | Blob;
|
||||||
|
/**
|
||||||
|
* An exported Crunker audio object.
|
||||||
|
*/
|
||||||
|
export interface ExportedCrunkerAudio {
|
||||||
|
blob: Blob;
|
||||||
|
url: string;
|
||||||
|
element: HTMLAudioElement;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Crunker is the simple way to merge, concatenate, play, export and download audio files using the Web Audio API.
|
||||||
|
*/
|
||||||
|
export default class Crunker {
|
||||||
|
private readonly _sampleRate;
|
||||||
|
private readonly _context;
|
||||||
|
/**
|
||||||
|
* Creates a new instance of Crunker with the provided options.
|
||||||
|
*
|
||||||
|
* If `sampleRate` is not defined, it will auto-select an appropriate sample rate
|
||||||
|
* for the device being used.
|
||||||
|
*/
|
||||||
|
constructor({ sampleRate }?: Partial<CrunkerConstructorOptions>);
|
||||||
|
/**
|
||||||
|
* Creates Crunker's internal AudioContext.
|
||||||
|
*
|
||||||
|
* @internal
|
||||||
|
*/
|
||||||
|
private _createContext;
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* The internal AudioContext used by Crunker.
|
||||||
|
*/
|
||||||
|
get context(): AudioContext;
|
||||||
|
/**
|
||||||
|
* Asynchronously fetches multiple audio files and returns an array of AudioBuffers.
|
||||||
|
*/
|
||||||
|
fetchAudio(...filepaths: CrunkerInputTypes[]): Promise<AudioBuffer[]>;
|
||||||
|
/**
|
||||||
|
* Merges (layers) multiple AudioBuffers into a single AudioBuffer.
|
||||||
|
*
|
||||||
|
* **Visual representation:**
|
||||||
|
*
|
||||||
|
* 
|
||||||
|
*/
|
||||||
|
mergeAudio(buffers: AudioBuffer[]): AudioBuffer;
|
||||||
|
/**
|
||||||
|
* Concatenates multiple AudioBuffers into a single AudioBuffer.
|
||||||
|
*
|
||||||
|
* **Visual representation:**
|
||||||
|
*
|
||||||
|
* 
|
||||||
|
*/
|
||||||
|
concatAudio(buffers: AudioBuffer[]): AudioBuffer;
|
||||||
|
/**
|
||||||
|
* Pads a specified AudioBuffer with silence from a specified start time,
|
||||||
|
* for a specified length of time.
|
||||||
|
*
|
||||||
|
* Accepts float values as well as whole integers.
|
||||||
|
*
|
||||||
|
* @param buffer AudioBuffer to pad
|
||||||
|
* @param padStart Time to start padding (in seconds)
|
||||||
|
* @param seconds Duration to pad for (in seconds)
|
||||||
|
*/
|
||||||
|
padAudio(buffer: AudioBuffer, padStart?: number, seconds?: number): AudioBuffer;
|
||||||
|
/**
|
||||||
|
* Slices an AudioBuffer from the specified start time to the end time, with optional fade in and out.
|
||||||
|
*
|
||||||
|
* @param buffer AudioBuffer to slice
|
||||||
|
* @param start Start time (in seconds)
|
||||||
|
* @param end End time (in seconds)
|
||||||
|
* @param fadeIn Fade in duration (in seconds, default is 0)
|
||||||
|
* @param fadeOut Fade out duration (in seconds, default is 0)
|
||||||
|
*/
|
||||||
|
sliceAudio(buffer: AudioBuffer, start: number, end: number, fadeIn?: number, fadeOut?: number): AudioBuffer;
|
||||||
|
/**
|
||||||
|
* Plays the provided AudioBuffer in an AudioBufferSourceNode.
|
||||||
|
*/
|
||||||
|
play(buffer: AudioBuffer): AudioBufferSourceNode;
|
||||||
|
/**
|
||||||
|
* Exports the specified AudioBuffer to a Blob, Object URI and HTMLAudioElement.
|
||||||
|
*
|
||||||
|
* Note that changing the MIME type does not change the actual file format. The
|
||||||
|
* file format will **always** be a WAVE file due to how audio is stored in the
|
||||||
|
* browser.
|
||||||
|
*
|
||||||
|
* @param buffer Buffer to export
|
||||||
|
* @param type MIME type (default: `audio/wav`)
|
||||||
|
*/
|
||||||
|
export(buffer: AudioBuffer, type?: string): ExportedCrunkerAudio;
|
||||||
|
/**
|
||||||
|
* Downloads the provided Blob.
|
||||||
|
*
|
||||||
|
* @param blob Blob to download
|
||||||
|
* @param filename An optional file name to use for the download (default: `crunker`)
|
||||||
|
*/
|
||||||
|
download(blob: Blob, filename?: string): HTMLAnchorElement;
|
||||||
|
/**
|
||||||
|
* Executes a callback if the browser does not support the Web Audio API.
|
||||||
|
*
|
||||||
|
* Returns the result of the callback, or `undefined` if the Web Audio API is supported.
|
||||||
|
*
|
||||||
|
* @param callback callback to run if the browser does not support the Web Audio API
|
||||||
|
*/
|
||||||
|
notSupported<T>(callback: () => T): T | undefined;
|
||||||
|
/**
|
||||||
|
* Closes Crunker's internal AudioContext.
|
||||||
|
*/
|
||||||
|
close(): this;
|
||||||
|
/**
|
||||||
|
* Returns the largest duration of the longest AudioBuffer.
|
||||||
|
*
|
||||||
|
* @internal
|
||||||
|
*/
|
||||||
|
private _maxDuration;
|
||||||
|
/**
|
||||||
|
* Returns the largest number of channels in an array of AudioBuffers.
|
||||||
|
*
|
||||||
|
* @internal
|
||||||
|
*/
|
||||||
|
private _maxNumberOfChannels;
|
||||||
|
/**
|
||||||
|
* Returns the sum of the lengths of an array of AudioBuffers.
|
||||||
|
*
|
||||||
|
* @internal
|
||||||
|
*/
|
||||||
|
private _totalLength;
|
||||||
|
/**
|
||||||
|
* Returns whether the browser supports the Web Audio API.
|
||||||
|
*
|
||||||
|
* @internal
|
||||||
|
*/
|
||||||
|
private _isSupported;
|
||||||
|
/**
|
||||||
|
* Writes the WAV headers for the specified Float32Array.
|
||||||
|
*
|
||||||
|
* Returns a DataView containing the WAV headers and file content.
|
||||||
|
*
|
||||||
|
* @internal
|
||||||
|
*/
|
||||||
|
private _writeHeaders;
|
||||||
|
/**
|
||||||
|
* Converts a Float32Array to 16-bit PCM.
|
||||||
|
*
|
||||||
|
* @internal
|
||||||
|
*/
|
||||||
|
private _floatTo16BitPCM;
|
||||||
|
/**
|
||||||
|
* Writes a string to a DataView at the specified offset.
|
||||||
|
*
|
||||||
|
* @internal
|
||||||
|
*/
|
||||||
|
private _writeString;
|
||||||
|
/**
|
||||||
|
* Converts an AudioBuffer to a Float32Array.
|
||||||
|
*
|
||||||
|
* @internal
|
||||||
|
*/
|
||||||
|
private _interleave;
|
||||||
|
/**
|
||||||
|
* Creates an HTMLAudioElement whose source is the specified Blob.
|
||||||
|
*
|
||||||
|
* @internal
|
||||||
|
*/
|
||||||
|
private _renderAudioElement;
|
||||||
|
/**
|
||||||
|
* Creates an Object URL for the specified Blob.
|
||||||
|
*
|
||||||
|
* @internal
|
||||||
|
*/
|
||||||
|
private _renderURL;
|
||||||
|
}
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
var e={d:(t,n)=>{for(var r in n)e.o(n,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:n[r]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)},t={};function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function r(e){return function(e){if(Array.isArray(e))return a(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return a(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return a(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function a(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){for(var r=0;r<t.length;r++){var a=t[r];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,(o=a.key,i=void 0,i=function(e,t){if("object"!==n(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var a=r.call(e,t||"default");if("object"!==n(a))return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(o,"string"),"symbol"===n(i)?i:String(i)),a)}var o,i}e.d(t,{Z:()=>u});var u=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.sampleRate;o(this,e),this._context=this._createContext(n),n||(n=this._context.sampleRate),this._sampleRate=n}var t,n,a;return t=e,n=[{key:"_createContext",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:44100;return window.AudioContext=window.AudioContext||window.webkitAudioContext||window.mozAudioContext,new AudioContext({sampleRate:e})}},{key:"context",get:function(){return this._context}},{key:"fetchAudio",value:async function(){for(var e=this,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return await Promise.all(n.map((async function(t){var n;return n=t instanceof File||t instanceof Blob?await t.arrayBuffer():await fetch(t).then((function(e){return e.headers.has("Content-Type")&&!e.headers.get("Content-Type").includes("audio/")&&console.warn("Crunker: Attempted to fetch an audio file, but its MIME type is `".concat(e.headers.get("Content-Type").split(";")[0],"`. We'll try and continue anyway. (file: \"").concat(t,'")')),e.arrayBuffer()})),await e._context.decodeAudioData(n)})))}},{key:"mergeAudio",value:function(e){var t=this._context.createBuffer(this._maxNumberOfChannels(e),this._sampleRate*this._maxDuration(e),this._sampleRate);return e.forEach((function(e){for(var n=0;n<e.numberOfChannels;n++){for(var r=t.getChannelData(n),a=e.getChannelData(n),o=e.getChannelData(n).length-1;o>=0;o--)r[o]+=a[o];t.getChannelData(n).set(r)}})),t}},{key:"concatAudio",value:function(e){var t=this._context.createBuffer(this._maxNumberOfChannels(e),this._totalLength(e),this._sampleRate),n=0;return e.forEach((function(e){for(var r=0;r<e.numberOfChannels;r++)t.getChannelData(r).set(e.getChannelData(r),n);n+=e.length})),t}},{key:"padAudio",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;if(0===n)return e;if(t<0)throw new Error('Crunker: Parameter "padStart" in padAudio must be positive');if(n<0)throw new Error('Crunker: Parameter "seconds" in padAudio must be positive');for(var r=this._context.createBuffer(e.numberOfChannels,Math.ceil(e.length+n*e.sampleRate),e.sampleRate),a=0;a<e.numberOfChannels;a++){var o=e.getChannelData(a);r.getChannelData(a).set(o.subarray(0,Math.ceil(t*e.sampleRate)+1),0),r.getChannelData(a).set(o.subarray(Math.ceil(t*e.sampleRate)+2,r.length+1),Math.ceil((t+n)*e.sampleRate))}return r}},{key:"sliceAudio",value:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0;if(t>=n)throw new Error('Crunker: "start" time should be less than "end" time in sliceAudio method');for(var o=Math.round((n-t)*this._sampleRate),i=Math.round(t*this._sampleRate),u=this._context.createBuffer(e.numberOfChannels,o,this._sampleRate),l=0;l<e.numberOfChannels;l++)for(var s=e.getChannelData(l),c=u.getChannelData(l),f=0;f<o;f++)c[f]=s[i+f],f<r*this._sampleRate&&(c[f]*=f/(r*this._sampleRate)),f>o-a*this._sampleRate&&(c[f]*=(o-f)/(a*this._sampleRate));return u}},{key:"play",value:function(e){var t=this._context.createBufferSource();return t.buffer=e,t.connect(this._context.destination),t.start(),Line truncated
|
||||||
|
//# sourceMappingURL=crunker.esm.js.map
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
{"version":3,"file":"crunker.esm.js","mappings":"AACA,IAAIA,EAAsB,CCA1BA,EAAwB,CAACC,EAASC,KACjC,IAAI,IAAIC,KAAOD,EACXF,EAAoBI,EAAEF,EAAYC,KAASH,EAAoBI,EAAEH,EAASE,IAC5EE,OAAOC,eAAeL,EAASE,EAAK,CAAEI,YAAY,EAAMC,IAAKN,EAAWC,IAE1E,ECNDH,EAAwB,CAACS,EAAKC,IAAUL,OAAOM,UAAUC,eAAeC,KAAKJ,EAAKC,I,8jDCoBlF,IAGqBI,EAAO,WAU1B,aAAqE,6DAAJ,CAAC,EAApDC,EAAU,EAAVA,WAAU,UACtBC,KAAKC,SAAWD,KAAKE,eAAeH,GAEpCA,IAAAA,EAAeC,KAAKC,SAASF,YAE7BC,KAAKG,YAAcJ,CACrB,C,UA6YC,O,EA3YD,E,EAAA,6BA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MpF,EAAQ0F,GAC7C,GAEA,8BAKA,SAAyBrC,EAAoBrD,EAAsB6B,GACjE,IAAK,IAAIJ,EAAI,EAAGA,EAAIzB,EAAO0B,OAAQD,IAAKI,GAAU,EAAG,CACnD,IAAM8D,EAAMzD,KAAKwC,KAAK,EAAGxC,KAAK0D,IAAI,EAAG5F,EAAOyB,KAC5C4B,EAASwC,SAAShE,EAAQ8D,EAAM,EAAU,MAANA,EAAqB,MAANA,GAAc,EACnE,CAEA,OAAOtC,CACT,GAEA,0BAKA,SAAqBA,EAAoBxB,EAAgBiE,GACvD,IAAK,IAAIrE,EAAI,EAAGA,EAALine truncated
|
||||||
|
After Width: | Height: | Size: 1.1 KiB |
@@ -0,0 +1,4 @@
|
|||||||
|
/*! howler.js v2.2.4 | (c) 2013-2020, James Simpson of GoldFire Studios | MIT License | howlerjs.com */
|
||||||
|
!function(){"use strict";var e=function(){this.init()};e.prototype={init:function(){var e=this||n;return e._counter=1e3,e._html5AudioPool=[],e.html5PoolSize=10,e._codecs={},e._howls=[],e._muted=!1,e._volume=1,e._canPlayEvent="canplaythrough",e._navigator="undefined"!=typeof window&&window.navigator?window.navigator:null,e.masterGain=null,e.noAudio=!1,e.usingWebAudio=!0,e.autoSuspend=!0,e.ctx=null,e.autoUnlock=!0,e._setup(),e},volume:function(e){var o=this||n;if(e=parseFloat(e),o.ctx||_(),void 0!==e&&e>=0&&e<=1){if(o._volume=e,o._muted)return o;o.usingWebAudio&&o.masterGain.gain.setValueAtTime(e,n.ctx.currentTime);for(var t=0;t<o._howls.length;t++)if(!o._howls[t]._webAudio)for(var r=o._howls[t]._getSoundIds(),a=0;a<r.length;a++){var u=o._howls[t]._soundById(r[a]);u&&u._node&&(u._node.volume=u._volume*e)}return o}return o._volume},mute:function(e){var o=this||n;o.ctx||_(),o._muted=e,o.usingWebAudio&&o.masterGain.gain.setValueAtTime(e?0:o._volume,n.ctx.currentTime);for(var t=0;t<o._howls.length;t++)if(!o._howls[t]._webAudio)for(var r=o._howls[t]._getSoundIds(),a=0;a<r.length;a++){var u=o._howls[t]._soundById(r[a]);u&&u._node&&(u._node.muted=!!e||u._muted)}return o},stop:function(){for(var e=this||n,o=0;o<e._howls.length;o++)e._howls[o].stop();return e},unload:function(){for(var e=this||n,o=e._howls.length-1;o>=0;o--)e._howls[o].unload();return e.usingWebAudio&&e.ctx&&void 0!==e.ctx.close&&(e.ctx.close(),e.ctx=null,_()),e},codecs:function(e){return(this||n)._codecs[e.replace(/^x-/,"")]},_setup:function(){var e=this||n;if(e.state=e.ctx?e.ctx.state||"suspended":"suspended",e._autoSuspend(),!e.usingWebAudio)if("undefined"!=typeof Audio)try{var o=new Audio;void 0===o.oncanplaythrough&&(e._canPlayEvent="canplay")}catch(n){e.noAudio=!0}else e.noAudio=!0;try{var o=new Audio;o.muted&&(e.noAudio=!0)}catch(e){}return e.noAudio||e._setupCodecs(),e},_setupCodecs:function(){var e=this||n,o=null;try{o="undefined"!=typeof Audio?new Audio:null}catch(n){return e}if(!o||"function"!=typeof o.canPlayType)return e;var t=o.canPlayType("audio/mpeg;").replace(/^no$/,""),r=e._navigator?e._navigator.userAgent:"",a=r.match(/OPR\/(\d+)/g),u=a&&parseInt(a[0].split("/")[1],10)<33,d=-1!==r.indexOf("Safari")&&-1===r.indexOf("Chrome"),i=r.match(/Version\/(.*?) /),_=d&&i&&parseInt(i[1],10)<15;return e._codecs={mp3:!(u||!t&&!o.canPlayType("audio/mp3;").replace(/^no$/,"")),mpeg:!!t,opus:!!o.canPlayType('audio/ogg; codecs="opus"').replace(/^no$/,""),ogg:!!o.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,""),oga:!!o.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,""),wav:!!(o.canPlayType('audio/wav; codecs="1"')||o.canPlayType("audio/wav")).replace(/^no$/,""),aac:!!o.canPlayType("audio/aac;").replace(/^no$/,""),caf:!!o.canPlayType("audio/x-caf;").replace(/^no$/,""),m4a:!!(o.canPlayType("audio/x-m4a;")||o.canPlayType("audio/m4a;")||o.canPlayType("audio/aac;")).replace(/^no$/,""),m4b:!!(o.canPlayType("audio/x-m4b;")||o.canPlayType("audio/m4b;")||o.canPlayType("audio/aac;")).replace(/^no$/,""),mp4:!!(o.canPlayType("audio/x-mp4;")||o.canPlayType("audio/mp4;")||o.canPlayType("audio/aac;")).replace(/^no$/,""),weba:!(_||!o.canPlayType('audio/webm; codecs="vorbis"').replace(/^no$/,"")),webm:!(_||!o.canPlayType('audio/webm; codecs="vorbis"').replace(/^no$/,"")),dolby:!!o.canPlayType('audio/mp4; codecs="ec-3"').replace(/^no$/,""),flac:!!(o.canPlayType("audio/x-flac;")||o.canPlayType("audio/flac;")).replace(/^no$/,"")},e},_unlockAudio:function(){var e=this||n;if(!e._audioUnlocked&&e.ctx){e._audioUnlocked=!1,e.autoUnlock=!1,e._mobileUnloaded||44100===e.ctx.sampleRate||(e._mobileUnloaded=!0,e.unload()),e._scratchBuffer=e.ctx.createBuffer(1,1,22050);var o=function(n){for(;e._html5AudioPool.length<e.html5PoolSize;)try{var t=new Audio;t._unlocked=!0,e._releaseHtml5Audio(t)}catch(n){e.noAudio=!0;break}for(var r=0;r<e._howls.length;r++)if(!e._howls[r]._webAudio)for(var a=e._howls[r]._getSoundIds(),u=0;u<a.length;u++){var d=e._howls[r]._soundById(a[u]);d&&d._node&&!d._node._unlocked&&(d._node._unlocked=!0,d._node.load())}e._autoResume();var i=e.ctx.createBufferSource();i.buffer=e._scratchBuffer,i.connect(e.ctx.destination),void 0===i.start?i.noteOn(0):i.start(0),"function"==typeof e.ctx.resume&&e.ctx.resume(),i.onended=function(){i.disconnect(0),e._audioUnlocked=!0,document.removeEventListener("touchstart",o,!0),document.removeEventListener("touchend",o,!0),document.removeEventListener("click",o,!0),document.removeEventListener("keydown",o,!0);for(var n=0;n<e._howls.length;n++)e._howls[n]._emit("unlock")}};return document.addEventListener("touchstart",o,!0),document.addEventListener("touchend",o,!0),document.addEventListener("click",o,!0),document.addEventListener("keydown",o,!0),e}},_obtainHtml5Audio:function(){var e=this||n;if(e._html5AudioPool.length)return e._html5AudioPool.pop();var o=(new Audio).play();return o&&"undefined"!=typeof Promise&&(o instanceof Promise||"function"==typeof o.then)&&o.catch(function(){console.warn("HTML5 Audio pool eLine truncated
|
||||||
|
/*! Spatial Plugin */
|
||||||
|
!function(){"use strict";HowlerGlobal.prototype._pos=[0,0,0],HowlerGlobal.prototype._orientation=[0,0,-1,0,1,0],HowlerGlobal.prototype.stereo=function(e){var n=this;if(!n.ctx||!n.ctx.listener)return n;for(var t=n._howls.length-1;t>=0;t--)n._howls[t].stereo(e);return n},HowlerGlobal.prototype.pos=function(e,n,t){var r=this;return r.ctx&&r.ctx.listener?(n="number"!=typeof n?r._pos[1]:n,t="number"!=typeof t?r._pos[2]:t,"number"!=typeof e?r._pos:(r._pos=[e,n,t],void 0!==r.ctx.listener.positionX?(r.ctx.listener.positionX.setTargetAtTime(r._pos[0],Howler.ctx.currentTime,.1),r.ctx.listener.positionY.setTargetAtTime(r._pos[1],Howler.ctx.currentTime,.1),r.ctx.listener.positionZ.setTargetAtTime(r._pos[2],Howler.ctx.currentTime,.1)):r.ctx.listener.setPosition(r._pos[0],r._pos[1],r._pos[2]),r)):r},HowlerGlobal.prototype.orientation=function(e,n,t,r,o,i){var a=this;if(!a.ctx||!a.ctx.listener)return a;var p=a._orientation;return n="number"!=typeof n?p[1]:n,t="number"!=typeof t?p[2]:t,r="number"!=typeof r?p[3]:r,o="number"!=typeof o?p[4]:o,i="number"!=typeof i?p[5]:i,"number"!=typeof e?p:(a._orientation=[e,n,t,r,o,i],void 0!==a.ctx.listener.forwardX?(a.ctx.listener.forwardX.setTargetAtTime(e,Howler.ctx.currentTime,.1),a.ctx.listener.forwardY.setTargetAtTime(n,Howler.ctx.currentTime,.1),a.ctx.listener.forwardZ.setTargetAtTime(t,Howler.ctx.currentTime,.1),a.ctx.listener.upX.setTargetAtTime(r,Howler.ctx.currentTime,.1),a.ctx.listener.upY.setTargetAtTime(o,Howler.ctx.currentTime,.1),a.ctx.listener.upZ.setTargetAtTime(i,Howler.ctx.currentTime,.1)):a.ctx.listener.setOrientation(e,n,t,r,o,i),a)},Howl.prototype.init=function(e){return function(n){var t=this;return t._orientation=n.orientation||[1,0,0],t._stereo=n.stereo||null,t._pos=n.pos||null,t._pannerAttr={coneInnerAngle:void 0!==n.coneInnerAngle?n.coneInnerAngle:360,coneOuterAngle:void 0!==n.coneOuterAngle?n.coneOuterAngle:360,coneOuterGain:void 0!==n.coneOuterGain?n.coneOuterGain:0,distanceModel:void 0!==n.distanceModel?n.distanceModel:"inverse",maxDistance:void 0!==n.maxDistance?n.maxDistance:1e4,panningModel:void 0!==n.panningModel?n.panningModel:"HRTF",refDistance:void 0!==n.refDistance?n.refDistance:1,rolloffFactor:void 0!==n.rolloffFactor?n.rolloffFactor:1},t._onstereo=n.onstereo?[{fn:n.onstereo}]:[],t._onpos=n.onpos?[{fn:n.onpos}]:[],t._onorientation=n.onorientation?[{fn:n.onorientation}]:[],e.call(this,n)}}(Howl.prototype.init),Howl.prototype.stereo=function(n,t){var r=this;if(!r._webAudio)return r;if("loaded"!==r._state)return r._queue.push({event:"stereo",action:function(){r.stereo(n,t)}}),r;var o=void 0===Howler.ctx.createStereoPanner?"spatial":"stereo";if(void 0===t){if("number"!=typeof n)return r._stereo;r._stereo=n,r._pos=[n,0,0]}for(var i=r._getSoundIds(t),a=0;a<i.length;a++){var p=r._soundById(i[a]);if(p){if("number"!=typeof n)return p._stereo;p._stereo=n,p._pos=[n,0,0],p._node&&(p._pannerAttr.panningModel="equalpower",p._panner&&p._panner.pan||e(p,o),"spatial"===o?void 0!==p._panner.positionX?(p._panner.positionX.setValueAtTime(n,Howler.ctx.currentTime),p._panner.positionY.setValueAtTime(0,Howler.ctx.currentTime),p._panner.positionZ.setValueAtTime(0,Howler.ctx.currentTime)):p._panner.setPosition(n,0,0):p._panner.pan.setValueAtTime(n,Howler.ctx.currentTime)),r._emit("stereo",p._id)}}return r},Howl.prototype.pos=function(n,t,r,o){var i=this;if(!i._webAudio)return i;if("loaded"!==i._state)return i._queue.push({event:"pos",action:function(){i.pos(n,t,r,o)}}),i;if(t="number"!=typeof t?0:t,r="number"!=typeof r?-.5:r,void 0===o){if("number"!=typeof n)return i._pos;i._pos=[n,t,r]}for(var a=i._getSoundIds(o),p=0;p<a.length;p++){var s=i._soundById(a[p]);if(s){if("number"!=typeof n)return s._pos;s._pos=[n,t,r],s._node&&(s._panner&&!s._panner.pan||e(s,"spatial"),void 0!==s._panner.positionX?(s._panner.positionX.setValueAtTime(n,Howler.ctx.currentTime),s._panner.positionY.setValueAtTime(t,Howler.ctx.currentTime),s._panner.positionZ.setValueAtTime(r,Howler.ctx.currentTime)):s._panner.setPosition(n,t,r)),i._emit("pos",s._id)}}return i},Howl.prototype.orientation=function(n,t,r,o){var i=this;if(!i._webAudio)return i;if("loaded"!==i._state)return i._queue.push({event:"orientation",action:function(){i.orientation(n,t,r,o)}}),i;if(t="number"!=typeof t?i._orientation[1]:t,r="number"!=typeof r?i._orientation[2]:r,void 0===o){if("number"!=typeof n)return i._orientation;i._orientation=[n,t,r]}for(var a=i._getSoundIds(o),p=0;p<a.length;p++){var s=i._soundById(a[p]);if(s){if("number"!=typeof n)return s._orientation;s._orientation=[n,t,r],s._node&&(s._panner||(s._pos||(s._pos=i._pos||[0,0,-.5]),e(s,"spatial")),void 0!==s._panner.orientationX?(s._panner.orientationX.setValueAtTime(n,Howler.ctx.currentTime),s._panner.orientationY.setValueAtTime(t,Howler.ctx.currentTime),s._panner.orientationZ.setValueAtTime(r,Howler.ctx.currentTime)):s._panner.setOrientation(n,t,r)),i._emit("orientation",s._id)}}return i},Howl.prototype.pannerAttr=function(){var n,t,r,o=this,i=arguments;if(!o._webAudioLine truncated
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
/*! For license information please see 1995fcd6d39cade7d871.js.LICENSE.txt */
|
||||||
|
function _typeof(t){return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_typeof(t)}function _regeneratorRuntime(){"use strict";_regeneratorRuntime=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function l(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,r){return t[e]=r}}function f(t,e,r,n){var i=e&&e.prototype instanceof m?e:m,a=Object.create(i.prototype),c=new G(n||[]);return o(a,"_invoke",{value:S(t,r,c)}),a}function s(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=f;var h="suspendedStart",p="suspendedYield",y="executing",d="completed",v={};function m(){}function g(){}function w(){}var x={};l(x,a,(function(){return this}));var E=Object.getPrototypeOf,b=E&&E(E(B([])));b&&b!==r&&n.call(b,a)&&(x=b);var T=w.prototype=m.prototype=Object.create(x);function _(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function L(t,e){function r(o,i,a,c){var u=s(t[o],t,i);if("throw"!==u.type){var l=u.arg,f=l.value;return f&&"object"==_typeof(f)&&n.call(f,"__await")?e.resolve(f.__await).then((function(t){r("next",t,a,c)}),(function(t){r("throw",t,a,c)})):e.resolve(f).then((function(t){l.value=t,a(l)}),(function(t){return r("throw",t,a,c)}))}c(u.arg)}var i;o(this,"_invoke",{value:function(t,n){function o(){return new e((function(e,o){r(t,n,e,o)}))}return i=i?i.then(o,o):o()}})}function S(e,r,n){var o=h;return function(i,a){if(o===y)throw new Error("Generator is already running");if(o===d){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var c=n.delegate;if(c){var u=I(c,n);if(u){if(u===v)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===h)throw o=d,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=y;var l=s(e,r,n);if("normal"===l.type){if(o=n.done?d:p,l.arg===v)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=d,n.method="throw",n.arg=l.arg)}}}function I(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,I(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),v;var i=s(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,v;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,v):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,v)}function O(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function j(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function G(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(O,this),this.reset(!0)}function B(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function r(){for(;++o<e.length;)if(n.call(e,o))return r.value=e[o],r.done=!1,r;return r.value=t,r.done=!0,r};return i.next=i}}throw new TypeError(_typeof(e)+" is not iterable")}return g.prototype=w,o(T,"constructor",{value:w,configurable:!0}),o(w,"constructor",{value:g,configurable:!0}),g.displayName=l(w,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===g||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,w):(t.__proto__=w,l(t,u,"GeneratorFunction")),t.prototype=Object.create(T),t},e.awrap=function(t){return{__await:t}},_(L.prototype),l(L.prototype,c,(function(){return this})),e.AsyncIterator=L,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new L(f(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},_(T),l(T,u,"Generator"),l(T,a,(function(){return this})),l(T,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=B,G.prototype={constructor:G,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(j),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryELine truncated
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
|
||||||
@@ -0,0 +1,80 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
|
||||||
|
* See LICENSE in the project root for license information.
|
||||||
|
*/
|
||||||
|
|
||||||
|
html,
|
||||||
|
body {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
margin: 0;
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
ul {
|
||||||
|
margin: 0;
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ms-welcome__header {
|
||||||
|
padding: 20px;
|
||||||
|
padding-bottom: 30px;
|
||||||
|
padding-top: 100px;
|
||||||
|
display: -webkit-flex;
|
||||||
|
display: flex;
|
||||||
|
-webkit-flex-direction: column;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ms-welcome__main {
|
||||||
|
display: -webkit-flex;
|
||||||
|
display: flex;
|
||||||
|
-webkit-flex-direction: column;
|
||||||
|
flex-direction: column;
|
||||||
|
-webkit-flex-wrap: nowrap;
|
||||||
|
flex-wrap: nowrap;
|
||||||
|
-webkit-align-items: center;
|
||||||
|
align-items: center;
|
||||||
|
-webkit-flex: 1 0 0;
|
||||||
|
flex: 1 0 0;
|
||||||
|
padding: 10px 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ms-welcome__main > h2 {
|
||||||
|
width: 100%;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ms-welcome__features {
|
||||||
|
list-style-type: none;
|
||||||
|
margin-top: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ms-welcome__features.ms-List .ms-ListItem {
|
||||||
|
padding-bottom: 20px;
|
||||||
|
display: -webkit-flex;
|
||||||
|
display: flex;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ms-welcome__features.ms-List .ms-ListItem > .ms-Icon {
|
||||||
|
margin-right: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ms-welcome__action.ms-Button--hero {
|
||||||
|
margin-top: 30px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ms-Button.ms-Button--hero .ms-Button-label {
|
||||||
|
color: #0078d7;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ms-Button.ms-Button--hero:hover .ms-Button-label,
|
||||||
|
.ms-Button.ms-Button--hero:focus .ms-Button-label{
|
||||||
|
color: #005a9e;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
b {
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
After Width: | Height: | Size: 30 KiB |
|
After Width: | Height: | Size: 839 B |
|
After Width: | Height: | Size: 2.6 KiB |
|
After Width: | Height: | Size: 8.8 KiB |
|
After Width: | Height: | Size: 13 KiB |
|
After Width: | Height: | Size: 99 KiB |
@@ -0,0 +1 @@
|
|||||||
|
<!doctype html><html><head><meta charset="UTF-8"/><meta http-equiv="X-UA-Compatible" content="IE=Edge"/><script src="https://appsforoffice.microsoft.com/lib/1.1/hosted/office.js"></script><script defer="defer" src="polyfill.js"></script><script defer="defer" src="commands.js"></script></head><body></body></html>
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
!function(){var e={};e.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),Office.onReady((function(){})),("undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==e.g?e.g:void 0).action=function(e){var n={type:Office.MailboxEnums.ItemNotificationMessageType.InformationalMessage,message:"Performed action.",icon:"Icon.80x80",persistent:!0};Office.context.mailbox.item.notificationMessages.replaceAsync("action",n),e.completed()}}();
|
||||||
|
//# sourceMappingURL=commands.js.map
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
{"version":3,"file":"commands.js","mappings":"YACA,IAAIA,EAAsB,CAAC,ECD3BA,EAAoBC,EAAI,WACvB,GAA0B,iBAAfC,WAAyB,OAAOA,WAC3C,IACC,OAAOC,MAAQ,IAAIC,SAAS,cAAb,EAChB,CAAE,MAAOC,GACR,GAAsB,iBAAXC,OAAqB,OAAOA,MACxC,CACA,CAPuB,GCOxBC,OAAOC,SAAQ,WACb,KAuBuB,oBAATC,KACVA,KACkB,oBAAXH,OACPA,YACkB,IAAXI,EAAAA,EACPA,EAAAA,OACAC,GAMJC,OA5BF,SAAgBC,GACd,IAAMC,EAAU,CACdC,KAAMR,OAAOS,aAAaC,4BAA4BC,qBACtDJ,QAAS,oBACTK,KAAM,aACNC,YAAY,GAIdb,OAAOc,QAAQC,QAAQC,KAAKC,qBAAqBC,aAAa,SAAUX,GAGxED,EAAMa,WACR,C","sources":["webpack://office-addin-taskpane-js/webpack/bootstrap","webpack://office-addin-taskpane-js/webpack/runtime/global","webpack://office-addin-taskpane-js/./src/commands/commands.js"],"sourcesContent":["// The require scope\nvar __webpack_require__ = {};\n\n","__webpack_require__.g = (function() {\n\tif (typeof globalThis === 'object') return globalThis;\n\ttry {\n\t\treturn this || new Function('return this')();\n\t} catch (e) {\n\t\tif (typeof window === 'object') return window;\n\t}\n})();","/*\n * Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.\n * See LICENSE in the project root for license information.\n */\n\n/* global global, Office, self, window */\n\nOffice.onReady(() => {\n // If needed, Office.js is ready to be called\n});\n\n/**\n * Shows a notification when the add-in command is executed.\n * @param event {Office.AddinCommands.Event}\n */\nfunction action(event) {\n const message = {\n type: Office.MailboxEnums.ItemNotificationMessageType.InformationalMessage,\n message: \"Performed action.\",\n icon: \"Icon.80x80\",\n persistent: true,\n };\n\n // Show a notification message\n Office.context.mailbox.item.notificationMessages.replaceAsync(\"action\", message);\n\n // Be sure to indicate when the add-in command function is complete\n event.completed();\n}\n\nfunction getGlobal() {\n return typeof self !== \"undefined\"\n ? self\n : typeof window !== \"undefined\"\n ? window\n : typeof global !== \"undefined\"\n ? global\n : undefined;\n}\n\nconst g = getGlobal();\n\n// The add-in command functions need to be available in global scope\ng.action = action;\n"],"names":["__webpack_require__","g","globalThis","this","Function","e","window","Office","onReady","self","global","undefined","action","event","message","type","MailboxEnums","ItemNotificationMessageType","InformationalMessage","icon","persistent","context","mailbox","item","notificationMessages","replaceAsync","completed"],"sourceRoot":""}
|
||||||
@@ -0,0 +1,79 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||||
|
<OfficeApp xmlns="http://schemas.microsoft.com/office/appforoffice/1.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:bt="http://schemas.microsoft.com/office/officeappbasictypes/1.0" xmlns:ov="http://schemas.microsoft.com/office/taskpaneappversionoverrides" xsi:type="TaskPaneApp">
|
||||||
|
<Id>68b6ad53-4f72-42a8-a971-a9643c2f409a</Id>
|
||||||
|
<Version>1.0.0.0</Version>
|
||||||
|
<ProviderName>AllTalk</ProviderName>
|
||||||
|
<DefaultLocale>en-US</DefaultLocale>
|
||||||
|
<DisplayName DefaultValue="AllTalk TTS"/>
|
||||||
|
<Description DefaultValue="Enhance your document creation with AllTalk TTS's advanced text-to-voice functionality. Requires connection to AllTalk server."/>
|
||||||
|
<IconUrl DefaultValue="http://127.0.0.1:7851/api/word_addin/assets/icon-32.png"/>
|
||||||
|
<HighResolutionIconUrl DefaultValue="http://127.0.0.1:7851/api/word_addin/assets/icon-64.png"/>
|
||||||
|
<SupportUrl DefaultValue="https://github.com/erew123/alltalk_tts/issues"/>
|
||||||
|
<AppDomains>
|
||||||
|
<AppDomain>https://www.contoso.com</AppDomain>
|
||||||
|
</AppDomains>
|
||||||
|
<Hosts>
|
||||||
|
<Host Name="Document"/>
|
||||||
|
</Hosts>
|
||||||
|
<DefaultSettings>
|
||||||
|
<SourceLocation DefaultValue="http://127.0.0.1:7851/api/word_addin/taskpane.html"/>
|
||||||
|
</DefaultSettings>
|
||||||
|
<Permissions>ReadWriteDocument</Permissions>
|
||||||
|
<VersionOverrides xmlns="http://schemas.microsoft.com/office/taskpaneappversionoverrides" xsi:type="VersionOverridesV1_0">
|
||||||
|
<Hosts>
|
||||||
|
<Host xsi:type="Document">
|
||||||
|
<DesktopFormFactor>
|
||||||
|
<!-- You can add GetStarted information here if needed -->
|
||||||
|
<FunctionFile resid="Commands.Url"/>
|
||||||
|
<ExtensionPoint xsi:type="PrimaryCommandSurface">
|
||||||
|
<OfficeTab id="TabHome">
|
||||||
|
<Group id="AllTalkGroup">
|
||||||
|
<Label resid="AllTalkGroup.Label"/>
|
||||||
|
<Icon>
|
||||||
|
<bt:Image size="16" resid="Icon.16x16"/>
|
||||||
|
<bt:Image size="32" resid="Icon.32x32"/>
|
||||||
|
<bt:Image size="80" resid="Icon.80x80"/>
|
||||||
|
</Icon>
|
||||||
|
<Control xsi:type="Button" id="AllTalkTaskpaneButton">
|
||||||
|
<Label resid="AllTalkTaskpaneButton.Label"/>
|
||||||
|
<Supertip>
|
||||||
|
<Title resid="AllTalkTaskpaneButton.Label"/>
|
||||||
|
<Description resid="AllTalkTaskpaneButton.Tooltip"/>
|
||||||
|
</Supertip>
|
||||||
|
<Icon>
|
||||||
|
<bt:Image size="16" resid="Icon.16x16"/>
|
||||||
|
<bt:Image size="32" resid="Icon.32x32"/>
|
||||||
|
<bt:Image size="80" resid="Icon.80x80"/>
|
||||||
|
</Icon>
|
||||||
|
<Action xsi:type="ShowTaskpane">
|
||||||
|
<TaskpaneId>ButtonId1</TaskpaneId>
|
||||||
|
<SourceLocation resid="Taskpane.Url"/>
|
||||||
|
</Action>
|
||||||
|
</Control>
|
||||||
|
</Group>
|
||||||
|
</OfficeTab>
|
||||||
|
</ExtensionPoint>
|
||||||
|
</DesktopFormFactor>
|
||||||
|
</Host>
|
||||||
|
</Hosts>
|
||||||
|
<Resources>
|
||||||
|
<bt:Images>
|
||||||
|
<bt:Image id="Icon.16x16" DefaultValue="http://127.0.0.1:7851/api/word_addin/assets/icon-16.png"/>
|
||||||
|
<bt:Image id="Icon.32x32" DefaultValue="http://127.0.0.1:7851/api/word_addin/assets/icon-32.png"/>
|
||||||
|
<bt:Image id="Icon.80x80" DefaultValue="http://127.0.0.1:7851/api/word_addin/assets/icon-80.png"/>
|
||||||
|
</bt:Images>
|
||||||
|
<bt:Urls>
|
||||||
|
<!-- Ensure that these URLs are pointing to valid locations -->
|
||||||
|
<bt:Url id="Commands.Url" DefaultValue="http://127.0.0.1:7851/api/word_addin/commands.html"/>
|
||||||
|
<bt:Url id="Taskpane.Url" DefaultValue="http://127.0.0.1:7851/api/word_addin/taskpane.html"/>
|
||||||
|
</bt:Urls>
|
||||||
|
<bt:ShortStrings>
|
||||||
|
<bt:String id="AllTalkGroup.Label" DefaultValue="AllTalk Controls"/>
|
||||||
|
<bt:String id="AllTalkTaskpaneButton.Label" DefaultValue="Open AllTalk"/>
|
||||||
|
</bt:ShortStrings>
|
||||||
|
<bt:LongStrings>
|
||||||
|
<bt:String id="AllTalkTaskpaneButton.Tooltip" DefaultValue="Open the AllTalk task pane to start using the add-in."/>
|
||||||
|
</bt:LongStrings>
|
||||||
|
</Resources>
|
||||||
|
</VersionOverrides>
|
||||||
|
</OfficeApp>
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
!function(){var t={35666:function(t){var r=function(t){"use strict";var r,e=Object.prototype,n=e.hasOwnProperty,i=Object.defineProperty||function(t,r,e){t[r]=e.value},o="function"==typeof Symbol?Symbol:{},u=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",c=o.toStringTag||"@@toStringTag";function s(t,r,e){return Object.defineProperty(t,r,{value:e,enumerable:!0,configurable:!0,writable:!0}),t[r]}try{s({},"")}catch(t){s=function(t,r,e){return t[r]=e}}function f(t,r,e,n){var o=r&&r.prototype instanceof y?r:y,u=Object.create(o.prototype),a=new j(n||[]);return i(u,"_invoke",{value:R(t,e,a)}),u}function l(t,r,e){try{return{type:"normal",arg:t.call(r,e)}}catch(t){return{type:"throw",arg:t}}}t.wrap=f;var h="suspendedStart",p="suspendedYield",v="executing",g="completed",d={};function y(){}function m(){}function b(){}var x={};s(x,u,(function(){return this}));var w=Object.getPrototypeOf,E=w&&w(w(P([])));E&&E!==e&&n.call(E,u)&&(x=E);var S=b.prototype=y.prototype=Object.create(x);function A(t){["next","throw","return"].forEach((function(r){s(t,r,(function(t){return this._invoke(r,t)}))}))}function O(t,r){function e(i,o,u,a){var c=l(t[i],t,o);if("throw"!==c.type){var s=c.arg,f=s.value;return f&&"object"==typeof f&&n.call(f,"__await")?r.resolve(f.__await).then((function(t){e("next",t,u,a)}),(function(t){e("throw",t,u,a)})):r.resolve(f).then((function(t){s.value=t,u(s)}),(function(t){return e("throw",t,u,a)}))}a(c.arg)}var o;i(this,"_invoke",{value:function(t,n){function i(){return new r((function(r,i){e(t,n,r,i)}))}return o=o?o.then(i,i):i()}})}function R(t,r,e){var n=h;return function(i,o){if(n===v)throw new Error("Generator is already running");if(n===g){if("throw"===i)throw o;return k()}for(e.method=i,e.arg=o;;){var u=e.delegate;if(u){var a=T(u,e);if(a){if(a===d)continue;return a}}if("next"===e.method)e.sent=e._sent=e.arg;else if("throw"===e.method){if(n===h)throw n=g,e.arg;e.dispatchException(e.arg)}else"return"===e.method&&e.abrupt("return",e.arg);n=v;var c=l(t,r,e);if("normal"===c.type){if(n=e.done?g:p,c.arg===d)continue;return{value:c.arg,done:e.done}}"throw"===c.type&&(n=g,e.method="throw",e.arg=c.arg)}}}function T(t,e){var n=e.method,i=t.iterator[n];if(i===r)return e.delegate=null,"throw"===n&&t.iterator.return&&(e.method="return",e.arg=r,T(t,e),"throw"===e.method)||"return"!==n&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+n+"' method")),d;var o=l(i,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,d;var u=o.arg;return u?u.done?(e[t.resultName]=u.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=r),e.delegate=null,d):u:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,d)}function I(t){var r={tryLoc:t[0]};1 in t&&(r.catchLoc=t[1]),2 in t&&(r.finallyLoc=t[2],r.afterLoc=t[3]),this.tryEntries.push(r)}function M(t){var r=t.completion||{};r.type="normal",delete r.arg,t.completion=r}function j(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(I,this),this.reset(!0)}function P(t){if(t){var e=t[u];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var i=-1,o=function e(){for(;++i<t.length;)if(n.call(t,i))return e.value=t[i],e.done=!1,e;return e.value=r,e.done=!0,e};return o.next=o}}return{next:k}}function k(){return{value:r,done:!0}}return m.prototype=b,i(S,"constructor",{value:b,configurable:!0}),i(b,"constructor",{value:m,configurable:!0}),m.displayName=s(b,c,"GeneratorFunction"),t.isGeneratorFunction=function(t){var r="function"==typeof t&&t.constructor;return!!r&&(r===m||"GeneratorFunction"===(r.displayName||r.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,b):(t.__proto__=b,s(t,c,"GeneratorFunction")),t.prototype=Object.create(S),t},t.awrap=function(t){return{__await:t}},A(O.prototype),s(O.prototype,a,(function(){return this})),t.AsyncIterator=O,t.async=function(r,e,n,i,o){void 0===o&&(o=Promise);var u=new O(f(r,e,n,i),o);return t.isGeneratorFunction(e)?u:u.next().then((function(t){return t.done?t.value:u.next()}))},A(S),s(S,c,"Generator"),s(S,u,(function(){return this})),s(S,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var r=Object(t),e=[];for(var n in r)e.push(n);return e.reverse(),function t(){for(;e.length;){var n=e.pop();if(n in r)return t.value=n,t.done=!1,t}return t.done=!0,t}},t.values=P,j.prototype={constructor:j,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=r,this.done=!1,this.delegate=null,this.method="next",this.arg=r,this.tryEntries.forEach(M),!t)for(var e in this)"t"===e.charAt(0)&&n.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=r)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function i(n,i){return a.type="throw",a.arg=t,e.next=n,i&&(e.method="next",e.arg=r),!!i}for(var o=this.tryEntries.length-1;o>=0;--o){var u=this.tryEntries[o],aLine truncated
|
||||||
|
//# sourceMappingURL=polyfill.js.map
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
{"version":3,"file":"polyfill.js","mappings":"qCAOA,IAAIA,EAAW,SAAUC,GACvB,aAEA,IAGIC,EAHAC,EAAKC,OAAOC,UACZC,EAASH,EAAGI,eACZC,EAAiBJ,OAAOI,gBAAkB,SAAUC,EAAKC,EAAKC,GAAQF,EAAIC,GAAOC,EAAKC,KAAO,EAE7FC,EAA4B,mBAAXC,OAAwBA,OAAS,CAAC,EACnDC,EAAiBF,EAAQG,UAAY,aACrCC,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IC,GAAK,EAAGlB,EAAO,SAASA,IAC1B,OAASkB,EAAIJ,EAASG,QACpB,GAAIpG,EAAOoC,KAAK6D,EAAUI,GAGxB,OAFAlB,EAAK7E,MAAQ2F,EAASI,GACtBlB,EAAKL,MAAO,EACLK,EAOX,OAHAA,EAAK7E,MAAQV,EACbuF,EAAKL,MAAO,EAELK,CACT,EAEA,OAAOA,EAAKA,KAAOA,CACrB,CACF,CAGA,MAAO,CAAEA,KAAMb,EACjB,CAGA,SAASA,IACP,MAAO,CAAEhE,MAAOV,EAAWkF,MAAM,EACnC,CA8MA,OAnnBApC,EAAkB3C,UAAY4C,EAC9BzC,EAAegD,EAAI,cAAe,CAAE5C,MAAOqC,EAA4B1B,cAAc,IACrFf,EACEyC,EACA,cACA,CAAErC,MAAOoC,EAAmBzB,cAAc,IAE5CyB,EAAkB4D,YAAcvF,EAC9B4B,EACA9B,EACA,qBAaFlB,EAAQ4G,oBAAsB,SLine truncated
|
||||||
@@ -0,0 +1,106 @@
|
|||||||
|
<!doctype html>
|
||||||
|
<html>
|
||||||
|
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8" />
|
||||||
|
<meta http-equiv="X-UA-Compatible" content="IE=Edge" />
|
||||||
|
<meta name="viewport" content="width=device-width,initial-scale=1">
|
||||||
|
<title>AllTalk TTS Add-in</title>
|
||||||
|
<script src="https://appsforoffice.microsoft.com/lib/1.1/hosted/office.js"></script>
|
||||||
|
<link rel="stylesheet"
|
||||||
|
href="https://static2.sharepointonline.com/files/fabric/office-ui-fabric-core/11.0.0/css/fabric.min.css" />
|
||||||
|
<link href="1fda685b81e1123773f6.css" rel="stylesheet" />
|
||||||
|
<style>
|
||||||
|
label {
|
||||||
|
font-weight: 700;
|
||||||
|
display: block;
|
||||||
|
margin-top: 10px
|
||||||
|
}
|
||||||
|
|
||||||
|
select {
|
||||||
|
width: 100%;
|
||||||
|
padding: 5px
|
||||||
|
}
|
||||||
|
|
||||||
|
.nice-button {
|
||||||
|
background-color: #0078d4;
|
||||||
|
color: #fff;
|
||||||
|
padding: 10px 20px;
|
||||||
|
border: none;
|
||||||
|
border-radius: 5px;
|
||||||
|
cursor: pointer;
|
||||||
|
font-size: 16px;
|
||||||
|
transition: background-color .3s ease
|
||||||
|
}
|
||||||
|
|
||||||
|
.nice-button:hover {
|
||||||
|
background-color: #005a9e
|
||||||
|
}
|
||||||
|
|
||||||
|
#audioSource {
|
||||||
|
width: 300px;
|
||||||
|
height: 50px
|
||||||
|
}
|
||||||
|
|
||||||
|
.input-container {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
margin-right: 10px
|
||||||
|
}
|
||||||
|
|
||||||
|
.input-group {
|
||||||
|
display: flex;
|
||||||
|
justify-content: start;
|
||||||
|
align-items: flex-end
|
||||||
|
}
|
||||||
|
|
||||||
|
.input-group>.input-container {
|
||||||
|
flex: 1
|
||||||
|
}
|
||||||
|
|
||||||
|
input {
|
||||||
|
width: 100%
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
<script defer="defer" src="polyfill.js"></script>
|
||||||
|
<script defer="defer" src="taskpane.js"></script>
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body class="ms-font-m ms-welcome ms-Fabric">
|
||||||
|
<header class="ms-welcome__header ms-bgColor-neutralLighter"><img width="90" height="90"
|
||||||
|
src="http://127.0.0.1:7851/api/word_addin/assets/logo-filled.png" alt="AllTalk TTS" title="AllTalk TTS" />
|
||||||
|
<h1 class="ms-font-su">AllTalk TTS</h1>
|
||||||
|
</header>
|
||||||
|
<main class="ms-welcome__main"><textarea id="text" rows="4" placeholder="Enter text here"
|
||||||
|
style="display:none"></textarea> <label for="voice">Voice:</label> <select id="voice" name="voice"
|
||||||
|
required></select> <label for="language">Language:</label> <select id="language" name="language"
|
||||||
|
value="English" required>
|
||||||
|
<option value="en" selected="selected">English</option>
|
||||||
|
<option value="ar">Arabic</option>
|
||||||
|
<option value="zh-cn">Chinese</option>
|
||||||
|
<option value="cs">Czech</option>
|
||||||
|
<option value="nl">Dutch</option>
|
||||||
|
<option value="fr">French</option>
|
||||||
|
<option value="de">German</option>
|
||||||
|
<option value="hu">Hungarian</option>
|
||||||
|
<option value="it">Italian</option>
|
||||||
|
<option value="ja">Japanese</option>
|
||||||
|
<option value="ko">Korean</option>
|
||||||
|
<option value="pl">Polish</option>
|
||||||
|
<option value="pt">Portuguese</option>
|
||||||
|
<option value="ru">Russian</option>
|
||||||
|
<option value="es">Spanish</option>
|
||||||
|
<option value="tr">Turkish</option>
|
||||||
|
</select><br><audio id="audioSource" controls autoplay></audio><br><button id="sendTextButton"
|
||||||
|
class="nice-button">Send Text to TTS</button><br><br><br><br>
|
||||||
|
<div class="input-group">
|
||||||
|
<div class="input-container"><label for="serverIP">Server IP:</label> <input id="serverIP" name="serverIP"
|
||||||
|
value="127.0.0.1" required></div>
|
||||||
|
<div class="input-container"><label for="portNumber">Port Number:</label> <input type="number"
|
||||||
|
id="portNumber" name="portNumber" value="7851" required></div>
|
||||||
|
</div>
|
||||||
|
</main>
|
||||||
|
<script src="1995fcd6d39cade7d871.js"></script>
|
||||||
|
</body>
|
||||||
|
|
||||||
|
</html>
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
/*! For license information please see taskpane.js.LICENSE.txt */
|
||||||
|
!function(){var t={27091:function(t){"use strict";t.exports=function(t,e){return e||(e={}),t?(t=String(t.__esModule?t.default:t),e.hash&&(t+=e.hash),e.maybeNeedQuotes&&/[\t\n\f\r "'=<>`]/.test(t)?'"'.concat(t,'"'):t):t}},44944:function(t,e,r){"use strict";t.exports=r.p+"assets/logo-filled.png"},36076:function(t,e,r){"use strict";t.exports=r.p+"1995fcd6d39cade7d871.js"},60806:function(t,e,r){"use strict";t.exports=r.p+"1fda685b81e1123773f6.css"}},e={};function r(n){var o=e[n];if(void 0!==o)return o.exports;var i=e[n]={exports:{}};return t[n](i,i.exports,r),i.exports}r.m=t,r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,{a:e}),e},r.d=function(t,e){for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},function(){var t;r.g.importScripts&&(t=r.g.location+"");var e=r.g.document;if(!t&&e&&(e.currentScript&&(t=e.currentScript.src),!t)){var n=e.getElementsByTagName("script");if(n.length)for(var o=n.length-1;o>-1&&!t;)t=n[o--].src}if(!t)throw new Error("Automatic publicPath is not supported in this browser");t=t.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),r.p=t}(),r.b=document.baseURI||self.location.href,function(){function t(e){return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t(e)}function e(){"use strict";e=function(){return n};var r,n={},o=Object.prototype,i=o.hasOwnProperty,c=Object.defineProperty||function(t,e,r){t[e]=r.value},a="function"==typeof Symbol?Symbol:{},u=a.iterator||"@@iterator",f=a.asyncIterator||"@@asyncIterator",s=a.toStringTag||"@@toStringTag";function l(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(r){l=function(t,e,r){return t[e]=r}}function h(t,e,r,n){var o=e&&e.prototype instanceof w?e:w,i=Object.create(o.prototype),a=new k(n||[]);return c(i,"_invoke",{value:I(t,r,a)}),i}function p(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}n.wrap=h;var y="suspendedStart",v="suspendedYield",d="executing",m="completed",g={};function w(){}function b(){}function x(){}var E={};l(E,u,(function(){return this}));var L=Object.getPrototypeOf,_=L&&L(L(T([])));_&&_!==o&&i.call(_,u)&&(E=_);var j=x.prototype=w.prototype=Object.create(E);function O(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function S(e,r){function n(o,c,a,u){var f=p(e[o],e,c);if("throw"!==f.type){var s=f.arg,l=s.value;return l&&"object"==t(l)&&i.call(l,"__await")?r.resolve(l.__await).then((function(t){n("next",t,a,u)}),(function(t){n("throw",t,a,u)})):r.resolve(l).then((function(t){s.value=t,a(s)}),(function(t){return n("throw",t,a,u)}))}u(f.arg)}var o;c(this,"_invoke",{value:function(t,e){function i(){return new r((function(r,o){n(t,e,r,o)}))}return o=o?o.then(i,i):i()}})}function I(t,e,n){var o=y;return function(i,c){if(o===d)throw new Error("Generator is already running");if(o===m){if("throw"===i)throw c;return{value:r,done:!0}}for(n.method=i,n.arg=c;;){var a=n.delegate;if(a){var u=P(a,n);if(u){if(u===g)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===y)throw o=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=d;var f=p(t,e,n);if("normal"===f.type){if(o=n.done?m:v,f.arg===g)continue;return{value:f.arg,done:n.done}}"throw"===f.type&&(o=m,n.method="throw",n.arg=f.arg)}}}function P(t,e){var n=e.method,o=t.iterator[n];if(o===r)return e.delegate=null,"throw"===n&&t.iterator.return&&(e.method="return",e.arg=r,P(t,e),"throw"===e.method)||"return"!==n&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+n+"' method")),g;var i=p(o,t.iterator,e.arg);if("throw"===i.type)return e.method="throw",e.arg=i.arg,e.delegate=null,g;var c=i.arg;return c?c.done?(e[t.resultName]=c.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=r),e.delegate=null,g):c:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,g)}function B(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function N(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function k(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(B,this),this.reset(!0)}function T(e){if(e||""===e){var n=e[u];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,c=function t(){for(;++o<e.length;)if(i.call(e,o))return t.value=e[o],t.done=!1,t;return t.value=r,t.done=!0,t};return c.next=c}}throw new TLine truncated
|
||||||
|
//# sourceMappingURL=taskpane.js.map
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
{"version":3,"file":"taskpane.js","mappings":";kDAEAA,EAAOC,QAAU,SAAUC,EAAKC,GAM9B,OALKA,IAEHA,EAAU,CAAC,GAGRD,GAKLA,EAAME,OAAOF,EAAIG,WAAaH,EAAII,QAAUJ,GAExCC,EAAQI,OAEVL,GAAOC,EAAQI,MAGbJ,EAAQK,iBAAmB,oBAAoBC,KAAKP,GAC/C,IAAKQ,OAAOR,EAAK,KAGnBA,GAfEA,CAgBX,wOCxBIS,EAA2B,CAAC,EAGhC,SAASC,EAAoBC,GAE5B,IAAIC,EAAeH,EAAyBE,GAC5C,QAAqBE,IAAjBD,EACH,OAAOA,EAAab,QAGrB,IAAID,EAASW,EAAyBE,GAAY,CAGjDZ,QAAS,CAAC,GAOX,OAHAe,EAAoBH,GAAUb,EAAQA,EAAOC,QAASW,GAG/CZ,EAAOC,OACf,CAGAW,EAAoBK,EAAID,ECxBxBJ,EAAoBM,EAAI,SAASlB,GAChC,IAAImB,EAASnB,GAAUA,EAAOK,WAC7B,WAAa,OAAOL,EAAgB,OAAG,EACvC,WAAa,OAAOA,CAAQ,EAE7B,OADAY,EAAoBQ,EAAED,EAAQ,CAAEE,EAAGF,IAC5BA,CACR,ECNAP,EAAoBQ,EAAI,SAASnB,EAASqB,GACzC,IAAI,IAAIC,KAAOD,EACX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