Commit graph

52 commits

Author SHA1 Message Date
Damien Elmes
b23b6fbe35 move the separate components back into this monorepo
Earlier today I pushed a change that split this code up into multiple
repos, but that has proved to complicate things too much. So we're
back to a single repo, except the individual submodules are better
separated than they were before.

The README files need updating again; I will push them out soon.

Aside from splitting out the different modules, the sound code has
moved from from anki to aqt.
2020-01-02 19:43:19 +10:00
Michal Pokorný (Rai)
9383a72704 Remove unneeded utf-8 encoding declaration
UTF-8 is the default as of Python 3.
See: https://docs.python.org/3/reference/lexical_analysis.html#encoding-declarations
2019-12-27 18:06:06 +01:00
Damien Elmes
17af26dcb5 apply black to all files 2019-12-23 10:34:10 +10:00
Damien Elmes
bfcc837939 avoid noreturn for now, as it's not supported on python <3.6.5 2019-12-21 16:54:40 +10:00
Damien Elmes
c1587254f4 use isort to tidy up imports 2019-12-20 19:19:29 +10:00
Damien Elmes
b6b8df2dcf add a bunch of annotations for mypy 2019-12-20 15:07:40 +10:00
Damien Elmes
6ecfff56c5 add pytype inferred types to anki/
I've corrected some obvious issues, and we can fix others over time.
Mypy tests are currently broken, as adding the type hints has increased
mypy's testing surface.
2019-12-20 11:07:08 +10:00
Damien Elmes
6f7c8915fe fix mplayer typecheck 2019-12-16 17:54:04 +10:00
Damien Elmes
d2f4450dc0 platform-specific imports 2019-12-16 17:51:33 +10:00
Damien Elmes
37a239cf38 add basic type checking for anki/ 2019-12-16 08:17:28 +10:00
Damien Elmes
95387af2cd cleanup recording on cancel 2019-07-14 11:19:29 +10:00
Damien Elmes
70c584671d cleanup mpv on exit 2019-04-29 14:36:51 +10:00
Damien Elmes
5dd7fc8c6e another attempt to preventing mpv from accessing standard config
https://github.com/dae/anki/pull/296
2019-04-09 15:32:44 +10:00
Damien Elmes
1a5322a396 psutil may throw OSError when calling .exe()
https://anki.tenderapp.com/discussions/ankidesktop/33406-failed-to-execute-script-runanki
2019-04-08 15:56:06 +10:00
Damien Elmes
b5d4e78b94 cleanup old mplayer instances in profile unload as well
possible fix for users still having permission errors when
renaming profiles
2019-03-05 09:01:31 +10:00
Damien Elmes
6e077ab414 use raw strings for regexs 2019-03-04 17:03:43 +10:00
Damien Elmes
3721cc4604 silence some spurious errors and remove some unused code 2019-03-04 11:22:40 +10:00
David Lönnhager
c6ab8dcc48 Fix permissions error on Windows 2019-02-27 02:51:28 +01:00
Damien Elmes
ca710ab3f1 allow running with pyaudio missing 2019-02-13 09:36:39 +10:00
Damien Elmes
041e4dbdf0 cleanup old mplayer instances after crash
fixes
https://anki.tenderapp.com/discussions/ankidesktop/31908-no-consigo-renomear-meu-nome-no-anki
2019-02-06 09:03:39 +10:00
Damien Elmes
372d5ed6e8 update copyright and clarify licenses 2019-02-05 14:01:33 +10:00
Damien Elmes
8e4f5d5032 fix recording overflow handling 2018-12-22 13:41:35 +10:00
Damien Elmes
8775314e36 use custom mpv config folder
not the first time the default location has caused problems for users
https://anki.tenderapp.com/discussions/ankidesktop/29531-bug-ankis-version-of-mpv-loads-mpvconf-from-configmpv-on-macos
2018-09-24 16:26:08 +10:00
Damien Elmes
fbeade1f23 fixes for mpv focus switching
- avoid changing focus if an Anki window is already focused
- only try to restore focus when playing videos
2018-07-23 13:57:09 +10:00
Damien Elmes
e6fcfb7379 need to record active window prior to playing in mpv 2018-05-31 13:22:17 +10:00
Damien Elmes
47370af7c3 work around video focus stealing
https://anki.tenderapp.com/discussions/ankidesktop/27401-bug-when-playing-a-video-on-anki-for-mac-anki-lanches-mplayer-and-doesnt-quit-it-or-return-to-anki
2018-04-30 17:12:26 +10:00
Damien Elmes
bb6844716c linux mpv doesn't understand --input-media-keys 2018-01-21 10:34:29 +10:00
Damien Elmes
6bddcc10e6 return to win32 audio driver on windows
fixes various playback issues some users were experiencing
2018-01-20 13:41:12 +10:00
aakatov
6c61dc180b fix play sound with HTML special symbols in its filename 2017-12-23 12:36:26 +03:00
Damien Elmes
39c0a57b13 work around pops in recording start
https://anki.tenderapp.com/discussions/ankidesktop/26005-when-recording-sound-on-mbp

