savbell/whisper-writer

Accents are not correctly transcribed

Closed this issue · 4 comments

When I hit Ctrl+Alt+Space and speak french, I can see in the python terminal that the accents are correctly transcribed, but on the target windows, the accents disappears. To test, just say "Touché, coulé", transcribed as follow: "Touch, coul. "

Thanks a lot for this nice software, it helps a lot, I can't believe that this is the only opensource whisper-based dictation tool...

It is caused by the library for inserting the keyboard codes, it does not work with some keyboard layouts: asweigart/pyautogui#137

I had a similar problem with my custom layout so made a Pull Request using another library that can fix that.
Meantime maybe you can check if it works for you https://github.com/uberkael/whisper-writer.

Thanks.

Nice, I confirm that your PR works perfectly :-)

Thanks a lot !

Thank you uberkael for your fork, I get this error. Maybe someone an help me 🙏
(Info: ctrl+alt+space didn't do anything for me so I am trying with F-buttons instead)

"Script activated. Whisper is set to run using a local model. To change this, modify the "use_api" value in the src\config.json file.
Press F4 to start recording and transcribing. Press Ctrl+C on the terminal window to quit.
^[OS2023-11-15 17:59:43.862 Python[66736:995225] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'NSWindow drag regions should only be invalidated on the Main Thread!'
*** First throw call stack:
(
0 CoreFoundation 0x00000001a63a91a8 __exceptionPreprocess + 240
1 libobjc.A.dylib 0x00000001a60f3e04 objc_exception_throw + 60
2 CoreFoundation 0x00000001a63d4128 _CFBundleGetValueForInfoKey + 0
3 AppKit 0x00000001a8eb7930 -[NSWindow(NSWindow_Theme) _postWindowNeedsToResetDragMarginsUnlessPostingDisabled] + 372
4 AppKit 0x00000001a8ea292c -[NSWindow _initContent:styleMask:backing:defer:contentView:] + 948
5 AppKit 0x00000001a8ea256c -[NSWindow initWithContentRect:styleMask:backing:defer:] + 56
6 libtk8.6.dylib 0x000000016afc9ddc TkMacOSXMakeRealWindowExist + 572
7 libtk8.6.dylib 0x000000016afc9a8c TkWmMapWindow + 56
8 libtk8.6.dylib 0x000000016af32dc4 Tk_MapWindow + 152
9 libtk8.6.dylib 0x000000016af3b130 MapFrame + 76
10 libtcl8.6.dylib 0x000000016b2ac9b0 TclServiceIdle + 84
11 libtcl8.6.dylib 0x000000016b29106c Tcl_DoOneEvent + 296
12 libtk8.6.dylib 0x000000016afbcca8 TkpInit + 800
13 libtk8.6.dylib 0x000000016af3407c Initialize + 2292
14 _tkinter.cpython-311-darwin.so 0x0000000168b8a368 Tcl_AppInit + 92
15 _tkinter.cpython-311-darwin.so 0x0000000168b8a000 Tkapp_New + 548
16 _tkinter.cpython-311-darwin.so 0x0000000168b89dd8 _tkinter_create_impl + 268
17 _tkinter.cpython-311-darwin.so 0x0000000168b89a10 _tkinter_create + 240
18 Python 0x000000010348a034 cfunction_vectorcall_FASTCALL + 80
19 Python 0x000000010354bf84 _PyEval_EvalFrameDefault + 52572
20 Python 0x00000001035519ec _PyEval_Vector + 156
21 Python 0x0000000103425098 _PyObject_FastCallDictTstate + 96
22 Python 0x00000001034b2754 slot_tp_init + 180
23 Python 0x00000001034a90d8 type_call + 136
24 Python 0x0000000103424d78 _PyObject_MakeTpCall + 128
25 Python 0x000000010354c06c _PyEval_EvalFrameDefault + 52804
26 Python 0x00000001035519ec _PyEval_Vector + 156
27 Python 0x0000000103429158 method_vectorcall + 364
28 Python 0x000000010364eeb0 thread_run + 220
29 Python 0x00000001035caff4 pythread_wrapper + 48
30 libsystem_pthread.dylib 0x00000001a625c26c _pthread_start + 148
31 libsystem_pthread.dylib 0x00000001a625708c thread_start + 8
)
libc++abi: terminating with uncaught exception of type NSException"

Hi, I've approved and merged #10 to use pynput instead of pyautogui for transcription. This should fix the accent issue. Thanks @uberkael!