Commit Graph

131 Commits

Author SHA1 Message Date
Damien Elmes
5a79bc69b8 fix audio displaying console window on Windows 2020-01-23 17:27:07 +10:00
Damien Elmes
0ad6e8b58e make pylint happy 2020-01-22 15:37:58 +10:00
Damien Elmes
cfa0f65311 add a hook for when playback begins 2020-01-22 14:41:32 +10:00
Damien Elmes
6af7933084 make .command() behave the same way for mplayer and mpv 2020-01-22 14:11:25 +10:00
Damien Elmes
be3393fcb4 simplify taskman, and add .run_on_main() 2020-01-22 14:09:51 +10:00
Damien Elmes
f92bb55c25 add option in prefs to hide replay audio buttons 2020-01-21 21:00:17 +10:00
Damien Elmes
19b3a15146 formatting fixes 2020-01-21 20:39:25 +10:00
Damien Elmes
ccd7150136 fix mpv args
https://anki.tenderapp.com/discussions/ankidesktop/38186-mpvprocesserror-unable-to-start-process
2020-01-21 19:29:50 +10:00
Damien Elmes
5351a5f396 compare only on rank, as voices may be subclassed 2020-01-21 18:33:14 +10:00
Damien Elmes
84711f8fe2 add Windows TTS support 2020-01-21 17:34:47 +10:00
Damien Elmes
7b3d701ad5 add replay buttons to reviewing screen 2020-01-21 14:47:03 +10:00
Damien Elmes
7504ef6857 make sure we don't mutate list passed to play_from_tags() 2020-01-21 14:43:33 +10:00
Damien Elmes
2ac86ac400 add file-based TTS say implementation as well 2020-01-21 13:21:43 +10:00
Damien Elmes
c713683f63 add rank handling to TTS; parse TTS args in get_av_tags() 2020-01-21 12:41:37 +10:00
Damien Elmes
66e277e44b 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
d4d16d35a8 spawn a new slave mode mplayer for each file
This solves a few problems:

- We no longer need to write temporary files to disk, as files
passed on the command line with non-Latin text can be read by mplayer.
- We no longer need to deal with mplayer processes left around in
the background that have failed to terminate.
- We don't need to deal with the added complexity that comes with
polling mplayer's status output to determine when the file has finished
playing.

Also add seek_relative(), toggle_pause() and shutdown() as optional
methods on AVPlayer.
2020-01-21 08:55:15 +10:00
Damien Elmes
01f3fd06d6 support interrupting say; fix race in simple player 2020-01-21 07:28:19 +10:00
Damien Elmes
1beae4f858 pass task manager in instead of creating a new one 2020-01-21 06:49:09 +10:00
Damien Elmes
0b5e22253b add .stop() to mpv 2020-01-21 06:45:32 +10:00
Damien Elmes
a6e6ffae06 get mpv slave mode working with new API
Also move the mpv-specific hooks into AVPlayer
2020-01-20 22:01:38 +10:00
Damien Elmes
d9c240afa2 minor tidyup to sound.py 2020-01-20 21:03:22 +10:00
Damien Elmes
7900f68051 don't need allSounds/stripSounds in qt's sound.py 2020-01-20 20:13:01 +10:00
Damien Elmes
caac4527e9 add a proof of concept TTS implementation on Mac 2020-01-20 20:08:19 +10:00
Damien Elmes
707ac587ec rework the audio player API and add a simpler player implementation
- the new API operates on AVTags so it can support TTS as well as
audio files
- added a simple "run for each file" implementation for mpv and mplayer.
- will need to test handling of unicode filenames on Windows
- the old mpv and mplayer code is currently not active
2020-01-20 20:07:11 +10:00
Damien Elmes
5084438a0b we can depend on pyaudio being available now that the code is in qt/ 2020-01-20 19:21:24 +10:00
Damien Elmes
cab572b63c remove _hook/_filter suffix 2020-01-15 16:53:24 +10:00
Damien Elmes
89fce1f6b7 migrate addHook/remHook calls 2020-01-15 13:49:26 +10:00
Damien Elmes
660685375f migrate most of the remaining runHook() calls 2020-01-15 12:46:53 +10:00
Damien Elmes
662eb53e6a switch to classes for hooks
This allows us to add a docstring to .append() so users can see
the names of the arguments that are being passed, and means we
don't have to remember to prepend run_ when calling a hook.
2020-01-14 08:54:07 +10:00
Damien Elmes
4bb3d7a958 add separate file for gui hooks 2020-01-13 14:38:05 +10:00
Damien Elmes
5876866565 tweaking the folder names again
hopefully that's the last of it
2020-01-03 07:48:38 +10:00