on my machine, the pops start around sample 2048 of a 44.1khz recording,
and only for the first recording after the audio hardware has gone to
sleep
2017-12-05 11:07:52 +10:00
Damien Elmes
c451141f97 play question audio when preview set to 'show both sides' 2017-12-04 12:45:22 +10:00
Damien Elmes
b6972a22e8 fix stutter when multiple audio files on card on windows
setting playlist pos to 0 was causing half-played sound to restart
2017-11-10 19:52:20 +10:00
Damien Elmes
6b479fc839 don't leave a wav file lying around when recording 2017-10-25 18:35:39 +10:00
Damien Elmes
ca95552408 integrate _packagedCmd() into mpv for binary distrib 2017-10-02 16:37:52 +10:00
Damien Elmes
384a01e53b turn off mpv debug 2017-09-30 19:33:09 +10:00
Damien Elmes
7dc8f82906 mpv support 2017-09-30 19:29:48 +10:00
Damien Elmes
ca6412b6c9 don't force win32 audio output
was added in 2008 as a hack around sound problems users were having, but
it causes problems for other users and prevents overriding in the conf
file, so let's try with the default

report:
https://anki.tenderapp.com/discussions/ankidesktop/24859-poor-playback-with-mono-mp3

originally changed in c50203b9a1
2017-09-04 19:05:02 +10:00
Damien Elmes
7f7b8fc52f make sure we don't use inherited ld_library_path when calling mplayer 2017-05-22 15:40:04 +10:00
Illia Volochii
13b7e01044 Stop inheriting from object
It is not needed in Python 3.
2017-02-07 00:21:33 +02:00
Damien Elmes
f238bc772e fix audio on mac 2017-01-09 12:52:52 +10:00
Damien Elmes
f9385572df fix audio not stopping or overlapping
make sure we always send bytes
2016-12-17 13:47:07 +10:00
Damien Elmes
04c13d1348 use full path to packaged audio commands
ensures we use the packaged version over the system version
2016-07-26 12:15:43 +10:00
Damien Elmes
5655448919 explictly use utf8 when talking to mplayer
universal_newlines uses system locale which is ascii on osx unless
LC_CTYPE/LANG is set to utf8, so we need to be explicit about the
encoding we want instead

we also lose line buffering, so we have to explicitly flush
2016-07-12 16:55:10 +10:00
Damien Elmes
2c227da603 set rpath for bundled mplayer on linux 2016-06-29 14:21:48 +10:00
Damien Elmes
e131b20afd tweak mplayer loc on osx 2016-06-28 13:26:19 +10:00
Damien Elmes
1d75cff5e7 pyaudio is no longer optional 2016-06-23 12:04:48 +10:00
Damien Elmes
4d88b62fbf fix py3 issues with audio code 2016-05-31 17:51:16 +10:00
Damien Elmes
15b349e3a8 start port to python 3
unit tests pass and main screens of GUI load
2016-05-12 14:45:35 +10:00
Damien Elmes
89c9af7445 use default sample rate instead of forcing 44100
The 64 bit built of portaudio on OSX seems to generate a wav
file that says it's 44100 but is actually the default rate, leading
to samples playing too fast or slow.
2014-04-18 04:17:05 +09:00
Damien Elmes
d36655a8c7 use unicode when recording 2013-09-23 15:13:46 +09:00