mozilla / TTS

:robot: :speech_balloon: Deep learning for Text to Speech (Discussion forum: https://discourse.mozilla.org/c/tts)
Mozilla Public License 2.0
9.43k stars 1.26k forks source link

[Question] How to use this project? #272

Closed NightMachinery closed 4 years ago

NightMachinery commented 5 years ago

Prescript: I posted this on https://discourse.mozilla.org/t/using-the-tts-on-a-macbook-pro/44140, but I got no response, so I'm posting it here.

My eyes have been giving me trouble again, and I am looking to see if there are any usable open-source TTS engines. I listened to the samples at https://github.com/mozilla/TTS/wiki/Released-Models, and I like what I’ve seen. Is it possible to use these pretrained model on a GPUless Macbook Pro to create audiobooks? I am ok with a speed of even 0.1. If it is possible, how do I get it to work? I want to ultimately have a shell function that takes a txt file and gives me an audio file. Googling led me to this ‘demo server’ thingy at https://github.com/mozilla/TTS/tree/distributed-dev/server, which is a 404 currently.

tugstugi commented 5 years ago

@NightMachinary I haven't also found a guide how to synthesize with this repo.

Maybe you can try other open source impelementations. Here are some notebooks which are executable on colab:

tugstugi commented 5 years ago

@NightMachinary here is a Colab notebook for Mozilla TTS + WaveRNN: https://colab.research.google.com/github/tugstugi/dl-colab-notebooks/blob/master/notebooks/Mozilla_TTS_WaveRNN.ipynb

It will automatically checkout the correct commit/branch, download the pretrained models and synthesize an audio. You have to change the SENTENCE variable in the notebook.

nmstoker commented 5 years ago

Take a look here at the demo server: https://github.com/mozilla/TTS/tree/master/server (I think you had the wrong location before)

If you read the code a bit, it shouldn't be too hard to figure out how call the API for it from a script that feeds it sentences from your audiobook text and then append the audio returned into a single file.

thiscris commented 5 years ago

If I want to have this as a TTS on my system as to apply it to Firefox narrate function in reader mode, what do I need to do?

MikeyBeez commented 5 years ago

It just doesn't work. Neither does deepspeech. Use festival and SpeechRecognition.

reuben commented 5 years ago

I've made a simple packaging option and included a model in the wiki: https://github.com/mozilla/TTS/wiki/Released-Models#simple-packaging---self-contained-package-that-runs-an-http-api-for-a-pre-trained-tts-model

Instructions are in the README.md file inside. Would appreciate any feedback.

marimeireles commented 5 years ago

a huge improvement! thanks @reuben :)

IveJ commented 5 years ago

Thanks for your hard work.

On Thu, Nov 28, 2019, 20:53 Mariana Meireles notifications@github.com wrote:

a huge improvement! thanks @reuben https://github.com/reuben :)

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/mozilla/TTS/issues/272?email_source=notifications&email_token=AEYAML57P64NW3OCIVN7LILQV7EMVA5CNFSM4IS62UUKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEFMVKXI#issuecomment-559502685, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEYAMLZHLNHRHETY7255TRDQV7EMVANCNFSM4IS62UUA .

nayanhalder commented 4 years ago

hi @reuben i have done the following steps.

  1. Create a fresh virtual environment with Python 3.7
  2. sudo apt-get install espeak libsndfile1
  3. pip install https://github.com/reuben/TTS/releases/download/t2-ljspeech-mold/TTS-0.0.1+b6b513f-py3-none-any.whl

i am getting many errors while intallation of scipy in step 3.

Can you help me please. where i am getting wrong.

following error i am getting.

error: Command "gcc -pthread -B /home/nayan/anaconda3/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/home/nayan/tmp/tts-venv/lib/python3.7/site-packages/numpy/core/include -I/home/nayan/tmp/tts-venv/lib/python3.7/site-packages/numpy/core/include -I/home/nayan/anaconda3/include/python3.7m -c scipy/cluster/_hierarchy.c -o build/temp.linux-x86_64-3.7/scipy/cluster/_hierarchy.o -MMD -MF build/temp.linux-x86_64-3.7/scipy/cluster/_hierarchy.o.d" failed with exit status 1

Rolling back uninstall of scipy Moving to /home/nayan/tmp/tts-venv/lib/python3.7/site-packages/scipy-1.3.3.dist-info/ from /home/nayan/tmp/tts-venv/lib/python3.7/site-packages/~cipy-1.3.3.dist-info Moving to /home/nayan/tmp/tts-venv/lib/python3.7/site-packages/scipy/ from /home/nayan/tmp/tts-venv/lib/python3.7/site-packages/~cipy ERROR: Command errored out with exit status 1: /home/nayan/tmp/tts-venv/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-h08sh93d/scipy/setup.py'"'"'; file='"'"'/tmp/pip-install-h08sh93d/scipy/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' install --record /tmp/pip-record-o76kawn1/install-record.txt --single-version-externally-managed --compile --install-headers /home/nayan/tmp/tts-venv/include/site/python3.7/scipy Check the logs for full command output.

reuben commented 4 years ago

Use Python 3.6 as documented on the wiki page. Some of the dependencies predate Python 3.7, so if you're using that, it'll try to build them from source.

nayanhalder commented 4 years ago

Hi @ruben many many thanks for your help. i have created virtual environment with 3.6 and the flask app is working fine.

My requirement is to generate sppech frpm text via batch, so i do not require flask app. therefore i need to keep the input text file in somewhere /home/nayan/tmp/tts-venv/lib/python3.6/site-packages/TTS and then save the speech output in the same folder.

To achive that, what changes are required and which program i need to change to pass input sentence and then process the input text and save the output speech file. what is the python program i have to change for this .

nayanhalder commented 4 years ago

whatever i understand from server.py , i need to create a small program like this. am i correct.

from TTS.server.synthesizer import Synthesizer from scipy.io.wavfile import write text = " hi i am nayan" data = synthesizer.tts(text) sps = 44100 write("sample.wav", sps, data)

but i am getting an error File "/home/nayan/tmp/tts-venv/lib/python3.6/site-packages/scipy/io/wavfile.py", line 333, in write dkind = data.dtype.kind AttributeError: '_io.BytesIO' object has no attribute 'dtype'

erogol commented 4 years ago

closed due to inactivity

Nakilon commented 2 years ago

How do I install the pretrained models into Windows 10? Neither "windows" nor "install" are showing up on ctrl+F on your wiki page. I want the third-party application to use the voice other than the default one. It choses from the voices installed in OS.