diff --git a/notebooks/Demo_Mozilla_TTS_MultiSpeaker_jia_et_al_2018.ipynb b/notebooks/Demo_Mozilla_TTS_MultiSpeaker_jia_et_al_2018.ipynb
new file mode 100755
index 00000000..3581b6ab
--- /dev/null
+++ b/notebooks/Demo_Mozilla_TTS_MultiSpeaker_jia_et_al_2018.ipynb
@@ -0,0 +1,1758 @@
+{
+ "nbformat": 4,
+ "nbformat_minor": 0,
+ "metadata": {
+ "colab": {
+ "name": "Demo-Mozilla-TTS-MultiSpeaker-jia-et-al-2018.ipynb",
+ "provenance": [],
+ "collapsed_sections": [
+ "vnV-FigfvsS2",
+ "hkvv7gRcx4WV",
+ "QJ6VgT2a4vHW"
+ ]
+ },
+ "kernelspec": {
+ "name": "python3",
+ "display_name": "Python 3"
+ },
+ "accelerator": "GPU"
+ },
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {
+ "id": "yZK6UdwSFnOO",
+ "colab_type": "text"
+ },
+ "source": [
+ "# **Download and install Mozilla TTS**"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "metadata": {
+ "id": "yvb0pX3WY6MN",
+ "colab_type": "code",
+ "colab": {
+ "base_uri": "https://localhost:8080/",
+ "height": 139
+ },
+ "outputId": "5c5016ac-4f92-4b5b-bcf3-473363b2846d"
+ },
+ "source": [
+ "import os \n",
+ "!git clone https://github.com/Edresson/TTS -b dev-gst-embeddings"
+ ],
+ "execution_count": null,
+ "outputs": [
+ {
+ "output_type": "stream",
+ "text": [
+ "Cloning into 'TTS'...\n",
+ "remote: Enumerating objects: 15, done.\u001b[K\n",
+ "remote: Counting objects: 6% (1/15)\u001b[K\rremote: Counting objects: 13% (2/15)\u001b[K\rremote: Counting objects: 20% (3/15)\u001b[K\rremote: Counting objects: 26% (4/15)\u001b[K\rremote: Counting objects: 33% (5/15)\u001b[K\rremote: Counting objects: 40% (6/15)\u001b[K\rremote: Counting objects: 46% (7/15)\u001b[K\rremote: Counting objects: 53% (8/15)\u001b[K\rremote: Counting objects: 60% (9/15)\u001b[K\rremote: Counting objects: 66% (10/15)\u001b[K\rremote: Counting objects: 73% (11/15)\u001b[K\rremote: Counting objects: 80% (12/15)\u001b[K\rremote: Counting objects: 86% (13/15)\u001b[K\rremote: Counting objects: 93% (14/15)\u001b[K\rremote: Counting objects: 100% (15/15)\u001b[K\rremote: Counting objects: 100% (15/15), done.\u001b[K\n",
+ "remote: Compressing objects: 100% (14/14), done.\u001b[K\n",
+ "remote: Total 10370 (delta 1), reused 3 (delta 1), pack-reused 10355\u001b[K\n",
+ "Receiving objects: 100% (10370/10370), 120.77 MiB | 33.68 MiB/s, done.\n",
+ "Resolving deltas: 100% (6183/6183), done.\n"
+ ],
+ "name": "stdout"
+ }
+ ]
+ },
+ {
+ "cell_type": "code",
+ "metadata": {
+ "id": "iB9nl2UEG3SY",
+ "colab_type": "code",
+ "colab": {
+ "base_uri": "https://localhost:8080/",
+ "height": 1000
+ },
+ "outputId": "36bd08c3-6f29-4c03-9dc6-3cc3cc538e30"
+ },
+ "source": [
+ "!apt-get install espeak\n",
+ "os.chdir('TTS')\n",
+ "!pip install -r requirements.txt\n",
+ "!python setup.py develop\n",
+ "os.chdir('..')"
+ ],
+ "execution_count": null,
+ "outputs": [
+ {
+ "output_type": "stream",
+ "text": [
+ "Reading package lists... Done\n",
+ "Building dependency tree \n",
+ "Reading state information... Done\n",
+ "The following package was automatically installed and is no longer required:\n",
+ " libnvidia-common-440\n",
+ "Use 'apt autoremove' to remove it.\n",
+ "The following additional packages will be installed:\n",
+ " espeak-data libespeak1 libportaudio2 libsonic0\n",
+ "The following NEW packages will be installed:\n",
+ " espeak espeak-data libespeak1 libportaudio2 libsonic0\n",
+ "0 upgraded, 5 newly installed, 0 to remove and 35 not upgraded.\n",
+ "Need to get 1,219 kB of archives.\n",
+ "After this operation, 3,031 kB of additional disk space will be used.\n",
+ "Get:1 http://archive.ubuntu.com/ubuntu bionic/universe amd64 libportaudio2 amd64 19.6.0-1 [64.6 kB]\n",
+ "Get:2 http://archive.ubuntu.com/ubuntu bionic/main amd64 libsonic0 amd64 0.2.0-6 [13.4 kB]\n",
+ "Get:3 http://archive.ubuntu.com/ubuntu bionic/universe amd64 espeak-data amd64 1.48.04+dfsg-5 [934 kB]\n",
+ "Get:4 http://archive.ubuntu.com/ubuntu bionic/universe amd64 libespeak1 amd64 1.48.04+dfsg-5 [145 kB]\n",
+ "Get:5 http://archive.ubuntu.com/ubuntu bionic/universe amd64 espeak amd64 1.48.04+dfsg-5 [61.6 kB]\n",
+ "Fetched 1,219 kB in 1s (820 kB/s)\n",
+ "Selecting previously unselected package libportaudio2:amd64.\n",
+ "(Reading database ... 144465 files and directories currently installed.)\n",
+ "Preparing to unpack .../libportaudio2_19.6.0-1_amd64.deb ...\n",
+ "Unpacking libportaudio2:amd64 (19.6.0-1) ...\n",
+ "Selecting previously unselected package libsonic0:amd64.\n",
+ "Preparing to unpack .../libsonic0_0.2.0-6_amd64.deb ...\n",
+ "Unpacking libsonic0:amd64 (0.2.0-6) ...\n",
+ "Selecting previously unselected package espeak-data:amd64.\n",
+ "Preparing to unpack .../espeak-data_1.48.04+dfsg-5_amd64.deb ...\n",
+ "Unpacking espeak-data:amd64 (1.48.04+dfsg-5) ...\n",
+ "Selecting previously unselected package libespeak1:amd64.\n",
+ "Preparing to unpack .../libespeak1_1.48.04+dfsg-5_amd64.deb ...\n",
+ "Unpacking libespeak1:amd64 (1.48.04+dfsg-5) ...\n",
+ "Selecting previously unselected package espeak.\n",
+ "Preparing to unpack .../espeak_1.48.04+dfsg-5_amd64.deb ...\n",
+ "Unpacking espeak (1.48.04+dfsg-5) ...\n",
+ "Setting up libportaudio2:amd64 (19.6.0-1) ...\n",
+ "Setting up espeak-data:amd64 (1.48.04+dfsg-5) ...\n",
+ "Setting up libsonic0:amd64 (0.2.0-6) ...\n",
+ "Setting up libespeak1:amd64 (1.48.04+dfsg-5) ...\n",
+ "Setting up espeak (1.48.04+dfsg-5) ...\n",
+ "Processing triggers for man-db (2.8.3-2ubuntu0.1) ...\n",
+ "Processing triggers for libc-bin (2.27-3ubuntu1) ...\n",
+ "/sbin/ldconfig.real: /usr/local/lib/python3.6/dist-packages/ideep4py/lib/libmkldnn.so.0 is not a symbolic link\n",
+ "\n",
+ "Requirement already satisfied: torch>=1.5 in /usr/local/lib/python3.6/dist-packages (from -r requirements.txt (line 1)) (1.5.1+cu101)\n",
+ "Requirement already satisfied: tensorflow>=2.2 in /usr/local/lib/python3.6/dist-packages (from -r requirements.txt (line 2)) (2.2.0)\n",
+ "Requirement already satisfied: numpy>=1.16.0 in /usr/local/lib/python3.6/dist-packages (from -r requirements.txt (line 3)) (1.18.5)\n",
+ "Requirement already satisfied: scipy>=0.19.0 in /usr/local/lib/python3.6/dist-packages (from -r requirements.txt (line 4)) (1.4.1)\n",
+ "Requirement already satisfied: numba==0.48 in /usr/local/lib/python3.6/dist-packages (from -r requirements.txt (line 5)) (0.48.0)\n",
+ "Collecting librosa==0.7.2\n",
+ "\u001b[?25l Downloading https://files.pythonhosted.org/packages/77/b5/1817862d64a7c231afd15419d8418ae1f000742cac275e85c74b219cbccb/librosa-0.7.2.tar.gz (1.6MB)\n",
+ "\u001b[K |████████████████████████████████| 1.6MB 4.7MB/s \n",
+ "\u001b[?25hCollecting phonemizer>=2.2.0\n",
+ "\u001b[?25l Downloading https://files.pythonhosted.org/packages/e1/ec/eb95ec96dc5374ba339d47c5252d62e9a7b1fbd5c9e4eefebc0d7e25381d/phonemizer-2.2.1-py3-none-any.whl (49kB)\n",
+ "\u001b[K |████████████████████████████████| 51kB 9.0MB/s \n",
+ "\u001b[?25hCollecting unidecode==0.4.20\n",
+ "\u001b[?25l Downloading https://files.pythonhosted.org/packages/c3/6f/05f5deb753d0594583aa1cc0d2fe9d631d9a00e9b28d0da49f8d3763755b/Unidecode-0.04.20-py2.py3-none-any.whl (228kB)\n",
+ "\u001b[K |████████████████████████████████| 235kB 30.0MB/s \n",
+ "\u001b[?25hCollecting attrdict\n",
+ " Downloading https://files.pythonhosted.org/packages/ef/97/28fe7e68bc7adfce67d4339756e85e9fcf3c6fd7f0c0781695352b70472c/attrdict-2.0.1-py2.py3-none-any.whl\n",
+ "Collecting tensorboardX\n",
+ "\u001b[?25l Downloading https://files.pythonhosted.org/packages/af/0c/4f41bcd45db376e6fe5c619c01100e9b7531c55791b7244815bac6eac32c/tensorboardX-2.1-py2.py3-none-any.whl (308kB)\n",
+ "\u001b[K |████████████████████████████████| 317kB 16.7MB/s \n",
+ "\u001b[?25hRequirement already satisfied: matplotlib in /usr/local/lib/python3.6/dist-packages (from -r requirements.txt (line 11)) (3.2.2)\n",
+ "Requirement already satisfied: Pillow in /usr/local/lib/python3.6/dist-packages (from -r requirements.txt (line 12)) (7.0.0)\n",
+ "Requirement already satisfied: flask in /usr/local/lib/python3.6/dist-packages (from -r requirements.txt (line 13)) (1.1.2)\n",
+ "Requirement already satisfied: tqdm in /usr/local/lib/python3.6/dist-packages (from -r requirements.txt (line 14)) (4.41.1)\n",
+ "Requirement already satisfied: inflect in /usr/local/lib/python3.6/dist-packages (from -r requirements.txt (line 15)) (2.1.0)\n",
+ "Collecting bokeh==1.4.0\n",
+ "\u001b[?25l Downloading https://files.pythonhosted.org/packages/de/70/fdd4b186d8570a737372487cc5547aac885a1270626e3ebf03db1808e4ed/bokeh-1.4.0.tar.gz (32.4MB)\n",
+ "\u001b[K |████████████████████████████████| 32.4MB 100kB/s \n",
+ "\u001b[?25hCollecting pysbd\n",
+ " Downloading https://files.pythonhosted.org/packages/3b/49/4799b3cdf80aee5fa4562a3929eda738845900bbeef4ee60481196ad4d1a/pysbd-0.2.3-py3-none-any.whl\n",
+ "Collecting soundfile\n",
+ " Downloading https://files.pythonhosted.org/packages/eb/f2/3cbbbf3b96fb9fa91582c438b574cff3f45b29c772f94c400e2c99ef5db9/SoundFile-0.10.3.post1-py2.py3-none-any.whl\n",
+ "Collecting nose==1.3.7\n",
+ "\u001b[?25l Downloading https://files.pythonhosted.org/packages/15/d8/dd071918c040f50fa1cf80da16423af51ff8ce4a0f2399b7bf8de45ac3d9/nose-1.3.7-py3-none-any.whl (154kB)\n",
+ "\u001b[K |████████████████████████████████| 163kB 54.4MB/s \n",
+ "\u001b[?25hCollecting cardboardlint==1.3.0\n",
+ " Downloading https://files.pythonhosted.org/packages/a8/d4/02c9ad87226867995e8cc89791ba3a5a653e1d25c04263adabe87b7e1472/cardboardlint-1.3.0.tar.gz\n",
+ "Collecting pylint==2.5.3\n",
+ "\u001b[?25l Downloading https://files.pythonhosted.org/packages/e8/fb/734960c55474c8f74e6ad4c8588fc44073fb9d69e223269d26a3c2435d16/pylint-2.5.3-py3-none-any.whl (324kB)\n",
+ "\u001b[K |████████████████████████████████| 327kB 55.3MB/s \n",
+ "\u001b[?25hCollecting fuzzywuzzy\n",
+ " Downloading https://files.pythonhosted.org/packages/43/ff/74f23998ad2f93b945c0309f825be92e04e0348e062026998b5eefef4c33/fuzzywuzzy-0.18.0-py2.py3-none-any.whl\n",
+ "Requirement already satisfied: gdown in /usr/local/lib/python3.6/dist-packages (from -r requirements.txt (line 23)) (3.6.4)\n",
+ "Requirement already satisfied: future in /usr/local/lib/python3.6/dist-packages (from torch>=1.5->-r requirements.txt (line 1)) (0.16.0)\n",
+ "Requirement already satisfied: termcolor>=1.1.0 in /usr/local/lib/python3.6/dist-packages (from tensorflow>=2.2->-r requirements.txt (line 2)) (1.1.0)\n",
+ "Requirement already satisfied: astunparse==1.6.3 in /usr/local/lib/python3.6/dist-packages (from tensorflow>=2.2->-r requirements.txt (line 2)) (1.6.3)\n",
+ "Requirement already satisfied: absl-py>=0.7.0 in /usr/local/lib/python3.6/dist-packages (from tensorflow>=2.2->-r requirements.txt (line 2)) (0.9.0)\n",
+ "Requirement already satisfied: opt-einsum>=2.3.2 in /usr/local/lib/python3.6/dist-packages (from tensorflow>=2.2->-r requirements.txt (line 2)) (3.3.0)\n",
+ "Requirement already satisfied: six>=1.12.0 in /usr/local/lib/python3.6/dist-packages (from tensorflow>=2.2->-r requirements.txt (line 2)) (1.15.0)\n",
+ "Requirement already satisfied: protobuf>=3.8.0 in /usr/local/lib/python3.6/dist-packages (from tensorflow>=2.2->-r requirements.txt (line 2)) (3.12.2)\n",
+ "Requirement already satisfied: wrapt>=1.11.1 in /usr/local/lib/python3.6/dist-packages (from tensorflow>=2.2->-r requirements.txt (line 2)) (1.12.1)\n",
+ "Requirement already satisfied: gast==0.3.3 in /usr/local/lib/python3.6/dist-packages (from tensorflow>=2.2->-r requirements.txt (line 2)) (0.3.3)\n",
+ "Requirement already satisfied: keras-preprocessing>=1.1.0 in /usr/local/lib/python3.6/dist-packages (from tensorflow>=2.2->-r requirements.txt (line 2)) (1.1.2)\n",
+ "Requirement already satisfied: h5py<2.11.0,>=2.10.0 in /usr/local/lib/python3.6/dist-packages (from tensorflow>=2.2->-r requirements.txt (line 2)) (2.10.0)\n",
+ "Requirement already satisfied: google-pasta>=0.1.8 in /usr/local/lib/python3.6/dist-packages (from tensorflow>=2.2->-r requirements.txt (line 2)) (0.2.0)\n",
+ "Requirement already satisfied: tensorboard<2.3.0,>=2.2.0 in /usr/local/lib/python3.6/dist-packages (from tensorflow>=2.2->-r requirements.txt (line 2)) (2.2.2)\n",
+ "Requirement already satisfied: wheel>=0.26; python_version >= \"3\" in /usr/local/lib/python3.6/dist-packages (from tensorflow>=2.2->-r requirements.txt (line 2)) (0.34.2)\n",
+ "Requirement already satisfied: tensorflow-estimator<2.3.0,>=2.2.0 in /usr/local/lib/python3.6/dist-packages (from tensorflow>=2.2->-r requirements.txt (line 2)) (2.2.0)\n",
+ "Requirement already satisfied: grpcio>=1.8.6 in /usr/local/lib/python3.6/dist-packages (from tensorflow>=2.2->-r requirements.txt (line 2)) (1.30.0)\n",
+ "Requirement already satisfied: llvmlite<0.32.0,>=0.31.0dev0 in /usr/local/lib/python3.6/dist-packages (from numba==0.48->-r requirements.txt (line 5)) (0.31.0)\n",
+ "Requirement already satisfied: setuptools in /usr/local/lib/python3.6/dist-packages (from numba==0.48->-r requirements.txt (line 5)) (49.1.0)\n",
+ "Requirement already satisfied: audioread>=2.0.0 in /usr/local/lib/python3.6/dist-packages (from librosa==0.7.2->-r requirements.txt (line 6)) (2.1.8)\n",
+ "Requirement already satisfied: scikit-learn!=0.19.0,>=0.14.0 in /usr/local/lib/python3.6/dist-packages (from librosa==0.7.2->-r requirements.txt (line 6)) (0.22.2.post1)\n",
+ "Requirement already satisfied: joblib>=0.12 in /usr/local/lib/python3.6/dist-packages (from librosa==0.7.2->-r requirements.txt (line 6)) (0.16.0)\n",
+ "Requirement already satisfied: decorator>=3.0.0 in /usr/local/lib/python3.6/dist-packages (from librosa==0.7.2->-r requirements.txt (line 6)) (4.4.2)\n",
+ "Requirement already satisfied: resampy>=0.2.2 in /usr/local/lib/python3.6/dist-packages (from librosa==0.7.2->-r requirements.txt (line 6)) (0.2.2)\n",
+ "Requirement already satisfied: attrs>=18.1 in /usr/local/lib/python3.6/dist-packages (from phonemizer>=2.2.0->-r requirements.txt (line 7)) (19.3.0)\n",
+ "Collecting segments\n",
+ " Downloading https://files.pythonhosted.org/packages/5b/a0/0c3fe64787745c39eb3f2f5f5f9ed8d008d9ef22e9d7f9f52f71ea4712f7/segments-2.1.3-py2.py3-none-any.whl\n",
+ "Requirement already satisfied: cycler>=0.10 in /usr/local/lib/python3.6/dist-packages (from matplotlib->-r requirements.txt (line 11)) (0.10.0)\n",
+ "Requirement already satisfied: python-dateutil>=2.1 in /usr/local/lib/python3.6/dist-packages (from matplotlib->-r requirements.txt (line 11)) (2.8.1)\n",
+ "Requirement already satisfied: pyparsing!=2.0.4,!=2.1.2,!=2.1.6,>=2.0.1 in /usr/local/lib/python3.6/dist-packages (from matplotlib->-r requirements.txt (line 11)) (2.4.7)\n",
+ "Requirement already satisfied: kiwisolver>=1.0.1 in /usr/local/lib/python3.6/dist-packages (from matplotlib->-r requirements.txt (line 11)) (1.2.0)\n",
+ "Requirement already satisfied: click>=5.1 in /usr/local/lib/python3.6/dist-packages (from flask->-r requirements.txt (line 13)) (7.1.2)\n",
+ "Requirement already satisfied: Jinja2>=2.10.1 in /usr/local/lib/python3.6/dist-packages (from flask->-r requirements.txt (line 13)) (2.11.2)\n",
+ "Requirement already satisfied: itsdangerous>=0.24 in /usr/local/lib/python3.6/dist-packages (from flask->-r requirements.txt (line 13)) (1.1.0)\n",
+ "Requirement already satisfied: Werkzeug>=0.15 in /usr/local/lib/python3.6/dist-packages (from flask->-r requirements.txt (line 13)) (1.0.1)\n",
+ "Requirement already satisfied: PyYAML>=3.10 in /usr/local/lib/python3.6/dist-packages (from bokeh==1.4.0->-r requirements.txt (line 16)) (3.13)\n",
+ "Requirement already satisfied: packaging>=16.8 in /usr/local/lib/python3.6/dist-packages (from bokeh==1.4.0->-r requirements.txt (line 16)) (20.4)\n",
+ "Requirement already satisfied: tornado>=4.3 in /usr/local/lib/python3.6/dist-packages (from bokeh==1.4.0->-r requirements.txt (line 16)) (5.1.1)\n",
+ "Requirement already satisfied: cffi>=1.0 in /usr/local/lib/python3.6/dist-packages (from soundfile->-r requirements.txt (line 18)) (1.14.0)\n",
+ "Collecting isort<5,>=4.2.5\n",
+ "\u001b[?25l Downloading https://files.pythonhosted.org/packages/e5/b0/c121fd1fa3419ea9bfd55c7f9c4fedfec5143208d8c7ad3ce3db6c623c21/isort-4.3.21-py2.py3-none-any.whl (42kB)\n",
+ "\u001b[K |████████████████████████████████| 51kB 7.2MB/s \n",
+ "\u001b[?25hCollecting astroid<=2.5,>=2.4.0\n",
+ "\u001b[?25l Downloading https://files.pythonhosted.org/packages/24/a8/5133f51967fb21e46ee50831c3f5dda49e976b7f915408d670b1603d41d6/astroid-2.4.2-py3-none-any.whl (213kB)\n",
+ "\u001b[K |████████████████████████████████| 215kB 55.8MB/s \n",
+ "\u001b[?25hCollecting toml>=0.7.1\n",
+ " Downloading https://files.pythonhosted.org/packages/9f/e1/1b40b80f2e1663a6b9f497123c11d7d988c0919abbf3c3f2688e448c5363/toml-0.10.1-py2.py3-none-any.whl\n",
+ "Collecting mccabe<0.7,>=0.6\n",
+ " Downloading https://files.pythonhosted.org/packages/87/89/479dc97e18549e21354893e4ee4ef36db1d237534982482c3681ee6e7b57/mccabe-0.6.1-py2.py3-none-any.whl\n",
+ "Requirement already satisfied: requests in /usr/local/lib/python3.6/dist-packages (from gdown->-r requirements.txt (line 23)) (2.23.0)\n",
+ "Requirement already satisfied: google-auth<2,>=1.6.3 in /usr/local/lib/python3.6/dist-packages (from tensorboard<2.3.0,>=2.2.0->tensorflow>=2.2->-r requirements.txt (line 2)) (1.17.2)\n",
+ "Requirement already satisfied: google-auth-oauthlib<0.5,>=0.4.1 in /usr/local/lib/python3.6/dist-packages (from tensorboard<2.3.0,>=2.2.0->tensorflow>=2.2->-r requirements.txt (line 2)) (0.4.1)\n",
+ "Requirement already satisfied: tensorboard-plugin-wit>=1.6.0 in /usr/local/lib/python3.6/dist-packages (from tensorboard<2.3.0,>=2.2.0->tensorflow>=2.2->-r requirements.txt (line 2)) (1.7.0)\n",
+ "Requirement already satisfied: markdown>=2.6.8 in /usr/local/lib/python3.6/dist-packages (from tensorboard<2.3.0,>=2.2.0->tensorflow>=2.2->-r requirements.txt (line 2)) (3.2.2)\n",
+ "Collecting csvw>=1.5.6\n",
+ " Downloading https://files.pythonhosted.org/packages/d1/b6/8fef6788b8f05b21424a17ae3881eff916d42e5c7e87f57a85d9d7abf0a1/csvw-1.7.0-py2.py3-none-any.whl\n",
+ "Requirement already satisfied: regex in /usr/local/lib/python3.6/dist-packages (from segments->phonemizer>=2.2.0->-r requirements.txt (line 7)) (2019.12.20)\n",
+ "Collecting clldutils>=1.7.3\n",
+ "\u001b[?25l Downloading https://files.pythonhosted.org/packages/7b/b3/05882a8d5c8a7f7c69a47500334ac99623928edca930278d6ab88ee6d99b/clldutils-3.5.2-py2.py3-none-any.whl (189kB)\n",
+ "\u001b[K |████████████████████████████████| 194kB 49.8MB/s \n",
+ "\u001b[?25hRequirement already satisfied: MarkupSafe>=0.23 in /usr/local/lib/python3.6/dist-packages (from Jinja2>=2.10.1->flask->-r requirements.txt (line 13)) (1.1.1)\n",
+ "Requirement already satisfied: pycparser in /usr/local/lib/python3.6/dist-packages (from cffi>=1.0->soundfile->-r requirements.txt (line 18)) (2.20)\n",
+ "Collecting lazy-object-proxy==1.4.*\n",
+ "\u001b[?25l Downloading https://files.pythonhosted.org/packages/0b/dd/b1e3407e9e6913cf178e506cd0dee818e58694d9a5cd1984e3f6a8b9a10f/lazy_object_proxy-1.4.3-cp36-cp36m-manylinux1_x86_64.whl (55kB)\n",
+ "\u001b[K |████████████████████████████████| 61kB 8.6MB/s \n",
+ "\u001b[?25hCollecting typed-ast<1.5,>=1.4.0; implementation_name == \"cpython\" and python_version < \"3.8\"\n",
+ "\u001b[?25l Downloading https://files.pythonhosted.org/packages/90/ed/5459080d95eb87a02fe860d447197be63b6e2b5e9ff73c2b0a85622994f4/typed_ast-1.4.1-cp36-cp36m-manylinux1_x86_64.whl (737kB)\n",
+ "\u001b[K |████████████████████████████████| 747kB 54.2MB/s \n",
+ "\u001b[?25hRequirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python3.6/dist-packages (from requests->gdown->-r requirements.txt (line 23)) (2020.6.20)\n",
+ "Requirement already satisfied: chardet<4,>=3.0.2 in /usr/local/lib/python3.6/dist-packages (from requests->gdown->-r requirements.txt (line 23)) (3.0.4)\n",
+ "Requirement already satisfied: urllib3!=1.25.0,!=1.25.1,<1.26,>=1.21.1 in /usr/local/lib/python3.6/dist-packages (from requests->gdown->-r requirements.txt (line 23)) (1.24.3)\n",
+ "Requirement already satisfied: idna<3,>=2.5 in /usr/local/lib/python3.6/dist-packages (from requests->gdown->-r requirements.txt (line 23)) (2.10)\n",
+ "Requirement already satisfied: cachetools<5.0,>=2.0.0 in /usr/local/lib/python3.6/dist-packages (from google-auth<2,>=1.6.3->tensorboard<2.3.0,>=2.2.0->tensorflow>=2.2->-r requirements.txt (line 2)) (4.1.1)\n",
+ "Requirement already satisfied: rsa<5,>=3.1.4; python_version >= \"3\" in /usr/local/lib/python3.6/dist-packages (from google-auth<2,>=1.6.3->tensorboard<2.3.0,>=2.2.0->tensorflow>=2.2->-r requirements.txt (line 2)) (4.6)\n",
+ "Requirement already satisfied: pyasn1-modules>=0.2.1 in /usr/local/lib/python3.6/dist-packages (from google-auth<2,>=1.6.3->tensorboard<2.3.0,>=2.2.0->tensorflow>=2.2->-r requirements.txt (line 2)) (0.2.8)\n",
+ "Requirement already satisfied: requests-oauthlib>=0.7.0 in /usr/local/lib/python3.6/dist-packages (from google-auth-oauthlib<0.5,>=0.4.1->tensorboard<2.3.0,>=2.2.0->tensorflow>=2.2->-r requirements.txt (line 2)) (1.3.0)\n",
+ "Requirement already satisfied: importlib-metadata; python_version < \"3.8\" in /usr/local/lib/python3.6/dist-packages (from markdown>=2.6.8->tensorboard<2.3.0,>=2.2.0->tensorflow>=2.2->-r requirements.txt (line 2)) (1.7.0)\n",
+ "Collecting isodate\n",
+ "\u001b[?25l Downloading https://files.pythonhosted.org/packages/9b/9f/b36f7774ff5ea8e428fdcfc4bb332c39ee5b9362ddd3d40d9516a55221b2/isodate-0.6.0-py2.py3-none-any.whl (45kB)\n",
+ "\u001b[K |████████████████████████████████| 51kB 9.4MB/s \n",
+ "\u001b[?25hCollecting rfc3986\n",
+ " Downloading https://files.pythonhosted.org/packages/78/be/7b8b99fd74ff5684225f50dd0e865393d2265656ef3b4ba9eaaaffe622b8/rfc3986-1.4.0-py2.py3-none-any.whl\n",
+ "Requirement already satisfied: uritemplate>=3.0.0 in /usr/local/lib/python3.6/dist-packages (from csvw>=1.5.6->segments->phonemizer>=2.2.0->-r requirements.txt (line 7)) (3.0.1)\n",
+ "Collecting colorlog\n",
+ " Downloading https://files.pythonhosted.org/packages/2a/81/12d77537c82c5d46aa2721dfee25a0e873ef5920ebd0827152f411effb57/colorlog-4.2.1-py2.py3-none-any.whl\n",
+ "Requirement already satisfied: tabulate>=0.7.7 in /usr/local/lib/python3.6/dist-packages (from clldutils>=1.7.3->segments->phonemizer>=2.2.0->-r requirements.txt (line 7)) (0.8.7)\n",
+ "Requirement already satisfied: pyasn1>=0.1.3 in /usr/local/lib/python3.6/dist-packages (from rsa<5,>=3.1.4; python_version >= \"3\"->google-auth<2,>=1.6.3->tensorboard<2.3.0,>=2.2.0->tensorflow>=2.2->-r requirements.txt (line 2)) (0.4.8)\n",
+ "Requirement already satisfied: oauthlib>=3.0.0 in /usr/local/lib/python3.6/dist-packages (from requests-oauthlib>=0.7.0->google-auth-oauthlib<0.5,>=0.4.1->tensorboard<2.3.0,>=2.2.0->tensorflow>=2.2->-r requirements.txt (line 2)) (3.1.0)\n",
+ "Requirement already satisfied: zipp>=0.5 in /usr/local/lib/python3.6/dist-packages (from importlib-metadata; python_version < \"3.8\"->markdown>=2.6.8->tensorboard<2.3.0,>=2.2.0->tensorflow>=2.2->-r requirements.txt (line 2)) (3.1.0)\n",
+ "Building wheels for collected packages: librosa, bokeh, cardboardlint\n",
+ " Building wheel for librosa (setup.py) ... \u001b[?25l\u001b[?25hdone\n",
+ " Created wheel for librosa: filename=librosa-0.7.2-cp36-none-any.whl size=1612885 sha256=772045cdc2b1e22f5b5658822ab21ff12ed23871b729a83f7ab71702bd988fa2\n",
+ " Stored in directory: /root/.cache/pip/wheels/4c/6e/d7/bb93911540d2d1e44d690a1561871e5b6af82b69e80938abef\n",
+ " Building wheel for bokeh (setup.py) ... \u001b[?25l\u001b[?25hdone\n",
+ " Created wheel for bokeh: filename=bokeh-1.4.0-cp36-none-any.whl size=23689201 sha256=cad6fa791cc4e4304ea896a3ca0a192ca76b3e19fb6f4b9451c557f5488ff85e\n",
+ " Stored in directory: /root/.cache/pip/wheels/fb/f8/47/09700d9a19cbcbf0b7a3130690b75c0d6ff80fbda0b1774c7c\n",
+ " Building wheel for cardboardlint (setup.py) ... \u001b[?25l\u001b[?25hdone\n",
+ " Created wheel for cardboardlint: filename=cardboardlint-1.3.0-cp36-none-any.whl size=51334 sha256=784dae96378ea33bba49caa613246afb18bffc40892c8943e3dbfab99e312f7a\n",
+ " Stored in directory: /root/.cache/pip/wheels/e6/fe/8e/fbeb2cda877a1f772c0462f9f07eed851f143020947a075ee9\n",
+ "Successfully built librosa bokeh cardboardlint\n",
+ "\u001b[31mERROR: panel 0.9.7 has requirement bokeh>=2.1, but you'll have bokeh 1.4.0 which is incompatible.\u001b[0m\n",
+ "Installing collected packages: soundfile, librosa, isodate, rfc3986, csvw, colorlog, clldutils, segments, phonemizer, unidecode, attrdict, tensorboardX, bokeh, pysbd, nose, cardboardlint, isort, lazy-object-proxy, typed-ast, astroid, toml, mccabe, pylint, fuzzywuzzy\n",
+ " Found existing installation: librosa 0.6.3\n",
+ " Uninstalling librosa-0.6.3:\n",
+ " Successfully uninstalled librosa-0.6.3\n",
+ " Found existing installation: bokeh 2.1.1\n",
+ " Uninstalling bokeh-2.1.1:\n",
+ " Successfully uninstalled bokeh-2.1.1\n",
+ "Successfully installed astroid-2.4.2 attrdict-2.0.1 bokeh-1.4.0 cardboardlint-1.3.0 clldutils-3.5.2 colorlog-4.2.1 csvw-1.7.0 fuzzywuzzy-0.18.0 isodate-0.6.0 isort-4.3.21 lazy-object-proxy-1.4.3 librosa-0.7.2 mccabe-0.6.1 nose-1.3.7 phonemizer-2.2.1 pylint-2.5.3 pysbd-0.2.3 rfc3986-1.4.0 segments-2.1.3 soundfile-0.10.3.post1 tensorboardX-2.1 toml-0.10.1 typed-ast-1.4.1 unidecode-0.4.20\n",
+ "running develop\n",
+ "-- Building version 0.0.4+f0284e8\n",
+ "running egg_info\n",
+ "creating TTS.egg-info\n",
+ "writing TTS.egg-info/PKG-INFO\n",
+ "writing dependency_links to TTS.egg-info/dependency_links.txt\n",
+ "writing entry points to TTS.egg-info/entry_points.txt\n",
+ "writing requirements to TTS.egg-info/requires.txt\n",
+ "writing top-level names to TTS.egg-info/top_level.txt\n",
+ "writing manifest file 'TTS.egg-info/SOURCES.txt'\n",
+ "writing manifest file 'TTS.egg-info/SOURCES.txt'\n",
+ "running build_ext\n",
+ "Creating /usr/local/lib/python3.6/dist-packages/TTS.egg-link (link to .)\n",
+ "Adding TTS 0.0.4+f0284e8 to easy-install.pth file\n",
+ "Installing tts-server script to /usr/local/bin\n",
+ "\n",
+ "Installed /content/TTS\n",
+ "Processing dependencies for TTS==0.0.4+f0284e8\n",
+ "Searching for gdown==3.6.4\n",
+ "Best match: gdown 3.6.4\n",
+ "Adding gdown 3.6.4 to easy-install.pth file\n",
+ "Installing gdown script to /usr/local/bin\n",
+ "\n",
+ "Using /usr/local/lib/python3.6/dist-packages\n",
+ "Searching for fuzzywuzzy==0.18.0\n",
+ "Best match: fuzzywuzzy 0.18.0\n",
+ "Adding fuzzywuzzy 0.18.0 to easy-install.pth file\n",
+ "\n",
+ "Using /usr/local/lib/python3.6/dist-packages\n",
+ "Searching for pylint==2.5.3\n",
+ "Best match: pylint 2.5.3\n",
+ "Adding pylint 2.5.3 to easy-install.pth file\n",
+ "Installing epylint script to /usr/local/bin\n",
+ "Installing pylint script to /usr/local/bin\n",
+ "Installing pyreverse script to /usr/local/bin\n",
+ "Installing symilar script to /usr/local/bin\n",
+ "\n",
+ "Using /usr/local/lib/python3.6/dist-packages\n",
+ "Searching for cardboardlint==1.3.0\n",
+ "Best match: cardboardlint 1.3.0\n",
+ "Adding cardboardlint 1.3.0 to easy-install.pth file\n",
+ "Installing cardboardlinter script to /usr/local/bin\n",
+ "\n",
+ "Using /usr/local/lib/python3.6/dist-packages\n",
+ "Searching for nose==1.3.7\n",
+ "Best match: nose 1.3.7\n",
+ "Adding nose 1.3.7 to easy-install.pth file\n",
+ "Installing nosetests script to /usr/local/bin\n",
+ "Installing nosetests-3.4 script to /usr/local/bin\n",
+ "\n",
+ "Using /usr/local/lib/python3.6/dist-packages\n",
+ "Searching for phonemizer==2.2.1\n",
+ "Best match: phonemizer 2.2.1\n",
+ "Adding phonemizer 2.2.1 to easy-install.pth file\n",
+ "Installing phonemize script to /usr/local/bin\n",
+ "\n",
+ "Using /usr/local/lib/python3.6/dist-packages\n",
+ "Searching for SoundFile==0.10.3.post1\n",
+ "Best match: SoundFile 0.10.3.post1\n",
+ "Adding SoundFile 0.10.3.post1 to easy-install.pth file\n",
+ "\n",
+ "Using /usr/local/lib/python3.6/dist-packages\n",
+ "Searching for bokeh==1.4.0\n",
+ "Best match: bokeh 1.4.0\n",
+ "Adding bokeh 1.4.0 to easy-install.pth file\n",
+ "Installing bokeh script to /usr/local/bin\n",
+ "\n",
+ "Using /usr/local/lib/python3.6/dist-packages\n",
+ "Searching for pysbd==0.2.3\n",
+ "Best match: pysbd 0.2.3\n",
+ "Adding pysbd 0.2.3 to easy-install.pth file\n",
+ "\n",
+ "Using /usr/local/lib/python3.6/dist-packages\n",
+ "Searching for inflect==2.1.0\n",
+ "Best match: inflect 2.1.0\n",
+ "Adding inflect 2.1.0 to easy-install.pth file\n",
+ "\n",
+ "Using /usr/local/lib/python3.6/dist-packages\n",
+ "Searching for tqdm==4.41.1\n",
+ "Best match: tqdm 4.41.1\n",
+ "Adding tqdm 4.41.1 to easy-install.pth file\n",
+ "Installing tqdm script to /usr/local/bin\n",
+ "\n",
+ "Using /usr/local/lib/python3.6/dist-packages\n",
+ "Searching for Flask==1.1.2\n",
+ "Best match: Flask 1.1.2\n",
+ "Adding Flask 1.1.2 to easy-install.pth file\n",
+ "Installing flask script to /usr/local/bin\n",
+ "\n",
+ "Using /usr/local/lib/python3.6/dist-packages\n",
+ "Searching for Pillow==7.0.0\n",
+ "Best match: Pillow 7.0.0\n",
+ "Adding Pillow 7.0.0 to easy-install.pth file\n",
+ "\n",
+ "Using /usr/local/lib/python3.6/dist-packages\n",
+ "Searching for matplotlib==3.2.2\n",
+ "Best match: matplotlib 3.2.2\n",
+ "Adding matplotlib 3.2.2 to easy-install.pth file\n",
+ "\n",
+ "Using /usr/local/lib/python3.6/dist-packages\n",
+ "Searching for tensorboardX==2.1\n",
+ "Best match: tensorboardX 2.1\n",
+ "Adding tensorboardX 2.1 to easy-install.pth file\n",
+ "\n",
+ "Using /usr/local/lib/python3.6/dist-packages\n",
+ "Searching for attrdict==2.0.1\n",
+ "Best match: attrdict 2.0.1\n",
+ "Adding attrdict 2.0.1 to easy-install.pth file\n",
+ "\n",
+ "Using /usr/local/lib/python3.6/dist-packages\n",
+ "Searching for Unidecode==0.4.20\n",
+ "Best match: Unidecode 0.4.20\n",
+ "Adding Unidecode 0.4.20 to easy-install.pth file\n",
+ "Installing unidecode script to /usr/local/bin\n",
+ "\n",
+ "Using /usr/local/lib/python3.6/dist-packages\n",
+ "Searching for librosa==0.7.2\n",
+ "Best match: librosa 0.7.2\n",
+ "Adding librosa 0.7.2 to easy-install.pth file\n",
+ "\n",
+ "Using /usr/local/lib/python3.6/dist-packages\n",
+ "Searching for scipy==1.4.1\n",
+ "Best match: scipy 1.4.1\n",
+ "Adding scipy 1.4.1 to easy-install.pth file\n",
+ "\n",
+ "Using /usr/local/lib/python3.6/dist-packages\n",
+ "Searching for numba==0.48.0\n",
+ "Best match: numba 0.48.0\n",
+ "Adding numba 0.48.0 to easy-install.pth file\n",
+ "\n",
+ "Using /usr/local/lib/python3.6/dist-packages\n",
+ "Searching for numpy==1.18.5\n",
+ "Best match: numpy 1.18.5\n",
+ "Adding numpy 1.18.5 to easy-install.pth file\n",
+ "Installing f2py script to /usr/local/bin\n",
+ "Installing f2py3 script to /usr/local/bin\n",
+ "Installing f2py3.6 script to /usr/local/bin\n",
+ "\n",
+ "Using /usr/local/lib/python3.6/dist-packages\n",
+ "Searching for torch==1.5.1+cu101\n",
+ "Best match: torch 1.5.1+cu101\n",
+ "Adding torch 1.5.1+cu101 to easy-install.pth file\n",
+ "Installing convert-caffe2-to-onnx script to /usr/local/bin\n",
+ "Installing convert-onnx-to-caffe2 script to /usr/local/bin\n",
+ "\n",
+ "Using /usr/local/lib/python3.6/dist-packages\n",
+ "Searching for requests==2.23.0\n",
+ "Best match: requests 2.23.0\n",
+ "Adding requests 2.23.0 to easy-install.pth file\n",
+ "\n",
+ "Using /usr/local/lib/python3.6/dist-packages\n",
+ "Searching for six==1.15.0\n",
+ "Best match: six 1.15.0\n",
+ "Adding six 1.15.0 to easy-install.pth file\n",
+ "\n",
+ "Using /usr/local/lib/python3.6/dist-packages\n",
+ "Searching for toml==0.10.1\n",
+ "Best match: toml 0.10.1\n",
+ "Adding toml 0.10.1 to easy-install.pth file\n",
+ "\n",
+ "Using /usr/local/lib/python3.6/dist-packages\n",
+ "Searching for isort==4.3.21\n",
+ "Best match: isort 4.3.21\n",
+ "Adding isort 4.3.21 to easy-install.pth file\n",
+ "Installing isort script to /usr/local/bin\n",
+ "\n",
+ "Using /usr/local/lib/python3.6/dist-packages\n",
+ "Searching for mccabe==0.6.1\n",
+ "Best match: mccabe 0.6.1\n",
+ "Adding mccabe 0.6.1 to easy-install.pth file\n",
+ "\n",
+ "Using /usr/local/lib/python3.6/dist-packages\n",
+ "Searching for astroid==2.4.2\n",
+ "Best match: astroid 2.4.2\n",
+ "Adding astroid 2.4.2 to easy-install.pth file\n",
+ "\n",
+ "Using /usr/local/lib/python3.6/dist-packages\n",
+ "Searching for PyYAML==3.13\n",
+ "Best match: PyYAML 3.13\n",
+ "Adding PyYAML 3.13 to easy-install.pth file\n",
+ "\n",
+ "Using /usr/local/lib/python3.6/dist-packages\n",
+ "Searching for joblib==0.16.0\n",
+ "Best match: joblib 0.16.0\n",
+ "Adding joblib 0.16.0 to easy-install.pth file\n",
+ "\n",
+ "Using /usr/local/lib/python3.6/dist-packages\n",
+ "Searching for attrs==19.3.0\n",
+ "Best match: attrs 19.3.0\n",
+ "Adding attrs 19.3.0 to easy-install.pth file\n",
+ "\n",
+ "Using /usr/local/lib/python3.6/dist-packages\n",
+ "Searching for segments==2.1.3\n",
+ "Best match: segments 2.1.3\n",
+ "Adding segments 2.1.3 to easy-install.pth file\n",
+ "Installing segments script to /usr/local/bin\n",
+ "\n",
+ "Using /usr/local/lib/python3.6/dist-packages\n",
+ "Searching for cffi==1.14.0\n",
+ "Best match: cffi 1.14.0\n",
+ "Adding cffi 1.14.0 to easy-install.pth file\n",
+ "\n",
+ "Using /usr/local/lib/python3.6/dist-packages\n",
+ "Searching for packaging==20.4\n",
+ "Best match: packaging 20.4\n",
+ "Adding packaging 20.4 to easy-install.pth file\n",
+ "\n",
+ "Using /usr/local/lib/python3.6/dist-packages\n",
+ "Searching for tornado==5.1.1\n",
+ "Best match: tornado 5.1.1\n",
+ "Adding tornado 5.1.1 to easy-install.pth file\n",
+ "\n",
+ "Using /usr/local/lib/python3.6/dist-packages\n",
+ "Searching for Jinja2==2.11.2\n",
+ "Best match: Jinja2 2.11.2\n",
+ "Adding Jinja2 2.11.2 to easy-install.pth file\n",
+ "\n",
+ "Using /usr/local/lib/python3.6/dist-packages\n",
+ "Searching for python-dateutil==2.8.1\n",
+ "Best match: python-dateutil 2.8.1\n",
+ "Adding python-dateutil 2.8.1 to easy-install.pth file\n",
+ "\n",
+ "Using /usr/local/lib/python3.6/dist-packages\n",
+ "Searching for click==7.1.2\n",
+ "Best match: click 7.1.2\n",
+ "Adding click 7.1.2 to easy-install.pth file\n",
+ "\n",
+ "Using /usr/local/lib/python3.6/dist-packages\n",
+ "Searching for itsdangerous==1.1.0\n",
+ "Best match: itsdangerous 1.1.0\n",
+ "Adding itsdangerous 1.1.0 to easy-install.pth file\n",
+ "\n",
+ "Using /usr/local/lib/python3.6/dist-packages\n",
+ "Searching for Werkzeug==1.0.1\n",
+ "Best match: Werkzeug 1.0.1\n",
+ "Adding Werkzeug 1.0.1 to easy-install.pth file\n",
+ "\n",
+ "Using /usr/local/lib/python3.6/dist-packages\n",
+ "Searching for cycler==0.10.0\n",
+ "Best match: cycler 0.10.0\n",
+ "Adding cycler 0.10.0 to easy-install.pth file\n",
+ "\n",
+ "Using /usr/local/lib/python3.6/dist-packages\n",
+ "Searching for kiwisolver==1.2.0\n",
+ "Best match: kiwisolver 1.2.0\n",
+ "Adding kiwisolver 1.2.0 to easy-install.pth file\n",
+ "\n",
+ "Using /usr/local/lib/python3.6/dist-packages\n",
+ "Searching for pyparsing==2.4.7\n",
+ "Best match: pyparsing 2.4.7\n",
+ "Adding pyparsing 2.4.7 to easy-install.pth file\n",
+ "\n",
+ "Using /usr/local/lib/python3.6/dist-packages\n",
+ "Searching for protobuf==3.12.2\n",
+ "Best match: protobuf 3.12.2\n",
+ "Adding protobuf 3.12.2 to easy-install.pth file\n",
+ "\n",
+ "Using /usr/local/lib/python3.6/dist-packages\n",
+ "Searching for scikit-learn==0.22.2.post1\n",
+ "Best match: scikit-learn 0.22.2.post1\n",
+ "Adding scikit-learn 0.22.2.post1 to easy-install.pth file\n",
+ "\n",
+ "Using /usr/local/lib/python3.6/dist-packages\n",
+ "Searching for audioread==2.1.8\n",
+ "Best match: audioread 2.1.8\n",
+ "Adding audioread 2.1.8 to easy-install.pth file\n",
+ "\n",
+ "Using /usr/local/lib/python3.6/dist-packages\n",
+ "Searching for resampy==0.2.2\n",
+ "Best match: resampy 0.2.2\n",
+ "Adding resampy 0.2.2 to easy-install.pth file\n",
+ "\n",
+ "Using /usr/local/lib/python3.6/dist-packages\n",
+ "Searching for decorator==4.4.2\n",
+ "Best match: decorator 4.4.2\n",
+ "Adding decorator 4.4.2 to easy-install.pth file\n",
+ "\n",
+ "Using /usr/local/lib/python3.6/dist-packages\n",
+ "Searching for llvmlite==0.31.0\n",
+ "Best match: llvmlite 0.31.0\n",
+ "Adding llvmlite 0.31.0 to easy-install.pth file\n",
+ "\n",
+ "Using /usr/local/lib/python3.6/dist-packages\n",
+ "Searching for setuptools==49.1.0\n",
+ "Best match: setuptools 49.1.0\n",
+ "Adding setuptools 49.1.0 to easy-install.pth file\n",
+ "Installing easy_install script to /usr/local/bin\n",
+ "Installing easy_install-3.8 script to /usr/local/bin\n",
+ "\n",
+ "Using /usr/local/lib/python3.6/dist-packages\n",
+ "Searching for future==0.16.0\n",
+ "Best match: future 0.16.0\n",
+ "Adding future 0.16.0 to easy-install.pth file\n",
+ "Installing futurize script to /usr/local/bin\n",
+ "Installing pasteurize script to /usr/local/bin\n",
+ "\n",
+ "Using /usr/local/lib/python3.6/dist-packages\n",
+ "Searching for chardet==3.0.4\n",
+ "Best match: chardet 3.0.4\n",
+ "Adding chardet 3.0.4 to easy-install.pth file\n",
+ "Installing chardetect script to /usr/local/bin\n",
+ "\n",
+ "Using /usr/local/lib/python3.6/dist-packages\n",
+ "Searching for urllib3==1.24.3\n",
+ "Best match: urllib3 1.24.3\n",
+ "Adding urllib3 1.24.3 to easy-install.pth file\n",
+ "\n",
+ "Using /usr/local/lib/python3.6/dist-packages\n",
+ "Searching for certifi==2020.6.20\n",
+ "Best match: certifi 2020.6.20\n",
+ "Adding certifi 2020.6.20 to easy-install.pth file\n",
+ "\n",
+ "Using /usr/local/lib/python3.6/dist-packages\n",
+ "Searching for idna==2.10\n",
+ "Best match: idna 2.10\n",
+ "Adding idna 2.10 to easy-install.pth file\n",
+ "\n",
+ "Using /usr/local/lib/python3.6/dist-packages\n",
+ "Searching for wrapt==1.12.1\n",
+ "Best match: wrapt 1.12.1\n",
+ "Adding wrapt 1.12.1 to easy-install.pth file\n",
+ "\n",
+ "Using /usr/local/lib/python3.6/dist-packages\n",
+ "Searching for typed-ast==1.4.1\n",
+ "Best match: typed-ast 1.4.1\n",
+ "Adding typed-ast 1.4.1 to easy-install.pth file\n",
+ "\n",
+ "Using /usr/local/lib/python3.6/dist-packages\n",
+ "Searching for lazy-object-proxy==1.4.3\n",
+ "Best match: lazy-object-proxy 1.4.3\n",
+ "Adding lazy-object-proxy 1.4.3 to easy-install.pth file\n",
+ "\n",
+ "Using /usr/local/lib/python3.6/dist-packages\n",
+ "Searching for csvw==1.7.0\n",
+ "Best match: csvw 1.7.0\n",
+ "Adding csvw 1.7.0 to easy-install.pth file\n",
+ "\n",
+ "Using /usr/local/lib/python3.6/dist-packages\n",
+ "Searching for clldutils==3.5.2\n",
+ "Best match: clldutils 3.5.2\n",
+ "Adding clldutils 3.5.2 to easy-install.pth file\n",
+ "\n",
+ "Using /usr/local/lib/python3.6/dist-packages\n",
+ "Searching for regex==2019.12.20\n",
+ "Best match: regex 2019.12.20\n",
+ "Adding regex 2019.12.20 to easy-install.pth file\n",
+ "\n",
+ "Using /usr/local/lib/python3.6/dist-packages\n",
+ "Searching for pycparser==2.20\n",
+ "Best match: pycparser 2.20\n",
+ "Adding pycparser 2.20 to easy-install.pth file\n",
+ "\n",
+ "Using /usr/local/lib/python3.6/dist-packages\n",
+ "Searching for MarkupSafe==1.1.1\n",
+ "Best match: MarkupSafe 1.1.1\n",
+ "Adding MarkupSafe 1.1.1 to easy-install.pth file\n",
+ "\n",
+ "Using /usr/local/lib/python3.6/dist-packages\n",
+ "Searching for isodate==0.6.0\n",
+ "Best match: isodate 0.6.0\n",
+ "Adding isodate 0.6.0 to easy-install.pth file\n",
+ "\n",
+ "Using /usr/local/lib/python3.6/dist-packages\n",
+ "Searching for rfc3986==1.4.0\n",
+ "Best match: rfc3986 1.4.0\n",
+ "Adding rfc3986 1.4.0 to easy-install.pth file\n",
+ "\n",
+ "Using /usr/local/lib/python3.6/dist-packages\n",
+ "Searching for uritemplate==3.0.1\n",
+ "Best match: uritemplate 3.0.1\n",
+ "Adding uritemplate 3.0.1 to easy-install.pth file\n",
+ "\n",
+ "Using /usr/local/lib/python3.6/dist-packages\n",
+ "Searching for tabulate==0.8.7\n",
+ "Best match: tabulate 0.8.7\n",
+ "Adding tabulate 0.8.7 to easy-install.pth file\n",
+ "Installing tabulate script to /usr/local/bin\n",
+ "\n",
+ "Using /usr/local/lib/python3.6/dist-packages\n",
+ "Searching for colorlog==4.2.1\n",
+ "Best match: colorlog 4.2.1\n",
+ "Adding colorlog 4.2.1 to easy-install.pth file\n",
+ "\n",
+ "Using /usr/local/lib/python3.6/dist-packages\n",
+ "Finished processing dependencies for TTS==0.0.4+f0284e8\n",
+ "Collecting tensorflow==2.3.0rc0\n",
+ "\u001b[?25l Downloading https://files.pythonhosted.org/packages/8b/68/7c6c8e2b65ad4a3ff5ef658c04a6c2802ff7fe55fc7eecacb6efee1abc40/tensorflow-2.3.0rc0-cp36-cp36m-manylinux2010_x86_64.whl (320.3MB)\n",
+ "\u001b[K |████████████████████████████████| 320.3MB 53kB/s \n",
+ "\u001b[?25hRequirement already satisfied: scipy==1.4.1 in /usr/local/lib/python3.6/dist-packages (from tensorflow==2.3.0rc0) (1.4.1)\n",
+ "Requirement already satisfied: protobuf>=3.9.2 in /usr/local/lib/python3.6/dist-packages (from tensorflow==2.3.0rc0) (3.12.2)\n",
+ "Requirement already satisfied: gast==0.3.3 in /usr/local/lib/python3.6/dist-packages (from tensorflow==2.3.0rc0) (0.3.3)\n",
+ "Collecting tf-estimator-nightly<2.3.0.dev2020062302,>=2.3.0.dev2020062301\n",
+ "\u001b[?25l Downloading https://files.pythonhosted.org/packages/17/3b/fb9aafd734da258411bff2a600cabff65c7d201782318791b72422bd973d/tf_estimator_nightly-2.3.0.dev2020062301-py2.py3-none-any.whl (459kB)\n",
+ "\u001b[K |████████████████████████████████| 460kB 58.0MB/s \n",
+ "\u001b[?25hRequirement already satisfied: h5py<2.11.0,>=2.10.0 in /usr/local/lib/python3.6/dist-packages (from tensorflow==2.3.0rc0) (2.10.0)\n",
+ "Requirement already satisfied: six>=1.12.0 in /usr/local/lib/python3.6/dist-packages (from tensorflow==2.3.0rc0) (1.15.0)\n",
+ "Requirement already satisfied: numpy<1.19.0,>=1.16.0 in /usr/local/lib/python3.6/dist-packages (from tensorflow==2.3.0rc0) (1.18.5)\n",
+ "Requirement already satisfied: opt-einsum>=2.3.2 in /usr/local/lib/python3.6/dist-packages (from tensorflow==2.3.0rc0) (3.3.0)\n",
+ "Requirement already satisfied: wheel>=0.26 in /usr/local/lib/python3.6/dist-packages (from tensorflow==2.3.0rc0) (0.34.2)\n",
+ "Requirement already satisfied: tensorboard<2.3.0,>=2.2.0 in /usr/local/lib/python3.6/dist-packages (from tensorflow==2.3.0rc0) (2.2.2)\n",
+ "Requirement already satisfied: termcolor>=1.1.0 in /usr/local/lib/python3.6/dist-packages (from tensorflow==2.3.0rc0) (1.1.0)\n",
+ "Requirement already satisfied: grpcio>=1.8.6 in /usr/local/lib/python3.6/dist-packages (from tensorflow==2.3.0rc0) (1.30.0)\n",
+ "Requirement already satisfied: astunparse==1.6.3 in /usr/local/lib/python3.6/dist-packages (from tensorflow==2.3.0rc0) (1.6.3)\n",
+ "Requirement already satisfied: keras-preprocessing<1.2,>=1.1.1 in /usr/local/lib/python3.6/dist-packages (from tensorflow==2.3.0rc0) (1.1.2)\n",
+ "Requirement already satisfied: wrapt>=1.11.1 in /usr/local/lib/python3.6/dist-packages (from tensorflow==2.3.0rc0) (1.12.1)\n",
+ "Requirement already satisfied: google-pasta>=0.1.8 in /usr/local/lib/python3.6/dist-packages (from tensorflow==2.3.0rc0) (0.2.0)\n",
+ "Requirement already satisfied: absl-py>=0.7.0 in /usr/local/lib/python3.6/dist-packages (from tensorflow==2.3.0rc0) (0.9.0)\n",
+ "Requirement already satisfied: setuptools in /usr/local/lib/python3.6/dist-packages (from protobuf>=3.9.2->tensorflow==2.3.0rc0) (49.1.0)\n",
+ "Requirement already satisfied: google-auth-oauthlib<0.5,>=0.4.1 in /usr/local/lib/python3.6/dist-packages (from tensorboard<2.3.0,>=2.2.0->tensorflow==2.3.0rc0) (0.4.1)\n",
+ "Requirement already satisfied: tensorboard-plugin-wit>=1.6.0 in /usr/local/lib/python3.6/dist-packages (from tensorboard<2.3.0,>=2.2.0->tensorflow==2.3.0rc0) (1.7.0)\n",
+ "Requirement already satisfied: requests<3,>=2.21.0 in /usr/local/lib/python3.6/dist-packages (from tensorboard<2.3.0,>=2.2.0->tensorflow==2.3.0rc0) (2.23.0)\n",
+ "Requirement already satisfied: google-auth<2,>=1.6.3 in /usr/local/lib/python3.6/dist-packages (from tensorboard<2.3.0,>=2.2.0->tensorflow==2.3.0rc0) (1.17.2)\n",
+ "Requirement already satisfied: markdown>=2.6.8 in /usr/local/lib/python3.6/dist-packages (from tensorboard<2.3.0,>=2.2.0->tensorflow==2.3.0rc0) (3.2.2)\n",
+ "Requirement already satisfied: werkzeug>=0.11.15 in /usr/local/lib/python3.6/dist-packages (from tensorboard<2.3.0,>=2.2.0->tensorflow==2.3.0rc0) (1.0.1)\n",
+ "Requirement already satisfied: requests-oauthlib>=0.7.0 in /usr/local/lib/python3.6/dist-packages (from google-auth-oauthlib<0.5,>=0.4.1->tensorboard<2.3.0,>=2.2.0->tensorflow==2.3.0rc0) (1.3.0)\n",
+ "Requirement already satisfied: idna<3,>=2.5 in /usr/local/lib/python3.6/dist-packages (from requests<3,>=2.21.0->tensorboard<2.3.0,>=2.2.0->tensorflow==2.3.0rc0) (2.10)\n",
+ "Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python3.6/dist-packages (from requests<3,>=2.21.0->tensorboard<2.3.0,>=2.2.0->tensorflow==2.3.0rc0) (2020.6.20)\n",
+ "Requirement already satisfied: urllib3!=1.25.0,!=1.25.1,<1.26,>=1.21.1 in /usr/local/lib/python3.6/dist-packages (from requests<3,>=2.21.0->tensorboard<2.3.0,>=2.2.0->tensorflow==2.3.0rc0) (1.24.3)\n",
+ "Requirement already satisfied: chardet<4,>=3.0.2 in /usr/local/lib/python3.6/dist-packages (from requests<3,>=2.21.0->tensorboard<2.3.0,>=2.2.0->tensorflow==2.3.0rc0) (3.0.4)\n",
+ "Requirement already satisfied: pyasn1-modules>=0.2.1 in /usr/local/lib/python3.6/dist-packages (from google-auth<2,>=1.6.3->tensorboard<2.3.0,>=2.2.0->tensorflow==2.3.0rc0) (0.2.8)\n",
+ "Requirement already satisfied: rsa<5,>=3.1.4; python_version >= \"3\" in /usr/local/lib/python3.6/dist-packages (from google-auth<2,>=1.6.3->tensorboard<2.3.0,>=2.2.0->tensorflow==2.3.0rc0) (4.6)\n",
+ "Requirement already satisfied: cachetools<5.0,>=2.0.0 in /usr/local/lib/python3.6/dist-packages (from google-auth<2,>=1.6.3->tensorboard<2.3.0,>=2.2.0->tensorflow==2.3.0rc0) (4.1.1)\n",
+ "Requirement already satisfied: importlib-metadata; python_version < \"3.8\" in /usr/local/lib/python3.6/dist-packages (from markdown>=2.6.8->tensorboard<2.3.0,>=2.2.0->tensorflow==2.3.0rc0) (1.7.0)\n",
+ "Requirement already satisfied: oauthlib>=3.0.0 in /usr/local/lib/python3.6/dist-packages (from requests-oauthlib>=0.7.0->google-auth-oauthlib<0.5,>=0.4.1->tensorboard<2.3.0,>=2.2.0->tensorflow==2.3.0rc0) (3.1.0)\n",
+ "Requirement already satisfied: pyasn1<0.5.0,>=0.4.6 in /usr/local/lib/python3.6/dist-packages (from pyasn1-modules>=0.2.1->google-auth<2,>=1.6.3->tensorboard<2.3.0,>=2.2.0->tensorflow==2.3.0rc0) (0.4.8)\n",
+ "Requirement already satisfied: zipp>=0.5 in /usr/local/lib/python3.6/dist-packages (from importlib-metadata; python_version < \"3.8\"->markdown>=2.6.8->tensorboard<2.3.0,>=2.2.0->tensorflow==2.3.0rc0) (3.1.0)\n",
+ "Installing collected packages: tf-estimator-nightly, tensorflow\n",
+ " Found existing installation: tensorflow 2.2.0\n",
+ " Uninstalling tensorflow-2.2.0:\n",
+ " Successfully uninstalled tensorflow-2.2.0\n",
+ "Successfully installed tensorflow-2.3.0rc0 tf-estimator-nightly-2.3.0.dev2020062301\n"
+ ],
+ "name": "stdout"
+ }
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {
+ "id": "w6Krn8k1inC_",
+ "colab_type": "text"
+ },
+ "source": [
+ "\n",
+ "\n",
+ "**Download Checkpoint**\n",
+ "\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "metadata": {
+ "id": "PiYHf3lKhi9z",
+ "colab_type": "code",
+ "colab": {
+ "base_uri": "https://localhost:8080/",
+ "height": 104
+ },
+ "outputId": "75f7ecd0-3ee2-4ed2-8150-49f71a5ef4d5"
+ },
+ "source": [
+ "!wget -c -q --show-progress -O ./TTS-checkpoint.zip https://github.com/Edresson/TTS/releases/download/v1.0.0/Checkpoints-TTS-MultiSpeaker-Jia-et-al-2018.zip\n",
+ "!unzip ./TTS-checkpoint.zip\n"
+ ],
+ "execution_count": null,
+ "outputs": [
+ {
+ "output_type": "stream",
+ "text": [
+ "./TTS-checkpoint.zi 100%[===================>] 367.68M 31.9MB/s in 12s \n",
+ "Archive: ./TTS-checkpoint.zip\n",
+ " inflating: best_model.pth.tar \n",
+ " inflating: speakers.json \n",
+ " inflating: config.json \n"
+ ],
+ "name": "stdout"
+ }
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {
+ "id": "MpYNgqrZcJKn",
+ "colab_type": "text"
+ },
+ "source": [
+ "**Utils Functions**"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "metadata": {
+ "id": "4KZA4b_CbMqx",
+ "colab_type": "code",
+ "colab": {
+ "base_uri": "https://localhost:8080/",
+ "height": 52
+ },
+ "outputId": "c5d33fac-4682-4e72-8fc2-c1aa83408ef4"
+ },
+ "source": [
+ "%load_ext autoreload\n",
+ "%autoreload 2\n",
+ "import argparse\n",
+ "import json\n",
+ "# pylint: disable=redefined-outer-name, unused-argument\n",
+ "import os\n",
+ "import string\n",
+ "import time\n",
+ "import sys\n",
+ "import numpy as np\n",
+ "\n",
+ "TTS_PATH = \"../content/TTS\"\n",
+ "# add libraries into environment\n",
+ "sys.path.append(TTS_PATH) # set this if TTS is not installed globally\n",
+ "\n",
+ "import torch\n",
+ "\n",
+ "from TTS.tts.utils.generic_utils import setup_model\n",
+ "from TTS.tts.utils.synthesis import synthesis\n",
+ "from TTS.tts.utils.text.symbols import make_symbols, phonemes, symbols\n",
+ "from TTS.utils.audio import AudioProcessor\n",
+ "from TTS.utils.io import load_config\n",
+ "from TTS.vocoder.utils.generic_utils import setup_generator\n",
+ "\n",
+ "\n",
+ "def tts(model, vocoder_model, text, CONFIG, use_cuda, ap, use_gl, speaker_fileid, speaker_embedding=None):\n",
+ " t_1 = time.time()\n",
+ " waveform, _, _, mel_postnet_spec, _, _ = synthesis(model, text, CONFIG, use_cuda, ap, speaker_fileid, None, False, CONFIG.enable_eos_bos_chars, use_gl, speaker_embedding=speaker_embedding)\n",
+ " if CONFIG.model == \"Tacotron\" and not use_gl:\n",
+ " mel_postnet_spec = ap.out_linear_to_mel(mel_postnet_spec.T).T\n",
+ " if not use_gl:\n",
+ " waveform = vocoder_model.inference(torch.FloatTensor(mel_postnet_spec.T).unsqueeze(0))\n",
+ " if use_cuda and not use_gl:\n",
+ " waveform = waveform.cpu()\n",
+ " if not use_gl:\n",
+ " waveform = waveform.numpy()\n",
+ " waveform = waveform.squeeze()\n",
+ " rtf = (time.time() - t_1) / (len(waveform) / ap.sample_rate)\n",
+ " tps = (time.time() - t_1) / len(waveform)\n",
+ " print(\" > Run-time: {}\".format(time.time() - t_1))\n",
+ " print(\" > Real-time factor: {}\".format(rtf))\n",
+ " print(\" > Time per step: {}\".format(tps))\n",
+ " return waveform\n",
+ "\n"
+ ],
+ "execution_count": null,
+ "outputs": [
+ {
+ "output_type": "stream",
+ "text": [
+ "The autoreload extension is already loaded. To reload it, use:\n",
+ " %reload_ext autoreload\n"
+ ],
+ "name": "stdout"
+ }
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {
+ "id": "ENA2OumIVeMA",
+ "colab_type": "text"
+ },
+ "source": [
+ "# **Vars definitions**\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "metadata": {
+ "id": "jPD0d_XpVXmY",
+ "colab_type": "code",
+ "colab": {}
+ },
+ "source": [
+ "TEXT = ''\n",
+ "OUT_PATH = 'tests-audios/'\n",
+ "# create output path\n",
+ "os.makedirs(OUT_PATH, exist_ok=True)\n",
+ "\n",
+ "SPEAKER_FILEID = None # if None use the first embedding from speakers.json\n",
+ "\n",
+ "# model vars \n",
+ "MODEL_PATH = 'best_model.pth.tar'\n",
+ "CONFIG_PATH = 'config.json'\n",
+ "SPEAKER_JSON = 'speakers.json'\n",
+ "\n",
+ "# vocoder vars\n",
+ "VOCODER_PATH = ''\n",
+ "VOCODER_CONFIG_PATH = ''\n",
+ "\n",
+ "USE_CUDA = True"
+ ],
+ "execution_count": null,
+ "outputs": []
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {
+ "id": "dV6cXXlfi72r",
+ "colab_type": "text"
+ },
+ "source": [
+ "# **Restore TTS Model**"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "metadata": {
+ "id": "x1WgLFauWUPe",
+ "colab_type": "code",
+ "colab": {
+ "base_uri": "https://localhost:8080/",
+ "height": 486
+ },
+ "outputId": "7cc2d0bd-f3c8-41dd-9f17-438f77c1f2d2"
+ },
+ "source": [
+ "# load the config\n",
+ "C = load_config(CONFIG_PATH)\n",
+ "C.forward_attn_mask = True\n",
+ "\n",
+ "# load the audio processor\n",
+ "ap = AudioProcessor(**C.audio)\n",
+ "\n",
+ "# if the vocabulary was passed, replace the default\n",
+ "if 'characters' in C.keys():\n",
+ " symbols, phonemes = make_symbols(**C.characters)\n",
+ "\n",
+ "speaker_embedding = None\n",
+ "speaker_embedding_dim = None\n",
+ "num_speakers = 0\n",
+ "# load speakers\n",
+ "if SPEAKER_JSON != '':\n",
+ " speaker_mapping = json.load(open(SPEAKER_JSON, 'r'))\n",
+ " num_speakers = len(speaker_mapping)\n",
+ " if C.use_external_speaker_embedding_file:\n",
+ " if SPEAKER_FILEID is not None:\n",
+ " speaker_embedding = speaker_mapping[SPEAKER_FILEID]['embedding']\n",
+ " else: # if speaker_fileid is not specificated use the first sample in speakers.json\n",
+ " choise_speaker = list(speaker_mapping.keys())[0]\n",
+ " print(\" Speaker: \",choise_speaker.split('_')[0],'was chosen automatically', \"(this speaker seen in training)\")\n",
+ " speaker_embedding = speaker_mapping[choise_speaker]['embedding']\n",
+ " speaker_embedding_dim = len(speaker_embedding)\n",
+ "\n",
+ "# load the model\n",
+ "num_chars = len(phonemes) if C.use_phonemes else len(symbols)\n",
+ "model = setup_model(num_chars, num_speakers, C, speaker_embedding_dim)\n",
+ "cp = torch.load(MODEL_PATH, map_location=torch.device('cpu'))\n",
+ "model.load_state_dict(cp['model'])\n",
+ "model.eval()\n",
+ "\n",
+ "if USE_CUDA:\n",
+ " model.cuda()\n",
+ "\n",
+ "model.decoder.set_r(cp['r'])\n",
+ "\n",
+ "# load vocoder model\n",
+ "if VOCODER_PATH!= \"\":\n",
+ " VC = load_config(VOCODER_CONFIG_PATH)\n",
+ " vocoder_model = setup_generator(VC)\n",
+ " vocoder_model.load_state_dict(torch.load(VOCODER_PATH, map_location=\"cpu\")[\"model\"])\n",
+ " vocoder_model.remove_weight_norm()\n",
+ " if USE_CUDA:\n",
+ " vocoder_model.cuda()\n",
+ " vocoder_model.eval()\n",
+ "else:\n",
+ " vocoder_model = None\n",
+ " VC = None\n",
+ "\n",
+ "# synthesize voice\n",
+ "use_griffin_lim = VOCODER_PATH== \"\"\n",
+ "\n",
+ "if not C.use_external_speaker_embedding_file:\n",
+ " if SPEAKER_FILEID.isdigit():\n",
+ " SPEAKER_FILEID = int(SPEAKER_FILEID)\n",
+ " else:\n",
+ " SPEAKER_FILEID = None\n",
+ "else:\n",
+ " SPEAKER_FILEID = None\n"
+ ],
+ "execution_count": null,
+ "outputs": [
+ {
+ "output_type": "stream",
+ "text": [
+ " > Setting up Audio Processor...\n",
+ " | > sample_rate:22050\n",
+ " | > num_mels:80\n",
+ " | > min_level_db:-100\n",
+ " | > frame_shift_ms:None\n",
+ " | > frame_length_ms:None\n",
+ " | > ref_level_db:20\n",
+ " | > fft_size:1024\n",
+ " | > power:1.5\n",
+ " | > preemphasis:0.98\n",
+ " | > griffin_lim_iters:60\n",
+ " | > signal_norm:True\n",
+ " | > symmetric_norm:True\n",
+ " | > mel_fmin:0\n",
+ " | > mel_fmax:8000.0\n",
+ " | > spec_gain:20.0\n",
+ " | > stft_pad_mode:constant\n",
+ " | > max_norm:4.0\n",
+ " | > clip_norm:True\n",
+ " | > do_trim_silence:False\n",
+ " | > trim_db:60\n",
+ " | > do_sound_norm:False\n",
+ " | > stats_path:None\n",
+ " | > hop_length:256\n",
+ " | > win_length:1024\n",
+ " Speaker: p262 was chosen automatically (this speaker seen in training)\n",
+ " > Using model: Tacotron2\n"
+ ],
+ "name": "stdout"
+ }
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {
+ "id": "tNvVEoE30qY6",
+ "colab_type": "text"
+ },
+ "source": [
+ "Synthesize sentence with Speaker\n",
+ "\n",
+ "> Stop running the cell to leave!\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "metadata": {
+ "id": "2o8fXkVSyXOa",
+ "colab_type": "code",
+ "colab": {
+ "base_uri": "https://localhost:8080/",
+ "height": 704
+ },
+ "outputId": "b093ab6c-57a9-4595-8ff6-edee226cb0fd"
+ },
+ "source": [
+ "import IPython\n",
+ "from IPython.display import Audio\n",
+ "print(\"Synthesize sentence with Speaker: \",choise_speaker.split('_')[0], \"(this speaker seen in training)\")\n",
+ "while True:\n",
+ " TEXT = input(\"Enter sentence: \")\n",
+ " print(\" > Text: {}\".format(TEXT))\n",
+ " wav = tts(model, vocoder_model, TEXT, C, USE_CUDA, ap, use_griffin_lim, SPEAKER_FILEID, speaker_embedding=speaker_embedding)\n",
+ " IPython.display.display(Audio(wav, rate=ap.sample_rate))\n",
+ " # save the results\n",
+ " file_name = TEXT.replace(\" \", \"_\")\n",
+ " file_name = file_name.translate(\n",
+ " str.maketrans('', '', string.punctuation.replace('_', ''))) + '.wav'\n",
+ " out_path = os.path.join(OUT_PATH, file_name)\n",
+ " print(\" > Saving output to {}\".format(out_path))\n",
+ " ap.save_wav(wav, out_path)"
+ ],
+ "execution_count": null,
+ "outputs": [
+ {
+ "output_type": "stream",
+ "text": [
+ "Synthesize sentence with Speaker: p262 (this speaker seen in training)\n",
+ "Enter sentence: teste this demonstration :)\n",
+ " > Text: teste this demonstration :)\n",
+ " > Run-time: 2.143589496612549\n",
+ " > Real-time factor: 1.6784820231524382\n",
+ " > Time per step: 7.61217437684536e-05\n"
+ ],
+ "name": "stdout"
+ },
+ {
+ "output_type": "display_data",
+ "data": {
+ "text/html": [
+ "\n",
+ " \n",
+ " "
+ ],
+ "text/plain": [
+ ""
+ ]
+ },
+ "metadata": {
+ "tags": []
+ }
+ },
+ {
+ "output_type": "stream",
+ "text": [
+ " > Saving output to tests-audios/teste_this_demonstration_.wav\n"
+ ],
+ "name": "stdout"
+ },
+ {
+ "output_type": "error",
+ "ename": "KeyboardInterrupt",
+ "evalue": "ignored",
+ "traceback": [
+ "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
+ "\u001b[0;31mKeyboardInterrupt\u001b[0m Traceback (most recent call last)",
+ "\u001b[0;32m/usr/local/lib/python3.6/dist-packages/ipykernel/kernelbase.py\u001b[0m in \u001b[0;36m_input_request\u001b[0;34m(self, prompt, ident, parent, password)\u001b[0m\n\u001b[1;32m 728\u001b[0m \u001b[0;32mtry\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 729\u001b[0;31m \u001b[0mident\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mreply\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0msession\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mrecv\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mstdin_socket\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;36m0\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 730\u001b[0m \u001b[0;32mexcept\u001b[0m \u001b[0mException\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
+ "\u001b[0;32m/usr/local/lib/python3.6/dist-packages/jupyter_client/session.py\u001b[0m in \u001b[0;36mrecv\u001b[0;34m(self, socket, mode, content, copy)\u001b[0m\n\u001b[1;32m 802\u001b[0m \u001b[0;32mtry\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 803\u001b[0;31m \u001b[0mmsg_list\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0msocket\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mrecv_multipart\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mmode\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mcopy\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mcopy\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 804\u001b[0m \u001b[0;32mexcept\u001b[0m \u001b[0mzmq\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mZMQError\u001b[0m \u001b[0;32mas\u001b[0m \u001b[0me\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
+ "\u001b[0;32m/usr/local/lib/python3.6/dist-packages/zmq/sugar/socket.py\u001b[0m in \u001b[0;36mrecv_multipart\u001b[0;34m(self, flags, copy, track)\u001b[0m\n\u001b[1;32m 474\u001b[0m \"\"\"\n\u001b[0;32m--> 475\u001b[0;31m \u001b[0mparts\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;34m[\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mrecv\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mflags\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mcopy\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mcopy\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mtrack\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mtrack\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 476\u001b[0m \u001b[0;31m# have first part already, only loop while more to receive\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
+ "\u001b[0;32mzmq/backend/cython/socket.pyx\u001b[0m in \u001b[0;36mzmq.backend.cython.socket.Socket.recv\u001b[0;34m()\u001b[0m\n",
+ "\u001b[0;32mzmq/backend/cython/socket.pyx\u001b[0m in \u001b[0;36mzmq.backend.cython.socket.Socket.recv\u001b[0;34m()\u001b[0m\n",
+ "\u001b[0;32mzmq/backend/cython/socket.pyx\u001b[0m in \u001b[0;36mzmq.backend.cython.socket._recv_copy\u001b[0;34m()\u001b[0m\n",
+ "\u001b[0;32m/usr/local/lib/python3.6/dist-packages/zmq/backend/cython/checkrc.pxd\u001b[0m in \u001b[0;36mzmq.backend.cython.checkrc._check_rc\u001b[0;34m()\u001b[0m\n",
+ "\u001b[0;31mKeyboardInterrupt\u001b[0m: ",
+ "\nDuring handling of the above exception, another exception occurred:\n",
+ "\u001b[0;31mKeyboardInterrupt\u001b[0m Traceback (most recent call last)",
+ "\u001b[0;32m\u001b[0m in \u001b[0;36m\u001b[0;34m()\u001b[0m\n\u001b[1;32m 3\u001b[0m \u001b[0mprint\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m\"Synthesize sentence with Speaker: \"\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0mchoise_speaker\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0msplit\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m'_'\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;36m0\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m\"(this speaker seen in training)\"\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 4\u001b[0m \u001b[0;32mwhile\u001b[0m \u001b[0;32mTrue\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m----> 5\u001b[0;31m \u001b[0mTEXT\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0minput\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m\"Enter sentence: \"\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 6\u001b[0m \u001b[0mprint\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m\" > Text: {}\"\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mformat\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mTEXT\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 7\u001b[0m \u001b[0mwav\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mtts\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mmodel\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mvocoder_model\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mTEXT\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mC\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mUSE_CUDA\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0map\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0muse_griffin_lim\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mSPEAKER_FILEID\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mspeaker_embedding\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mspeaker_embedding\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
+ "\u001b[0;32m/usr/local/lib/python3.6/dist-packages/ipykernel/kernelbase.py\u001b[0m in \u001b[0;36mraw_input\u001b[0;34m(self, prompt)\u001b[0m\n\u001b[1;32m 702\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_parent_ident\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 703\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_parent_header\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 704\u001b[0;31m \u001b[0mpassword\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;32mFalse\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 705\u001b[0m )\n\u001b[1;32m 706\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n",
+ "\u001b[0;32m/usr/local/lib/python3.6/dist-packages/ipykernel/kernelbase.py\u001b[0m in \u001b[0;36m_input_request\u001b[0;34m(self, prompt, ident, parent, password)\u001b[0m\n\u001b[1;32m 732\u001b[0m \u001b[0;32mexcept\u001b[0m \u001b[0mKeyboardInterrupt\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 733\u001b[0m \u001b[0;31m# re-raise KeyboardInterrupt, to truncate traceback\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 734\u001b[0;31m \u001b[0;32mraise\u001b[0m \u001b[0mKeyboardInterrupt\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 735\u001b[0m \u001b[0;32melse\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 736\u001b[0m \u001b[0;32mbreak\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
+ "\u001b[0;31mKeyboardInterrupt\u001b[0m: "
+ ]
+ }
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {
+ "id": "vnV-FigfvsS2",
+ "colab_type": "text"
+ },
+ "source": [
+ "# **Select Speaker**\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "metadata": {
+ "id": "RuCGOnJ_fgDV",
+ "colab_type": "code",
+ "colab": {}
+ },
+ "source": [
+ "\n",
+ "# VCTK speakers not seen in training (new speakers)\n",
+ "VCTK_test_Speakers = [\"p225\", \"p234\", \"p238\", \"p245\", \"p248\", \"p261\", \"p294\", \"p302\", \"p326\", \"p335\", \"p347\"]\n",
+ "\n",
+ "# VCTK speakers seen in training\n",
+ "VCTK_train_Speakers = ['p244', 'p300', 'p303', 'p273', 'p292', 'p252', 'p254', 'p269', 'p345', 'p274', 'p363', 'p285', 'p351', 'p361', 'p295', 'p266', 'p307', 'p230', 'p339', 'p253', 'p310', 'p241', 'p256', 'p323', 'p237', 'p229', 'p298', 'p336', 'p276', 'p305', 'p255', 'p278', 'p299', 'p265', 'p267', 'p280', 'p260', 'p272', 'p262', 'p334', 'p283', 'p247', 'p246', 'p374', 'p297', 'p249', 'p250', 'p304', 'p240', 'p236', 'p312', 'p286', 'p263', 'p258', 'p313', 'p376', 'p279', 'p340', 'p362', 'p284', 'p231', 'p308', 'p277', 'p275', 'p333', 'p314', 'p330', 'p264', 'p226', 'p288', 'p343', 'p239', 'p232', 'p268', 'p270', 'p329', 'p227', 'p271', 'p228', 'p311', 'p301', 'p293', 'p364', 'p251', 'p317', 'p360', 'p281', 'p243', 'p287', 'p233', 'p259', 'p316', 'p257', 'p282', 'p306', 'p341', 'p318']\n",
+ "\n",
+ "\n",
+ "num_samples_speaker = 2 # In theory the more samples of the speaker the more similar to the real voice it will be!\n"
+ ],
+ "execution_count": null,
+ "outputs": []
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {
+ "id": "hkvv7gRcx4WV",
+ "colab_type": "text"
+ },
+ "source": [
+ "## **Example select a VCTK seen speaker in training**"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "metadata": {
+ "id": "BviNMI9UyCYz",
+ "colab_type": "code",
+ "colab": {}
+ },
+ "source": [
+ "# get embedding\n",
+ "Speaker_choise = VCTK_train_Speakers[0] # choise one of training speakers\n",
+ "# load speakers\n",
+ "if SPEAKER_JSON != '':\n",
+ " speaker_mapping = json.load(open(SPEAKER_JSON, 'r'))\n",
+ " if C.use_external_speaker_embedding_file:\n",
+ " speaker_embeddings = []\n",
+ " for key in list(speaker_mapping.keys()):\n",
+ " if Speaker_choise in key:\n",
+ " if len(speaker_embeddings) < num_samples_speaker:\n",
+ " speaker_embeddings.append(speaker_mapping[key]['embedding'])\n",
+ " # takes the average of the embedings samples of the announcers\n",
+ " speaker_embedding = np.mean(np.array(speaker_embeddings), axis=0).tolist()\n",
+ " "
+ ],
+ "execution_count": null,
+ "outputs": []
+ },
+ {
+ "cell_type": "code",
+ "metadata": {
+ "id": "5e5_XnLsx3jg",
+ "colab_type": "code",
+ "colab": {
+ "base_uri": "https://localhost:8080/",
+ "height": 704
+ },
+ "outputId": "3c82a3cd-f4b9-4493-aa4c-275c34d3294d"
+ },
+ "source": [
+ "import IPython\n",
+ "from IPython.display import Audio\n",
+ "print(\"Synthesize sentence with Speaker: \",Speaker_choise.split('_')[0], \"(this speaker seen in training)\")\n",
+ "while True:\n",
+ " TEXT = input(\"Enter sentence: \")\n",
+ " print(\" > Text: {}\".format(TEXT))\n",
+ " wav = tts(model, vocoder_model, TEXT, C, USE_CUDA, ap, use_griffin_lim, SPEAKER_FILEID, speaker_embedding=speaker_embedding)\n",
+ " IPython.display.display(Audio(wav, rate=ap.sample_rate))\n",
+ " # save the results\n",
+ " file_name = TEXT.replace(\" \", \"_\")\n",
+ " file_name = file_name.translate(\n",
+ " str.maketrans('', '', string.punctuation.replace('_', ''))) + '.wav'\n",
+ " out_path = os.path.join(OUT_PATH, file_name)\n",
+ " print(\" > Saving output to {}\".format(out_path))\n",
+ " ap.save_wav(wav, out_path)"
+ ],
+ "execution_count": null,
+ "outputs": [
+ {
+ "output_type": "stream",
+ "text": [
+ "Synthesize sentence with Speaker: p244 (this speaker seen in training)\n",
+ "Enter sentence: Test this demonstration \n",
+ " > Text: Test this demonstration \n",
+ " > Run-time: 1.06947922706604\n",
+ " > Real-time factor: 0.8609054588373298\n",
+ " > Time per step: 3.904344461788641e-05\n"
+ ],
+ "name": "stdout"
+ },
+ {
+ "output_type": "display_data",
+ "data": {
+ "text/html": [
+ "\n",
+ " \n",
+ " "
+ ],
+ "text/plain": [
+ ""
+ ]
+ },
+ "metadata": {
+ "tags": []
+ }
+ },
+ {
+ "output_type": "stream",
+ "text": [
+ " > Saving output to tests-audios/Test_this_demonstration_.wav\n"
+ ],
+ "name": "stdout"
+ },
+ {
+ "output_type": "error",
+ "ename": "KeyboardInterrupt",
+ "evalue": "ignored",
+ "traceback": [
+ "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
+ "\u001b[0;31mKeyboardInterrupt\u001b[0m Traceback (most recent call last)",
+ "\u001b[0;32m/usr/local/lib/python3.6/dist-packages/ipykernel/kernelbase.py\u001b[0m in \u001b[0;36m_input_request\u001b[0;34m(self, prompt, ident, parent, password)\u001b[0m\n\u001b[1;32m 728\u001b[0m \u001b[0;32mtry\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 729\u001b[0;31m \u001b[0mident\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mreply\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0msession\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mrecv\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mstdin_socket\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;36m0\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 730\u001b[0m \u001b[0;32mexcept\u001b[0m \u001b[0mException\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
+ "\u001b[0;32m/usr/local/lib/python3.6/dist-packages/jupyter_client/session.py\u001b[0m in \u001b[0;36mrecv\u001b[0;34m(self, socket, mode, content, copy)\u001b[0m\n\u001b[1;32m 802\u001b[0m \u001b[0;32mtry\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 803\u001b[0;31m \u001b[0mmsg_list\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0msocket\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mrecv_multipart\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mmode\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mcopy\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mcopy\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 804\u001b[0m \u001b[0;32mexcept\u001b[0m \u001b[0mzmq\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mZMQError\u001b[0m \u001b[0;32mas\u001b[0m \u001b[0me\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
+ "\u001b[0;32m/usr/local/lib/python3.6/dist-packages/zmq/sugar/socket.py\u001b[0m in \u001b[0;36mrecv_multipart\u001b[0;34m(self, flags, copy, track)\u001b[0m\n\u001b[1;32m 474\u001b[0m \"\"\"\n\u001b[0;32m--> 475\u001b[0;31m \u001b[0mparts\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;34m[\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mrecv\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mflags\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mcopy\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mcopy\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mtrack\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mtrack\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 476\u001b[0m \u001b[0;31m# have first part already, only loop while more to receive\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
+ "\u001b[0;32mzmq/backend/cython/socket.pyx\u001b[0m in \u001b[0;36mzmq.backend.cython.socket.Socket.recv\u001b[0;34m()\u001b[0m\n",
+ "\u001b[0;32mzmq/backend/cython/socket.pyx\u001b[0m in \u001b[0;36mzmq.backend.cython.socket.Socket.recv\u001b[0;34m()\u001b[0m\n",
+ "\u001b[0;32mzmq/backend/cython/socket.pyx\u001b[0m in \u001b[0;36mzmq.backend.cython.socket._recv_copy\u001b[0;34m()\u001b[0m\n",
+ "\u001b[0;32m/usr/local/lib/python3.6/dist-packages/zmq/backend/cython/checkrc.pxd\u001b[0m in \u001b[0;36mzmq.backend.cython.checkrc._check_rc\u001b[0;34m()\u001b[0m\n",
+ "\u001b[0;31mKeyboardInterrupt\u001b[0m: ",
+ "\nDuring handling of the above exception, another exception occurred:\n",
+ "\u001b[0;31mKeyboardInterrupt\u001b[0m Traceback (most recent call last)",
+ "\u001b[0;32m\u001b[0m in \u001b[0;36m\u001b[0;34m()\u001b[0m\n\u001b[1;32m 3\u001b[0m \u001b[0mprint\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m\"Synthesize sentence with Speaker: \"\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0mSpeaker_choise\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0msplit\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m'_'\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;36m0\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m\"(this speaker seen in training)\"\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 4\u001b[0m \u001b[0;32mwhile\u001b[0m \u001b[0;32mTrue\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m----> 5\u001b[0;31m \u001b[0mTEXT\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0minput\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m\"Enter sentence: \"\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 6\u001b[0m \u001b[0mprint\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m\" > Text: {}\"\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mformat\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mTEXT\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 7\u001b[0m \u001b[0mwav\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mtts\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mmodel\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mvocoder_model\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mTEXT\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mC\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mUSE_CUDA\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0map\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0muse_griffin_lim\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mSPEAKER_FILEID\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mspeaker_embedding\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mspeaker_embedding\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
+ "\u001b[0;32m/usr/local/lib/python3.6/dist-packages/ipykernel/kernelbase.py\u001b[0m in \u001b[0;36mraw_input\u001b[0;34m(self, prompt)\u001b[0m\n\u001b[1;32m 702\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_parent_ident\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 703\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_parent_header\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 704\u001b[0;31m \u001b[0mpassword\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;32mFalse\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 705\u001b[0m )\n\u001b[1;32m 706\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n",
+ "\u001b[0;32m/usr/local/lib/python3.6/dist-packages/ipykernel/kernelbase.py\u001b[0m in \u001b[0;36m_input_request\u001b[0;34m(self, prompt, ident, parent, password)\u001b[0m\n\u001b[1;32m 732\u001b[0m \u001b[0;32mexcept\u001b[0m \u001b[0mKeyboardInterrupt\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 733\u001b[0m \u001b[0;31m# re-raise KeyboardInterrupt, to truncate traceback\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 734\u001b[0;31m \u001b[0;32mraise\u001b[0m \u001b[0mKeyboardInterrupt\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 735\u001b[0m \u001b[0;32melse\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 736\u001b[0m \u001b[0;32mbreak\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
+ "\u001b[0;31mKeyboardInterrupt\u001b[0m: "
+ ]
+ }
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {
+ "colab_type": "text",
+ "id": "QJ6VgT2a4vHW"
+ },
+ "source": [
+ "## **Example select a VCTK not seen speaker in training (new Speakers)**\n",
+ "\n",
+ "\n",
+ "> Fitting new Speakers :)\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "metadata": {
+ "colab_type": "code",
+ "id": "SZS57ZK-4vHa",
+ "colab": {}
+ },
+ "source": [
+ "# get embedding\n",
+ "Speaker_choise = VCTK_test_Speakers[0] # choise one of training speakers\n",
+ "# load speakers\n",
+ "if SPEAKER_JSON != '':\n",
+ " speaker_mapping = json.load(open(SPEAKER_JSON, 'r'))\n",
+ " if C.use_external_speaker_embedding_file:\n",
+ " speaker_embeddings = []\n",
+ " for key in list(speaker_mapping.keys()):\n",
+ " if Speaker_choise in key:\n",
+ " if len(speaker_embeddings) < num_samples_speaker:\n",
+ " speaker_embeddings.append(speaker_mapping[key]['embedding'])\n",
+ " # takes the average of the embedings samples of the announcers\n",
+ " speaker_embedding = np.mean(np.array(speaker_embeddings), axis=0).tolist()\n",
+ " "
+ ],
+ "execution_count": null,
+ "outputs": []
+ },
+ {
+ "cell_type": "code",
+ "metadata": {
+ "colab_type": "code",
+ "id": "bbs85vzz4vHo",
+ "colab": {
+ "base_uri": "https://localhost:8080/",
+ "height": 704
+ },
+ "outputId": "3c82a3cd-f4b9-4493-aa4c-275c34d3294d"
+ },
+ "source": [
+ "import IPython\n",
+ "from IPython.display import Audio\n",
+ "print(\"Synthesize sentence with Speaker: \",Speaker_choise.split('_')[0], \"(this speaker not seen in training (new speaker))\")\n",
+ "while True:\n",
+ " TEXT = input(\"Enter sentence: \")\n",
+ " print(\" > Text: {}\".format(TEXT))\n",
+ " wav = tts(model, vocoder_model, TEXT, C, USE_CUDA, ap, use_griffin_lim, SPEAKER_FILEID, speaker_embedding=speaker_embedding)\n",
+ " IPython.display.display(Audio(wav, rate=ap.sample_rate))\n",
+ " # save the results\n",
+ " file_name = TEXT.replace(\" \", \"_\")\n",
+ " file_name = file_name.translate(\n",
+ " str.maketrans('', '', string.punctuation.replace('_', ''))) + '.wav'\n",
+ " out_path = os.path.join(OUT_PATH, file_name)\n",
+ " print(\" > Saving output to {}\".format(out_path))\n",
+ " ap.save_wav(wav, out_path)"
+ ],
+ "execution_count": null,
+ "outputs": [
+ {
+ "output_type": "stream",
+ "text": [
+ "Synthesize sentence with Speaker: p244 (this speaker seen in training)\n",
+ "Enter sentence: Test this demonstration \n",
+ " > Text: Test this demonstration \n",
+ " > Run-time: 1.06947922706604\n",
+ " > Real-time factor: 0.8609054588373298\n",
+ " > Time per step: 3.904344461788641e-05\n"
+ ],
+ "name": "stdout"
+ },
+ {
+ "output_type": "display_data",
+ "data": {
+ "text/html": [
+ "\n",
+ " \n",
+ " "
+ ],
+ "text/plain": [
+ ""
+ ]
+ },
+ "metadata": {
+ "tags": []
+ }
+ },
+ {
+ "output_type": "stream",
+ "text": [
+ " > Saving output to tests-audios/Test_this_demonstration_.wav\n"
+ ],
+ "name": "stdout"
+ },
+ {
+ "output_type": "error",
+ "ename": "KeyboardInterrupt",
+ "evalue": "ignored",
+ "traceback": [
+ "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
+ "\u001b[0;31mKeyboardInterrupt\u001b[0m Traceback (most recent call last)",
+ "\u001b[0;32m/usr/local/lib/python3.6/dist-packages/ipykernel/kernelbase.py\u001b[0m in \u001b[0;36m_input_request\u001b[0;34m(self, prompt, ident, parent, password)\u001b[0m\n\u001b[1;32m 728\u001b[0m \u001b[0;32mtry\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 729\u001b[0;31m \u001b[0mident\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mreply\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0msession\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mrecv\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mstdin_socket\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;36m0\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 730\u001b[0m \u001b[0;32mexcept\u001b[0m \u001b[0mException\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
+ "\u001b[0;32m/usr/local/lib/python3.6/dist-packages/jupyter_client/session.py\u001b[0m in \u001b[0;36mrecv\u001b[0;34m(self, socket, mode, content, copy)\u001b[0m\n\u001b[1;32m 802\u001b[0m \u001b[0;32mtry\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 803\u001b[0;31m \u001b[0mmsg_list\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0msocket\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mrecv_multipart\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mmode\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mcopy\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mcopy\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 804\u001b[0m \u001b[0;32mexcept\u001b[0m \u001b[0mzmq\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mZMQError\u001b[0m \u001b[0;32mas\u001b[0m \u001b[0me\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
+ "\u001b[0;32m/usr/local/lib/python3.6/dist-packages/zmq/sugar/socket.py\u001b[0m in \u001b[0;36mrecv_multipart\u001b[0;34m(self, flags, copy, track)\u001b[0m\n\u001b[1;32m 474\u001b[0m \"\"\"\n\u001b[0;32m--> 475\u001b[0;31m \u001b[0mparts\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;34m[\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mrecv\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mflags\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mcopy\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mcopy\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mtrack\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mtrack\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 476\u001b[0m \u001b[0;31m# have first part already, only loop while more to receive\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
+ "\u001b[0;32mzmq/backend/cython/socket.pyx\u001b[0m in \u001b[0;36mzmq.backend.cython.socket.Socket.recv\u001b[0;34m()\u001b[0m\n",
+ "\u001b[0;32mzmq/backend/cython/socket.pyx\u001b[0m in \u001b[0;36mzmq.backend.cython.socket.Socket.recv\u001b[0;34m()\u001b[0m\n",
+ "\u001b[0;32mzmq/backend/cython/socket.pyx\u001b[0m in \u001b[0;36mzmq.backend.cython.socket._recv_copy\u001b[0;34m()\u001b[0m\n",
+ "\u001b[0;32m/usr/local/lib/python3.6/dist-packages/zmq/backend/cython/checkrc.pxd\u001b[0m in \u001b[0;36mzmq.backend.cython.checkrc._check_rc\u001b[0;34m()\u001b[0m\n",
+ "\u001b[0;31mKeyboardInterrupt\u001b[0m: ",
+ "\nDuring handling of the above exception, another exception occurred:\n",
+ "\u001b[0;31mKeyboardInterrupt\u001b[0m Traceback (most recent call last)",
+ "\u001b[0;32m\u001b[0m in \u001b[0;36m\u001b[0;34m()\u001b[0m\n\u001b[1;32m 3\u001b[0m \u001b[0mprint\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m\"Synthesize sentence with Speaker: \"\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0mSpeaker_choise\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0msplit\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m'_'\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;36m0\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m\"(this speaker seen in training)\"\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 4\u001b[0m \u001b[0;32mwhile\u001b[0m \u001b[0;32mTrue\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m----> 5\u001b[0;31m \u001b[0mTEXT\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0minput\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m\"Enter sentence: \"\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 6\u001b[0m \u001b[0mprint\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m\" > Text: {}\"\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mformat\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mTEXT\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 7\u001b[0m \u001b[0mwav\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mtts\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mmodel\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mvocoder_model\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mTEXT\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mC\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mUSE_CUDA\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0map\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0muse_griffin_lim\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mSPEAKER_FILEID\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mspeaker_embedding\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mspeaker_embedding\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
+ "\u001b[0;32m/usr/local/lib/python3.6/dist-packages/ipykernel/kernelbase.py\u001b[0m in \u001b[0;36mraw_input\u001b[0;34m(self, prompt)\u001b[0m\n\u001b[1;32m 702\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_parent_ident\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 703\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_parent_header\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 704\u001b[0;31m \u001b[0mpassword\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;32mFalse\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 705\u001b[0m )\n\u001b[1;32m 706\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n",
+ "\u001b[0;32m/usr/local/lib/python3.6/dist-packages/ipykernel/kernelbase.py\u001b[0m in \u001b[0;36m_input_request\u001b[0;34m(self, prompt, ident, parent, password)\u001b[0m\n\u001b[1;32m 732\u001b[0m \u001b[0;32mexcept\u001b[0m \u001b[0mKeyboardInterrupt\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 733\u001b[0m \u001b[0;31m# re-raise KeyboardInterrupt, to truncate traceback\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 734\u001b[0;31m \u001b[0;32mraise\u001b[0m \u001b[0mKeyboardInterrupt\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 735\u001b[0m \u001b[0;32melse\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 736\u001b[0m \u001b[0;32mbreak\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
+ "\u001b[0;31mKeyboardInterrupt\u001b[0m: "
+ ]
+ }
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {
+ "colab_type": "text",
+ "id": "LEE6mQLh5Who"
+ },
+ "source": [
+ "# **Example Synthesizing with your own voice :)**\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {
+ "id": "La70gSB65nrs",
+ "colab_type": "text"
+ },
+ "source": [
+ " Download and load GE2E Speaker Encoder "
+ ]
+ },
+ {
+ "cell_type": "code",
+ "metadata": {
+ "id": "r0IEFZ0B5vQg",
+ "colab_type": "code",
+ "colab": {
+ "base_uri": "https://localhost:8080/",
+ "height": 121
+ },
+ "outputId": "93ee404d-3fdc-48ac-f867-9ef7f7ecaa0c"
+ },
+ "source": [
+ "!wget -c -q --show-progress -O ./SpeakerEncoder-checkpoint.zip https://github.com/Edresson/TTS/releases/download/v1.0.0/GE2E-SpeakerEncoder-iter25k.zip\n",
+ "!unzip ./SpeakerEncoder-checkpoint.zip"
+ ],
+ "execution_count": null,
+ "outputs": [
+ {
+ "output_type": "stream",
+ "text": [
+ "./SpeakerEncoder-ch 100%[===================>] 25.35M 25.1MB/s in 1.0s \n",
+ "Archive: ./SpeakerEncoder-checkpoint.zip\n",
+ " creating: GE2E-SpeakerEncoder/\n",
+ " inflating: GE2E-SpeakerEncoder/best_model.pth.tar \n",
+ " inflating: GE2E-SpeakerEncoder/config.json \n",
+ " inflating: GE2E-SpeakerEncoder/README.MD \n"
+ ],
+ "name": "stdout"
+ }
+ ]
+ },
+ {
+ "cell_type": "code",
+ "metadata": {
+ "id": "jEH8HCTh5mF6",
+ "colab_type": "code",
+ "colab": {}
+ },
+ "source": [
+ "SE_MODEL_RUN_PATH = \"GE2E-SpeakerEncoder/\"\n",
+ "SE_MODEL_PATH = os.path.join(SE_MODEL_RUN_PATH, \"best_model.pth.tar\")\n",
+ "SE_CONFIG_PATH =os.path.join(SE_MODEL_RUN_PATH, \"config.json\")\n",
+ "USE_CUDA = True"
+ ],
+ "execution_count": null,
+ "outputs": []
+ },
+ {
+ "cell_type": "code",
+ "metadata": {
+ "id": "tOwkfQqT6-Qo",
+ "colab_type": "code",
+ "colab": {
+ "base_uri": "https://localhost:8080/",
+ "height": 451
+ },
+ "outputId": "091c9020-302a-429e-bc7e-7fd2bb6f68f9"
+ },
+ "source": [
+ "from TTS.utils.audio import AudioProcessor\n",
+ "from TTS.speaker_encoder.model import SpeakerEncoder\n",
+ "se_config = load_config(SE_CONFIG_PATH)\n",
+ "se_ap = AudioProcessor(**se_config['audio'])\n",
+ "\n",
+ "se_model = SpeakerEncoder(**se_config.model)\n",
+ "se_model.load_state_dict(torch.load(SE_MODEL_PATH)['model'])\n",
+ "se_model.eval()\n",
+ "if USE_CUDA:\n",
+ " se_model.cuda()"
+ ],
+ "execution_count": null,
+ "outputs": [
+ {
+ "output_type": "stream",
+ "text": [
+ " > Setting up Audio Processor...\n",
+ " | > sample_rate:16000\n",
+ " | > num_mels:40\n",
+ " | > min_level_db:-100\n",
+ " | > frame_shift_ms:12.5\n",
+ " | > frame_length_ms:50\n",
+ " | > ref_level_db:20\n",
+ " | > fft_size:1024\n",
+ " | > power:None\n",
+ " | > preemphasis:0.98\n",
+ " | > griffin_lim_iters:None\n",
+ " | > signal_norm:True\n",
+ " | > symmetric_norm:True\n",
+ " | > mel_fmin:0\n",
+ " | > mel_fmax:8000.0\n",
+ " | > spec_gain:20.0\n",
+ " | > stft_pad_mode:reflect\n",
+ " | > max_norm:4.0\n",
+ " | > clip_norm:True\n",
+ " | > do_trim_silence:False\n",
+ " | > trim_db:60\n",
+ " | > do_sound_norm:False\n",
+ " | > stats_path:None\n",
+ " | > hop_length:200\n",
+ " | > win_length:800\n"
+ ],
+ "name": "stdout"
+ }
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {
+ "id": "0TLlbUFG8O36",
+ "colab_type": "text"
+ },
+ "source": [
+ "Upload a wav audio file in your voice.\n",
+ "\n",
+ "\n",
+ "> We recommend files longer than 3 seconds, the bigger the file the closer to your voice :)\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "metadata": {
+ "id": "_FWwHPjJ8NXl",
+ "colab_type": "code",
+ "colab": {
+ "resources": {
+ "http://localhost:8080/nbextensions/google.colab/files.js": {
+ "data": "Ly8gQ29weXJpZ2h0IDIwMTcgR29vZ2xlIExMQwovLwovLyBMaWNlbnNlZCB1bmRlciB0aGUgQXBhY2hlIExpY2Vuc2UsIFZlcnNpb24gMi4wICh0aGUgIkxpY2Vuc2UiKTsKLy8geW91IG1heSBub3QgdXNlIHRoaXMgZmlsZSBleGNlcHQgaW4gY29tcGxpYW5jZSB3aXRoIHRoZSBMaWNlbnNlLgovLyBZb3UgbWF5IG9idGFpbiBhIGNvcHkgb2YgdGhlIExpY2Vuc2UgYXQKLy8KLy8gICAgICBodHRwOi8vd3d3LmFwYWNoZS5vcmcvbGljZW5zZXMvTElDRU5TRS0yLjAKLy8KLy8gVW5sZXNzIHJlcXVpcmVkIGJ5IGFwcGxpY2FibGUgbGF3IG9yIGFncmVlZCB0byBpbiB3cml0aW5nLCBzb2Z0d2FyZQovLyBkaXN0cmlidXRlZCB1bmRlciB0aGUgTGljZW5zZSBpcyBkaXN0cmlidXRlZCBvbiBhbiAiQVMgSVMiIEJBU0lTLAovLyBXSVRIT1VUIFdBUlJBTlRJRVMgT1IgQ09ORElUSU9OUyBPRiBBTlkgS0lORCwgZWl0aGVyIGV4cHJlc3Mgb3IgaW1wbGllZC4KLy8gU2VlIHRoZSBMaWNlbnNlIGZvciB0aGUgc3BlY2lmaWMgbGFuZ3VhZ2UgZ292ZXJuaW5nIHBlcm1pc3Npb25zIGFuZAovLyBsaW1pdGF0aW9ucyB1bmRlciB0aGUgTGljZW5zZS4KCi8qKgogKiBAZmlsZW92ZXJ2aWV3IEhlbHBlcnMgZm9yIGdvb2dsZS5jb2xhYiBQeXRob24gbW9kdWxlLgogKi8KKGZ1bmN0aW9uKHNjb3BlKSB7CmZ1bmN0aW9uIHNwYW4odGV4dCwgc3R5bGVBdHRyaWJ1dGVzID0ge30pIHsKICBjb25zdCBlbGVtZW50ID0gZG9jdW1lbnQuY3JlYXRlRWxlbWVudCgnc3BhbicpOwogIGVsZW1lbnQudGV4dENvbnRlbnQgPSB0ZXh0OwogIGZvciAoY29uc3Qga2V5IG9mIE9iamVjdC5rZXlzKHN0eWxlQXR0cmlidXRlcykpIHsKICAgIGVsZW1lbnQuc3R5bGVba2V5XSA9IHN0eWxlQXR0cmlidXRlc1trZXldOwogIH0KICByZXR1cm4gZWxlbWVudDsKfQoKLy8gTWF4IG51bWJlciBvZiBieXRlcyB3aGljaCB3aWxsIGJlIHVwbG9hZGVkIGF0IGEgdGltZS4KY29uc3QgTUFYX1BBWUxPQURfU0laRSA9IDEwMCAqIDEwMjQ7CgpmdW5jdGlvbiBfdXBsb2FkRmlsZXMoaW5wdXRJZCwgb3V0cHV0SWQpIHsKICBjb25zdCBzdGVwcyA9IHVwbG9hZEZpbGVzU3RlcChpbnB1dElkLCBvdXRwdXRJZCk7CiAgY29uc3Qgb3V0cHV0RWxlbWVudCA9IGRvY3VtZW50LmdldEVsZW1lbnRCeUlkKG91dHB1dElkKTsKICAvLyBDYWNoZSBzdGVwcyBvbiB0aGUgb3V0cHV0RWxlbWVudCB0byBtYWtlIGl0IGF2YWlsYWJsZSBmb3IgdGhlIG5leHQgY2FsbAogIC8vIHRvIHVwbG9hZEZpbGVzQ29udGludWUgZnJvbSBQeXRob24uCiAgb3V0cHV0RWxlbWVudC5zdGVwcyA9IHN0ZXBzOwoKICByZXR1cm4gX3VwbG9hZEZpbGVzQ29udGludWUob3V0cHV0SWQpOwp9CgovLyBUaGlzIGlzIHJvdWdobHkgYW4gYXN5bmMgZ2VuZXJhdG9yIChub3Qgc3VwcG9ydGVkIGluIHRoZSBicm93c2VyIHlldCksCi8vIHdoZXJlIHRoZXJlIGFyZSBtdWx0aXBsZSBhc3luY2hyb25vdXMgc3RlcHMgYW5kIHRoZSBQeXRob24gc2lkZSBpcyBnb2luZwovLyB0byBwb2xsIGZvciBjb21wbGV0aW9uIG9mIGVhY2ggc3RlcC4KLy8gVGhpcyB1c2VzIGEgUHJvbWlzZSB0byBibG9jayB0aGUgcHl0aG9uIHNpZGUgb24gY29tcGxldGlvbiBvZiBlYWNoIHN0ZXAsCi8vIHRoZW4gcGFzc2VzIHRoZSByZXN1bHQgb2YgdGhlIHByZXZpb3VzIHN0ZXAgYXMgdGhlIGlucHV0IHRvIHRoZSBuZXh0IHN0ZXAuCmZ1bmN0aW9uIF91cGxvYWRGaWxlc0NvbnRpbnVlKG91dHB1dElkKSB7CiAgY29uc3Qgb3V0cHV0RWxlbWVudCA9IGRvY3VtZW50LmdldEVsZW1lbnRCeUlkKG91dHB1dElkKTsKICBjb25zdCBzdGVwcyA9IG91dHB1dEVsZW1lbnQuc3RlcHM7CgogIGNvbnN0IG5leHQgPSBzdGVwcy5uZXh0KG91dHB1dEVsZW1lbnQubGFzdFByb21pc2VWYWx1ZSk7CiAgcmV0dXJuIFByb21pc2UucmVzb2x2ZShuZXh0LnZhbHVlLnByb21pc2UpLnRoZW4oKHZhbHVlKSA9PiB7CiAgICAvLyBDYWNoZSB0aGUgbGFzdCBwcm9taXNlIHZhbHVlIHRvIG1ha2UgaXQgYXZhaWxhYmxlIHRvIHRoZSBuZXh0CiAgICAvLyBzdGVwIG9mIHRoZSBnZW5lcmF0b3IuCiAgICBvdXRwdXRFbGVtZW50Lmxhc3RQcm9taXNlVmFsdWUgPSB2YWx1ZTsKICAgIHJldHVybiBuZXh0LnZhbHVlLnJlc3BvbnNlOwogIH0pOwp9CgovKioKICogR2VuZXJhdG9yIGZ1bmN0aW9uIHdoaWNoIGlzIGNhbGxlZCBiZXR3ZWVuIGVhY2ggYXN5bmMgc3RlcCBvZiB0aGUgdXBsb2FkCiAqIHByb2Nlc3MuCiAqIEBwYXJhbSB7c3RyaW5nfSBpbnB1dElkIEVsZW1lbnQgSUQgb2YgdGhlIGlucHV0IGZpbGUgcGlja2VyIGVsZW1lbnQuCiAqIEBwYXJhbSB7c3RyaW5nfSBvdXRwdXRJZCBFbGVtZW50IElEIG9mIHRoZSBvdXRwdXQgZGlzcGxheS4KICogQHJldHVybiB7IUl0ZXJhYmxlPCFPYmplY3Q+fSBJdGVyYWJsZSBvZiBuZXh0IHN0ZXBzLgogKi8KZnVuY3Rpb24qIHVwbG9hZEZpbGVzU3RlcChpbnB1dElkLCBvdXRwdXRJZCkgewogIGNvbnN0IGlucHV0RWxlbWVudCA9IGRvY3VtZW50LmdldEVsZW1lbnRCeUlkKGlucHV0SWQpOwogIGlucHV0RWxlbWVudC5kaXNhYmxlZCA9IGZhbHNlOwoKICBjb25zdCBvdXRwdXRFbGVtZW50ID0gZG9jdW1lbnQuZ2V0RWxlbWVudEJ5SWQob3V0cHV0SWQpOwogIG91dHB1dEVsZW1lbnQuaW5uZXJIVE1MID0gJyc7CgogIGNvbnN0IHBpY2tlZFByb21pc2UgPSBuZXcgUHJvbWlzZSgocmVzb2x2ZSkgPT4gewogICAgaW5wdXRFbGVtZW50LmFkZEV2ZW50TGlzdGVuZXIoJ2NoYW5nZScsIChlKSA9PiB7CiAgICAgIHJlc29sdmUoZS50YXJnZXQuZmlsZXMpOwogICAgfSk7CiAgfSk7CgogIGNvbnN0IGNhbmNlbCA9IGRvY3VtZW50LmNyZWF0ZUVsZW1lbnQoJ2J1dHRvbicpOwogIGlucHV0RWxlbWVudC5wYXJlbnRFbGVtZW50LmFwcGVuZENoaWxkKGNhbmNlbCk7CiAgY2FuY2VsLnRleHRDb250ZW50ID0gJ0NhbmNlbCB1cGxvYWQnOwogIGNvbnN0IGNhbmNlbFByb21pc2UgPSBuZXcgUHJvbWlzZSgocmVzb2x2ZSkgPT4gewogICAgY2FuY2VsLm9uY2xpY2sgPSAoKSA9PiB7CiAgICAgIHJlc29sdmUobnVsbCk7CiAgICB9OwogIH0pOwoKICAvLyBXYWl0IGZvciB0aGUgdXNlciB0byBwaWNrIHRoZSBmaWxlcy4KICBjb25zdCBmaWxlcyA9IHlpZWxkIHsKICAgIHByb21pc2U6IFByb21pc2UucmFjZShbcGlja2VkUHJvbWlzZSwgY2FuY2VsUHJvbWlzZV0pLAogICAgcmVzcG9uc2U6IHsKICAgICAgYWN0aW9uOiAnc3RhcnRpbmcnLAogICAgfQogIH07CgogIGNhbmNlbC5yZW1vdmUoKTsKCiAgLy8gRGlzYWJsZSB0aGUgaW5wdXQgZWxlbWVudCBzaW5jZSBmdXJ0aGVyIHBpY2tzIGFyZSBub3QgYWxsb3dlZC4KICBpbnB1dEVsZW1lbnQuZGlzYWJsZWQgPSB0cnVlOwoKICBpZiAoIWZpbGVzKSB7CiAgICByZXR1cm4gewogICAgICByZXNwb25zZTogewogICAgICAgIGFjdGlvbjogJ2NvbXBsZXRlJywKICAgICAgfQogICAgfTsKICB9CgogIGZvciAoY29uc3QgZmlsZSBvZiBmaWxlcykgewogICAgY29uc3QgbGkgPSBkb2N1bWVudC5jcmVhdGVFbGVtZW50KCdsaScpOwogICAgbGkuYXBwZW5kKHNwYW4oZmlsZS5uYW1lLCB7Zm9udFdlaWdodDogJ2JvbGQnfSkpOwogICAgbGkuYXBwZW5kKHNwYW4oCiAgICAgICAgYCgke2ZpbGUudHlwZSB8fCAnbi9hJ30pIC0gJHtmaWxlLnNpemV9IGJ5dGVzLCBgICsKICAgICAgICBgbGFzdCBtb2RpZmllZDogJHsKICAgICAgICAgICAgZmlsZS5sYXN0TW9kaWZpZWREYXRlID8gZmlsZS5sYXN0TW9kaWZpZWREYXRlLnRvTG9jYWxlRGF0ZVN0cmluZygpIDoKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJ24vYSd9IC0gYCkpOwogICAgY29uc3QgcGVyY2VudCA9IHNwYW4oJzAlIGRvbmUnKTsKICAgIGxpLmFwcGVuZENoaWxkKHBlcmNlbnQpOwoKICAgIG91dHB1dEVsZW1lbnQuYXBwZW5kQ2hpbGQobGkpOwoKICAgIGNvbnN0IGZpbGVEYXRhUHJvbWlzZSA9IG5ldyBQcm9taXNlKChyZXNvbHZlKSA9PiB7CiAgICAgIGNvbnN0IHJlYWRlciA9IG5ldyBGaWxlUmVhZGVyKCk7CiAgICAgIHJlYWRlci5vbmxvYWQgPSAoZSkgPT4gewogICAgICAgIHJlc29sdmUoZS50YXJnZXQucmVzdWx0KTsKICAgICAgfTsKICAgICAgcmVhZGVyLnJlYWRBc0FycmF5QnVmZmVyKGZpbGUpOwogICAgfSk7CiAgICAvLyBXYWl0IGZvciB0aGUgZGF0YSB0byBiZSByZWFkeS4KICAgIGxldCBmaWxlRGF0YSA9IHlpZWxkIHsKICAgICAgcHJvbWlzZTogZmlsZURhdGFQcm9taXNlLAogICAgICByZXNwb25zZTogewogICAgICAgIGFjdGlvbjogJ2NvbnRpbnVlJywKICAgICAgfQogICAgfTsKCiAgICAvLyBVc2UgYSBjaHVua2VkIHNlbmRpbmcgdG8gYXZvaWQgbWVzc2FnZSBzaXplIGxpbWl0cy4gU2VlIGIvNjIxMTU2NjAuCiAgICBsZXQgcG9zaXRpb24gPSAwOwogICAgd2hpbGUgKHBvc2l0aW9uIDwgZmlsZURhdGEuYnl0ZUxlbmd0aCkgewogICAgICBjb25zdCBsZW5ndGggPSBNYXRoLm1pbihmaWxlRGF0YS5ieXRlTGVuZ3RoIC0gcG9zaXRpb24sIE1BWF9QQVlMT0FEX1NJWkUpOwogICAgICBjb25zdCBjaHVuayA9IG5ldyBVaW50OEFycmF5KGZpbGVEYXRhLCBwb3NpdGlvbiwgbGVuZ3RoKTsKICAgICAgcG9zaXRpb24gKz0gbGVuZ3RoOwoKICAgICAgY29uc3QgYmFzZTY0ID0gYnRvYShTdHJpbmcuZnJvbUNoYXJDb2RlLmFwcGx5KG51bGwsIGNodW5rKSk7CiAgICAgIHlpZWxkIHsKICAgICAgICByZXNwb25zZTogewogICAgICAgICAgYWN0aW9uOiAnYXBwZW5kJywKICAgICAgICAgIGZpbGU6IGZpbGUubmFtZSwKICAgICAgICAgIGRhdGE6IGJhc2U2NCwKICAgICAgICB9LAogICAgICB9OwogICAgICBwZXJjZW50LnRleHRDb250ZW50ID0KICAgICAgICAgIGAke01hdGgucm91bmQoKHBvc2l0aW9uIC8gZmlsZURhdGEuYnl0ZUxlbmd0aCkgKiAxMDApfSUgZG9uZWA7CiAgICB9CiAgfQoKICAvLyBBbGwgZG9uZS4KICB5aWVsZCB7CiAgICByZXNwb25zZTogewogICAgICBhY3Rpb246ICdjb21wbGV0ZScsCiAgICB9CiAgfTsKfQoKc2NvcGUuZ29vZ2xlID0gc2NvcGUuZ29vZ2xlIHx8IHt9OwpzY29wZS5nb29nbGUuY29sYWIgPSBzY29wZS5nb29nbGUuY29sYWIgfHwge307CnNjb3BlLmdvb2dsZS5jb2xhYi5fZmlsZXMgPSB7CiAgX3VwbG9hZEZpbGVzLAogIF91cGxvYWRGaWxlc0NvbnRpbnVlLAp9Owp9KShzZWxmKTsK",
+ "ok": true,
+ "headers": [
+ [
+ "content-type",
+ "application/javascript"
+ ]
+ ],
+ "status": 200,
+ "status_text": "OK"
+ }
+ },
+ "base_uri": "https://localhost:8080/",
+ "height": 246
+ },
+ "outputId": "cb0ca2ad-73b9-44ce-d0bd-6139552232d8"
+ },
+ "source": [
+ "from google.colab import files\n",
+ "file_list = files.upload()"
+ ],
+ "execution_count": null,
+ "outputs": [
+ {
+ "output_type": "display_data",
+ "data": {
+ "text/html": [
+ "\n",
+ " \n",
+ " \n",
+ " "
+ ],
+ "text/plain": [
+ ""
+ ]
+ },
+ "metadata": {
+ "tags": []
+ }
+ },
+ {
+ "output_type": "stream",
+ "text": [
+ "Saving p238_001.wav to p238_001.wav\n",
+ "Saving p238_002.wav to p238_002.wav\n",
+ "Saving p238_003.wav to p238_003.wav\n",
+ "Saving p238_004.wav to p238_004.wav\n",
+ "Saving p238_005.wav to p238_005.wav\n",
+ "Saving p238_006.wav to p238_006.wav\n"
+ ],
+ "name": "stdout"
+ }
+ ]
+ },
+ {
+ "cell_type": "code",
+ "metadata": {
+ "id": "WWOf6sgbBbGY",
+ "colab_type": "code",
+ "colab": {}
+ },
+ "source": [
+ "# extract embedding from wav files\n",
+ "speaker_embeddings = []\n",
+ "for name in file_list.keys():\n",
+ " if '.wav' in name:\n",
+ " mel_spec = se_ap.melspectrogram(se_ap.load_wav(name, sr=se_ap.sample_rate)).T\n",
+ " mel_spec = torch.FloatTensor(mel_spec[None, :, :])\n",
+ " if USE_CUDA:\n",
+ " mel_spec = mel_spec.cuda()\n",
+ " embedd = se_model.compute_embedding(mel_spec).cpu().detach().numpy().reshape(-1)\n",
+ " speaker_embeddings.append(embedd)\n",
+ " else:\n",
+ " print(\" You need upload Wav files, others files is not supported !!\")\n",
+ "\n",
+ "# takes the average of the embedings samples of the announcers\n",
+ "speaker_embedding = np.mean(np.array(speaker_embeddings), axis=0).tolist()"
+ ],
+ "execution_count": null,
+ "outputs": []
+ },
+ {
+ "cell_type": "code",
+ "metadata": {
+ "colab_type": "code",
+ "id": "xmItcGac5WiG",
+ "colab": {
+ "base_uri": "https://localhost:8080/",
+ "height": 872
+ },
+ "outputId": "4940027a-a303-4782-ef47-0c91716665a1"
+ },
+ "source": [
+ "import IPython\n",
+ "from IPython.display import Audio\n",
+ "print(\"Synthesize sentence with New Speaker using files: \",file_list.keys(), \"(this speaker not seen in training (new speaker))\")\n",
+ "while True:\n",
+ " TEXT = input(\"Enter sentence: \")\n",
+ " print(\" > Text: {}\".format(TEXT))\n",
+ " wav = tts(model, vocoder_model, TEXT, C, USE_CUDA, ap, use_griffin_lim, SPEAKER_FILEID, speaker_embedding=speaker_embedding)\n",
+ " IPython.display.display(Audio(wav, rate=ap.sample_rate))\n",
+ " # save the results\n",
+ " file_name = TEXT.replace(\" \", \"_\")\n",
+ " file_name = file_name.translate(\n",
+ " str.maketrans('', '', string.punctuation.replace('_', ''))) + '.wav'\n",
+ " out_path = os.path.join(OUT_PATH, file_name)\n",
+ " print(\" > Saving output to {}\".format(out_path))\n",
+ " ap.save_wav(wav, out_path)"
+ ],
+ "execution_count": null,
+ "outputs": [
+ {
+ "output_type": "stream",
+ "text": [
+ "Synthesize sentence with New Speaker using files: dict_keys(['p238_001.wav', 'p238_002.wav', 'p238_003.wav', 'p238_004.wav', 'p238_005.wav', 'p238_006.wav']) (this speaker not seen in training (new speaker))\n",
+ "Enter sentence: Test this demonstration\n",
+ " > Text: Test this demonstration\n",
+ " > Run-time: 1.1401546001434326\n",
+ " > Real-time factor: 0.8927653497084975\n",
+ " > Time per step: 4.0488326075402176e-05\n"
+ ],
+ "name": "stdout"
+ },
+ {
+ "output_type": "display_data",
+ "data": {
+ "text/html": [
+ "\n",
+ " \n",
+ " "
+ ],
+ "text/plain": [
+ ""
+ ]
+ },
+ "metadata": {
+ "tags": []
+ }
+ },
+ {
+ "output_type": "stream",
+ "text": [
+ " > Saving output to tests-audios/Test_this_demonstration.wav\n",
+ "Enter sentence: Ask her to bring these things with her from the store.\n",
+ " > Text: Ask her to bring these things with her from the store.\n",
+ " > Run-time: 1.594754934310913\n",
+ " > Real-time factor: 0.6868010717444122\n",
+ " > Time per step: 3.1147492118179796e-05\n"
+ ],
+ "name": "stdout"
+ },
+ {
+ "output_type": "display_data",
+ "data": {
+ "text/html": [
+ "\n",
+ " \n",
+ " "
+ ],
+ "text/plain": [
+ ""
+ ]
+ },
+ "metadata": {
+ "tags": []
+ }
+ },
+ {
+ "output_type": "stream",
+ "text": [
+ " > Saving output to tests-audios/Ask_her_to_bring_these_things_with_her_from_the_store.wav\n"
+ ],
+ "name": "stdout"
+ },
+ {
+ "output_type": "error",
+ "ename": "KeyboardInterrupt",
+ "evalue": "ignored",
+ "traceback": [
+ "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
+ "\u001b[0;31mKeyboardInterrupt\u001b[0m Traceback (most recent call last)",
+ "\u001b[0;32m/usr/local/lib/python3.6/dist-packages/ipykernel/kernelbase.py\u001b[0m in \u001b[0;36m_input_request\u001b[0;34m(self, prompt, ident, parent, password)\u001b[0m\n\u001b[1;32m 728\u001b[0m \u001b[0;32mtry\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 729\u001b[0;31m \u001b[0mident\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mreply\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0msession\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mrecv\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mstdin_socket\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;36m0\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 730\u001b[0m \u001b[0;32mexcept\u001b[0m \u001b[0mException\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
+ "\u001b[0;32m/usr/local/lib/python3.6/dist-packages/jupyter_client/session.py\u001b[0m in \u001b[0;36mrecv\u001b[0;34m(self, socket, mode, content, copy)\u001b[0m\n\u001b[1;32m 802\u001b[0m \u001b[0;32mtry\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 803\u001b[0;31m \u001b[0mmsg_list\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0msocket\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mrecv_multipart\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mmode\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mcopy\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mcopy\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 804\u001b[0m \u001b[0;32mexcept\u001b[0m \u001b[0mzmq\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mZMQError\u001b[0m \u001b[0;32mas\u001b[0m \u001b[0me\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
+ "\u001b[0;32m/usr/local/lib/python3.6/dist-packages/zmq/sugar/socket.py\u001b[0m in \u001b[0;36mrecv_multipart\u001b[0;34m(self, flags, copy, track)\u001b[0m\n\u001b[1;32m 474\u001b[0m \"\"\"\n\u001b[0;32m--> 475\u001b[0;31m \u001b[0mparts\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;34m[\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mrecv\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mflags\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mcopy\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mcopy\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mtrack\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mtrack\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 476\u001b[0m \u001b[0;31m# have first part already, only loop while more to receive\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
+ "\u001b[0;32mzmq/backend/cython/socket.pyx\u001b[0m in \u001b[0;36mzmq.backend.cython.socket.Socket.recv\u001b[0;34m()\u001b[0m\n",
+ "\u001b[0;32mzmq/backend/cython/socket.pyx\u001b[0m in \u001b[0;36mzmq.backend.cython.socket.Socket.recv\u001b[0;34m()\u001b[0m\n",
+ "\u001b[0;32mzmq/backend/cython/socket.pyx\u001b[0m in \u001b[0;36mzmq.backend.cython.socket._recv_copy\u001b[0;34m()\u001b[0m\n",
+ "\u001b[0;32m/usr/local/lib/python3.6/dist-packages/zmq/backend/cython/checkrc.pxd\u001b[0m in \u001b[0;36mzmq.backend.cython.checkrc._check_rc\u001b[0;34m()\u001b[0m\n",
+ "\u001b[0;31mKeyboardInterrupt\u001b[0m: ",
+ "\nDuring handling of the above exception, another exception occurred:\n",
+ "\u001b[0;31mKeyboardInterrupt\u001b[0m Traceback (most recent call last)",
+ "\u001b[0;32m\u001b[0m in \u001b[0;36m\u001b[0;34m()\u001b[0m\n\u001b[1;32m 3\u001b[0m \u001b[0mprint\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m\"Synthesize sentence with New Speaker using files: \"\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0mfile_list\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mkeys\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m\"(this speaker not seen in training (new speaker))\"\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 4\u001b[0m \u001b[0;32mwhile\u001b[0m \u001b[0;32mTrue\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m----> 5\u001b[0;31m \u001b[0mTEXT\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0minput\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m\"Enter sentence: \"\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 6\u001b[0m \u001b[0mprint\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m\" > Text: {}\"\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mformat\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mTEXT\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 7\u001b[0m \u001b[0mwav\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mtts\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mmodel\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mvocoder_model\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mTEXT\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mC\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mUSE_CUDA\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0map\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0muse_griffin_lim\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mSPEAKER_FILEID\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mspeaker_embedding\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mspeaker_embedding\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
+ "\u001b[0;32m/usr/local/lib/python3.6/dist-packages/ipykernel/kernelbase.py\u001b[0m in \u001b[0;36mraw_input\u001b[0;34m(self, prompt)\u001b[0m\n\u001b[1;32m 702\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_parent_ident\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 703\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_parent_header\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 704\u001b[0;31m \u001b[0mpassword\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;32mFalse\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 705\u001b[0m )\n\u001b[1;32m 706\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n",
+ "\u001b[0;32m/usr/local/lib/python3.6/dist-packages/ipykernel/kernelbase.py\u001b[0m in \u001b[0;36m_input_request\u001b[0;34m(self, prompt, ident, parent, password)\u001b[0m\n\u001b[1;32m 732\u001b[0m \u001b[0;32mexcept\u001b[0m \u001b[0mKeyboardInterrupt\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 733\u001b[0m \u001b[0;31m# re-raise KeyboardInterrupt, to truncate traceback\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 734\u001b[0;31m \u001b[0;32mraise\u001b[0m \u001b[0mKeyboardInterrupt\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 735\u001b[0m \u001b[0;32melse\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 736\u001b[0m \u001b[0;32mbreak\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
+ "\u001b[0;31mKeyboardInterrupt\u001b[0m: "
+ ]
+ }
+ ]
+ }
+ ]
+}
\ No newline at end of file