by oran collins
github.com/wisehackermonkey
oranbusiness@gmail.com
20200415
Prebuilt windows binaries are avaiable under releases
git clone https://github.com/wisehackermonkey/ultimate-tts-reader.git
cd ultimate-tts-reader
pip install -r requirements.txt
python ./main.py
copy something to the clipboard
press 'insert' on the keyboard
the computer should read the text to you!
- increased window size to fit title text
- app now starts minimized
>pip install pyinstaller
cd /path/to/project
pyinstaller --hidden-import=pyttsx3.drivers --hidden-import=pyttsx3.drivers.sapi5 --noconsole --onefile ultimate-tts-reader.py
pyinstaller --noconsole --hidden-import=pyttsx3.drivers --hidden-import=pyttsx3.drivers.sapi5 --specpath ${PWD}/builds --distpath ${PWD}/builds/dist --workpath ${PWD}/builds/build --onefile ultimate-tts-reader.py
Advanced (windows powershell) Build, move exe to to windows folder, includes moving of build files to ./builds
add move to windows folder
NOTE mv -force overwrites the exe (and is a powershell command)
> pyinstaller --noconsole --hidden-import=pyttsx3.drivers --hidden-import=pyttsx3.drivers.sapi5 --specpath ${PWD}/builds --distpath ${PWD}/builds/dist --workpath ${PWD}/builds/build --onefile ultimate-tts-reader.py ; mv -force ${PWD}/builds/dist/ultimate-tts-reader.exe ${PWD}/windows/ultimate-tts-reader.exe
> pyinstaller --noconsole --hidden-import=pyttsx3.drivers --hidden-import=pyttsx3.drivers.sapi5 --specpath ${PWD}/builds --distpath ${PWD}/builds/dist --workpath ${PWD}/builds/build --onefile ultimate-tts-reader.py ; mv -force ${PWD}/builds/dist/ultimate-tts-reader.exe ${PWD}/windows/ultimate-tts-reader.exe ; $date = Get-Date -Format "yyyyMMdd"; Compress-Archive -force -Path ${PWD}/windows/ultimate-tts-reader.exe -DestinationPath ${PWD}/windows/ultimate-tts-reader_windows_${date}.zip
### Auto update setup
pyupdater init
copy key 'keypack.pyu'
pyupdater keys -i
pyupdater settings --plugin scp
### Auto update build and push
```bash
on remote server
(TESTING)
sudo docker run --rm -it -p 7777:8080 --name simple -v /root/version-ultimate-tts-reader:/var/www:ro trinitronx/python-simplehttpserver
(deployment)
sudo docker run -d --restart=always -p 7777:8080 --name static-serve -v /root/version-ultimate-tts-reader:/var/www:ro trinitronx/python-simplehttpserver
pyupdater build --onefile --hidden-import="pkg_resources.py2_warn" --app-version=1.4.0 ultimate-tts-reader.py
pyupdater build --onefile --hidden-import="pypiwin32" --app-version=1.4.0 ultimate-tts-reader.py
pyupdater build --onefile --hidden-import="win32api" --hidden-import="pkg_resources.py2_warn" --app-version=1.4.0 ultimate-tts-reader.py
pyupdater pkg --process
pyupdater pkg --sign
## Improvements
- start minimized
- pause key/button
- fix quit on escape
- voice
- slow down the voice
- change voice
- catch KeyboardInterrupt graceful shutdown
- ~~Copy selected text to clipboard or copy selected text and read it~~
- ~~dependence injection
- ~~gui mvp
- ~~change stop use TK to quit
- ~~change stop key to fn + insert
- auto-update
- add zip to releases page github
- ~~increase size of window~~
- ~~start minimized~~~
## Links
tts https://pyttsx3.readthedocs.io/en/latest/engine.html#examples
keyboard https://pynput.readthedocs.io/en/latest/keyboard.html
posible solution to pause key nateshmbhat/pyttsx3#35
Tkinter gui https://docs.python.org/3/library/tkinter.html
Pyinstaller https://pyinstaller.readthedocs.io/en/stable/usage.html
pyinstaller fix output file destination Python: how to specify output folders in Pyinstaller .spec file https://stackoverflow.com/questions/37319911/python-how-to-specify-output-folders-in-pyinstaller-spec-file
pyinstaller fix pyttsx3 not found error
pyinstaller --hidden-import=pyttsx3.drivers song_dl.py
# Scratch pad
pyinstaller --onefile --hidden-import="pkg_resources.py2_warn" ultimate-tts-reader.py
pyinstaller --console --hidden-import=pyttsx3.drivers --hidden-import="pkg_resources.py2_warn" --hidden-import=pyttsx3.drivers.sapi5 --onefile ultimate-tts-reader.py
pyinstaller --console --hidden-import=win32api --hidden-import=pyttsx3.drivers --hidden-import="pkg_resources.py2_warn" --hidden-import=pyttsx3.drivers.sapi5 --onefile ultimate-tts-reader.py
22885 WARNING: library coredll required via ctypes not found 23100 INFO: Including run-time hook 'pyi_rth_pkgres.py' 23106 INFO: Including run-time hook 'pyi_rth_win32comgenpy.py'
<script type="text/javascript" src="https://www.free-counters.org/count/5vlj"></script><br>
<a href='http://www.counter-zaehler.de'>counter skript</a> <script type='text/javascript' src='https://www.whomania.com/ctr?id=67fe581f5c91eee6e3062f6fdd9aa156c648c349'></script>