Skip to content

wisehackermonkey/ultimate-tts-reader

Repository files navigation

ultimate-tts-reader

awesome app to read text from the clipboard when you press the insert key

by oran collins
github.com/wisehackermonkey
[email protected]
20200415

Screenshot_1

Install

Prebuilt windows binaries are avaiable under releases

how to install (source)

git clone https://github.com/wisehackermonkey/ultimate-tts-reader.git
cd ultimate-tts-reader
pip install -r requirements.txt

how to run

windows only

python ./main.py

Useage

copy something to the clipboard
press 'insert' on the keyboard
the computer should read the text to you!

Dev Log updates

Update (20200708)

Improvements

  • increased window size to fit title text
  • app now starts minimized

How to build windows exe

install pyinstaller

>pip install pyinstaller 
cd /path/to/project

Simple build

pyinstaller --hidden-import=pyttsx3.drivers  --hidden-import=pyttsx3.drivers.sapi5 --noconsole --onefile ultimate-tts-reader.py

clean build

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

Advanced (plus zip) (windows powershell)

> 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

https://stackoverflow.com/questions/58133083/modulenotfounderror-no-module-named-pyttsx3-drivers-file-compiled-with-pyins



# 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

try fix v1 (fail)

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>

About

awesome app to read text from the clipboard when you press the insert key

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages