{ "cells": [ { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "!pip install git+https://github.com/robinhad/ukrainian-tts.git" ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "downloading uk/mykyta/vits-tts\n", "Found ./model.pth. Skipping download...\n", "Found ./config.yaml. Skipping download...\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "/Users/robinhad/Projects/ukrainian-tts/.venv/lib/python3.9/site-packages/espnet2/gan_tts/vits/monotonic_align/__init__.py:19: UserWarning: Cython version is not available. Fallback to 'EXPERIMETAL' numba version. If you want to use the cython version, please build it as follows: `cd espnet2/gan_tts/vits/monotonic_align; python setup.py build_ext --inplace`\n", " warnings.warn(\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "RTF = 0.213155\n", "Accented text: прив+іт, +як +у теб+е спр+ави?\n" ] }, { "data": { "text/html": [ "\n", " \n", " " ], "text/plain": [ "" ] }, "execution_count": 1, "metadata": {}, "output_type": "execute_result" } ], "source": [ "from ukrainian_tts.tts import TTS, Voices, Stress\n", "import IPython.display as ipd\n", "\n", "tts = TTS(device=\"cpu\") # can try gpu, mps\n", "with open(\"test.wav\", mode=\"wb\") as file:\n", " _, output_text = tts.tts(\"Привіт, як у тебе справи?\", Voices.Dmytro.value, Stress.Dictionary.value, file)\n", "print(\"Accented text:\", output_text)\n", "\n", "ipd.Audio(filename=\"test.wav\")" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "[,\n", " ,\n", " ,\n", " ,\n", " ]" ] }, "execution_count": 2, "metadata": {}, "output_type": "execute_result" } ], "source": [ "[voice for voice in Voices]" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.9.13" }, "orig_nbformat": 4, "vscode": { "interpreter": { "hash": "deba62d825344d273fb083171c87f2b388c8298c18de18cc830c320ab0f305f4" } } }, "nbformat": 4, "nbformat_minor": 2 }