Commit graph

36 commits

Author SHA1 Message Date
Damien Elmes
0e4c02eac1 update platform checks (eg isWin -> is_win) + devMode 2021-11-25 09:06:16 +10:00
Damien Elmes
3c1729e91b run pyupgrade over codebase [python upgrade required]
This adds Python 3.9 and 3.10 typing syntax to files that import
attributions from __future___. Python 3.9 should be able to cope with
the 3.10 syntax, but Python 3.8 will no longer work.

On Windows/Mac, install the latest Python 3.9 version from python.org.
There are currently no orjson wheels for Python 3.10 on Windows/Mac,
which will break the build unless you have Rust installed separately.

On Linux, modern distros should have Python 3.9 available already. If
you're on an older distro, you'll need to build Python from source first.
2021-10-04 15:05:48 +10:00
Damien Elmes
00c68b44e0 update Python deps 2021-10-02 23:52:23 +10:00
Damien Elmes
926fc2e492 add missing copyright headers to *.py 2021-04-13 18:45:35 +10:00
Damien Elmes
43105d62cf i18n tts error message 2021-04-08 09:35:19 +10:00
Damien Elmes
42a44875ab convert qt strings to f-strings with flynt
Also revealed an incorrect type def in editor.py that mypy wasn't
noticing before :-(
2021-02-11 10:09:06 +10:00
Damien Elmes
bf7528d90a minor code cleanups with pyupgrade
- pyupgrade --py38-plus --keep-runtime-typing --keep-percent-format
- third-party mpv and winpaths excluded
2021-02-11 09:43:40 +10:00
Damien Elmes
e64e807782 catch TTS runtime error 2021-02-10 16:30:51 +10:00
Damien Elmes
9702532fc4 more typing updates 2021-02-02 23:31:55 +10:00
Damien Elmes
748aeb9df1 add a bunch of return types 2021-02-01 23:53:23 +10:00
Damien Elmes
34935bf478 add types to editor.py 2021-02-01 17:28:35 +10:00
Damien Elmes
683ff0c02d fail gracefully in winrt voice list fails to load
If no voices are installed, get_all_voices() throws a "file not found"
error.
2020-12-21 14:29:14 +10:00
Ryan Aird
7fc6dfae9c Make RT import statement conditional, fix formatting, ignore WinRT for type checking 2020-12-20 19:43:09 -06:00
Ryan Aird
78c4947298 Lower default rank for non-RT voices and restrict to Windows 10 October 2018 or greater 2020-12-19 20:10:23 -06:00
Ryan Aird
e7e028fdbb WinRT TTS API support 2020-12-19 19:29:34 -06:00
Damien Elmes
9c8e8c2216 fix audio getting stuck (2/2) 2020-03-15 09:34:04 +10:00
Damien Elmes
749541226e fix _tidy_name() comment 2020-02-28 17:14:47 +10:00
Damien Elmes
999aa74eb2 ensure Anki starts on Windows systems that don't have TTS installed 2020-02-25 16:25:17 +10:00
Damien Elmes
7abe5d2a9b fix pylint 2020-01-26 18:57:32 +10:00
Damien Elmes
42527d0b08 add a (perhaps temporary) tts-voices: filter to show all available engines 2020-01-26 17:35:07 +10:00
Damien Elmes
47bcb3845c support speed control in tts tags 2020-01-26 14:31:07 +10:00
Damien Elmes
e3940b4e4f handle spaces in voices, add platform prefix 2020-01-22 17:50:08 +10:00
Damien Elmes
712779886a add a hook for when playback begins 2020-01-22 14:41:32 +10:00
Damien Elmes
2b9a74fe5c mypy fixes 2020-01-21 20:42:06 +10:00
Damien Elmes
52a41d9a8e formatting fixes 2020-01-21 20:39:25 +10:00
Damien Elmes
27b14aea3e add a helper for caching generated files 2020-01-21 20:35:23 +10:00
Damien Elmes
5b7699563f when matching voices, need to check language matches too 2020-01-21 20:35:00 +10:00
Damien Elmes
e326236f7c compare only on rank, as voices may be subclassed 2020-01-21 18:33:14 +10:00
Damien Elmes
8ddb49eb76 add Windows TTS support 2020-01-21 17:34:47 +10:00
Damien Elmes
202dc608a3 deal with spaces in macOS voices like "Bad News" 2020-01-21 13:38:37 +10:00
Damien Elmes
9dc9151963 add file-based TTS say implementation as well 2020-01-21 13:21:43 +10:00
Damien Elmes
b0d2958721 add rank handling to TTS; parse TTS args in get_av_tags() 2020-01-21 12:41:37 +10:00
Damien Elmes
a85ad8b257 more TTS and sound work
- use provided language and voices when playing on Mac
- fix hang in waiting for termination
- allow players to return a rank for a given tag,
which will allow for the best matching player to be chosen
depending on the context (eg, prioritize one player for videos,
one tts player for certain voices, etc)
2020-01-21 11:34:25 +10:00
Damien Elmes
8b1d029eb9 support interrupting say; fix race in simple player 2020-01-21 07:28:19 +10:00
Damien Elmes
f9ca9501ac pass task manager in instead of creating a new one 2020-01-21 06:49:09 +10:00
Damien Elmes
4d3858023b add a proof of concept TTS implementation on Mac 2020-01-20 20:08:19 +10:00