File size: 3,859 Bytes
2732f79
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
{
  "nbformat": 4,
  "nbformat_minor": 0,
  "metadata": {
    "colab": {
      "provenance": [],
      "gpuType": "T4",
      "include_colab_link": true
    },
    "kernelspec": {
      "name": "python3",
      "display_name": "Python 3"
    },
    "language_info": {
      "name": "python"
    },
    "accelerator": "GPU"
  },
  "cells": [
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "view-in-github",
        "colab_type": "text"
      },
      "source": [
        "<a href=\"https://colab.research.google.com/github/DrewThomasson/ebook2audiobookXTTS/blob/main/Notebooks/colab_ebook2audiobookxtts.ipynb\" target=\"_parent\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/></a>"
      ]
    },
    {
      "cell_type": "markdown",
      "source": [
        "## Welcome to the ebook2audiobookxtts free google colab!\n",
        "## 🌟 Features\n",
        "\n",
        "- πŸ“– Converts eBooks to text format with Calibre.\n",
        "- πŸ“š Splits eBook into chapters for organized audio.\n",
        "- πŸŽ™οΈ High-quality text-to-speech with Coqui XTTS.\n",
        "- πŸ—£οΈ Optional voice cloning with your own voice file.\n",
        "- 🌍 Supports multiple languages! (English (en), Spanish (es), French (fr), German (de), Italian (it), Portuguese (pt), Polish (pl), Turkish (tr), Russian (ru), Dutch (nl), Czech (cs), Arabic (ar), Chinese (zh-cn), Japanese (ja), Hungarian (hu), Korean (ko)).\n",
        "## Want to run locally for free? ⬇\n",
        "## [Check out the ebook2audiobookxtts github!](https://github.com/DrewThomasson/ebook2audiobookXTTS)"
      ],
      "metadata": {
        "id": "DKNNnwD-HJwQ"
      }
    },
    {
      "cell_type": "code",
      "source": [
        "# @title πŸ› οΈ Install requirments\n",
        "#!DEBIAN_FRONTEND=noninteractive\n",
        "!sudo apt-get update # && sudo apt-get -y upgrade\n",
        "!sudo apt-get -y install libegl1\n",
        "!sudo apt-get -y install libopengl0\n",
        "!sudo apt-get -y install libxcb-cursor0\n",
        "!sudo -v && wget -nv -O- https://download.calibre-ebook.com/linux-installer.sh | sudo sh /dev/stdin\n",
        "!sudo apt-get install -y ffmpeg\n",
        "#!sudo apt-get install -y calibre\n",
        "!pip install ebook2audiobook-install-counter\n",
        "!pip install ebooklib\n",
        "!pip install pydub\n",
        "!pip install nltk\n",
        "!pip install beautifulsoup4\n",
        "!pip install tqdm\n",
        "!pip install gradio\n",
        "!pip install coqui-tts"
      ],
      "metadata": {
        "id": "Edxj355K0rUz",
        "collapsed": true,
        "cellView": "form"
      },
      "execution_count": null,
      "outputs": []
    },
    {
      "cell_type": "code",
      "source": [
        "# @title πŸš€ Run ebook2audiobookxtts! (Make sure to set the runtime to have gpu to have faster generation speeds! :)\n",
        "#ntlk error fix\n",
        "#https://github.com/delip/PyTorchNLPBook/issues/14\n",
        "import nltk\n",
        "nltk.download('punkt')\n",
        "\n",
        "#Auto agree to xtts\n",
        "import os\n",
        "os.environ[\"COQUI_TOS_AGREED\"] = \"1\"\n",
        "\n",
        "# To download the app.py and the Default_voice wav if not seen locally\n",
        "!wget -O /content/app.py https://raw.githubusercontent.com/DrewThomasson/ebook2audiobookXTTS/main/app.py\n",
        "!wget -O /content/default_voice.wav https://raw.githubusercontent.com/DrewThomasson/ebook2audiobookXTTS/main/default_voice.wav\n",
        "\n",
        "# Start the app with Share=True for the gradio interface\n",
        "!python /content/app.py --share True"
      ],
      "metadata": {
        "id": "658BTHueyLMo",
        "cellView": "form"
      },
      "execution_count": null,
      "outputs": []
    }
  ]
}