-
Notifications
You must be signed in to change notification settings - Fork 110
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow to be run on Windows platform #25
base: main
Are you sure you want to change the base?
Conversation
Thanks for the PR, please squish noisy changes (for example, making sample rate a hard-coded value, then using the configured value again). |
A new option --simulate-input-method is added. This replaces xdotool and needs pynput as new module. Use 'auto' default input method.
Use thread instead of a non blocking stream which is specific to Linux
Hello, |
Ran some more tests on this and responsiveness seems to have dropped a little, from looking into this - it seems Changing the read size in Besides this seeming error prone in general, higher sample rates could lock up recording. The test to idle: |
I have moved the test to idle in the case where the queue of data is empty. This is indeed more responsive. Thus I use smaller chunks from the queue. |
This change makes the idle-delay not fulfill it's original purpose.
So I believe idle should only be changed to check the queue is empty, to allow time to build up the record buffer (defaulting to 1/10th of a second, enough to feel responsive without high CPU usage). |
BTW, did you check on non-blocking reads for WIN32? |
I have tested it on Windows 8 only, I don't have Win32 here. |
… recorder to 1024. This improves responsiveness and allows to have smaller chunks from recorder
I displaced the test. |
I've been considering this PR and something that doesn't sit well with me is that it complicates the code by adding threading which is only needed for Windows, which I don't use (and can't easily test). Using threading (in my opinion) makes the code more complex and less hackable (which is a goal of this project I would like to keep prioritized). So I would rather the windows support instead, replace the pipe read with a file-like object that manages reads that don't block on windows. This would allow windows support without complicating logic for Linux. |
I kinda agree with @ideasman42 here, but I still wanted to say thank you very much for the code @papoteur-mga
so I can work from my windows work machine, and my home linux machine! and only one config file. sweeeeet. |
569fdae
to
4a922ad
Compare
37a2db6
to
d56e61e
Compare
f72c0d1
to
5f3b3e9
Compare
2436242
to
72eef57
Compare
I have clients who run on Windows.
Thus I propose this, which consists of:
fmedia
insteadparec
, by detecting that the platform is notposix
;posix
specific feature;pynput
keyboard simulation - the option has to be passed.Thus I got good results for my limited tests on a Windows 8 machine. And it still works on my Linux.
I used
black
andmypy
passed.The value of size block seems important for the reactivity. A big value like 1M give too long interval between results. A lower value like 1k seems to give a too high load. I put 16k which seems a good balance.
https://github.com/papoteur-mga/nerd-dictation/blob/1fb54dc4bd8fc389dbd18001c0185257d60c9fae/nerd-dictation#L99
If this is accepted, some documentation has to be edited.