python-voiceio 1.17.0__py3-none-any.whl → 1.17.2__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {python_voiceio-1.17.0.dist-info → python_voiceio-1.17.2.dist-info}/METADATA +1 -1
- {python_voiceio-1.17.0.dist-info → python_voiceio-1.17.2.dist-info}/RECORD +36 -36
- voiceio/__init__.py +1 -1
- voiceio/app.py +6 -3
- voiceio/cli/__init__.py +4 -4
- voiceio/cli/doctor.py +45 -10
- voiceio/cli/learn.py +2 -1
- voiceio/cli/uninstall.py +6 -1
- voiceio/config.py +40 -3
- voiceio/core/decoders/catalog.py +22 -3
- voiceio/core/decoders/faster_whisper/__init__.py +2 -2
- voiceio/core/decoders/fetch.py +15 -6
- voiceio/corrections.py +3 -2
- voiceio/errorlog.py +2 -1
- voiceio/health.py +25 -11
- voiceio/hints.py +2 -1
- voiceio/history.py +1 -2
- voiceio/ibus/install.py +2 -1
- voiceio/learn/augment.py +2 -2
- voiceio/learn/evaluate.py +2 -2
- voiceio/learn/importer.py +1 -2
- voiceio/learn/store.py +3 -7
- voiceio/llm.py +6 -4
- voiceio/platform.py +65 -0
- voiceio/retention.py +2 -4
- voiceio/setup/configfile.py +2 -2
- voiceio/setup/noninteractive.py +6 -2
- voiceio/setup/steps.py +15 -1
- voiceio/setup/system.py +7 -2
- voiceio/tts/chain.py +3 -1
- voiceio/vocab_stats.py +2 -1
- voiceio/vocabulary.py +5 -1
- {python_voiceio-1.17.0.dist-info → python_voiceio-1.17.2.dist-info}/WHEEL +0 -0
- {python_voiceio-1.17.0.dist-info → python_voiceio-1.17.2.dist-info}/entry_points.txt +0 -0
- {python_voiceio-1.17.0.dist-info → python_voiceio-1.17.2.dist-info}/licenses/LICENSE +0 -0
- {python_voiceio-1.17.0.dist-info → python_voiceio-1.17.2.dist-info}/top_level.txt +0 -0
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
python_voiceio-1.17.
|
|
2
|
-
voiceio/__init__.py,sha256=
|
|
1
|
+
python_voiceio-1.17.2.dist-info/licenses/LICENSE,sha256=Gz61o8jFTAvZUZyB3nWDB3DQQVuipjfPkVu9W8hBHM0,1072
|
|
2
|
+
voiceio/__init__.py,sha256=ZTulLPgBh4cnWgZEE-NU6oqIAg51m2VLZjl9bTHW2nw,23
|
|
3
3
|
voiceio/__main__.py,sha256=xT5QCGGreYMisHO7Lh_Y-xAQ2TOzG2D7npKknGNcWSY,53
|
|
4
4
|
voiceio/announce.py,sha256=oqNJn1c4j5bTQ00-LXNWZ3_hIC9L9Lb3rkp0-LwkCfY,3798
|
|
5
|
-
voiceio/app.py,sha256=
|
|
5
|
+
voiceio/app.py,sha256=tStX_aQyMhFK3NUFWvwowx0jW4a7szX6zkOoP7-lu60,49485
|
|
6
6
|
voiceio/audio_source.py,sha256=rR6NRtNzmZ8uqmNPxareBWTJmuBaOxIGI5QINR_l-qc,9102
|
|
7
7
|
voiceio/backends.py,sha256=-rs1YhPblub4NjFb6qCD7Ih9FqBRXtPuvjVv9bQoQ1w,368
|
|
8
8
|
voiceio/clipboard_read.py,sha256=7f5aX644Fiy2S6MXxADfSgRtvO3P1U-r_VkzEgWrwKQ,5376
|
|
9
9
|
voiceio/commands.py,sha256=Jz-txXSw32Adf8B912M8CzQIh4UMmEKRCZBPXU4bBaU,6014
|
|
10
|
-
voiceio/config.py,sha256=
|
|
10
|
+
voiceio/config.py,sha256=L_FZxnvxZN_0Tz-iTfz4unIOEo9l2t-T4EBHoWobDEY,25728
|
|
11
11
|
voiceio/consent.py,sha256=3stv3iZvYl_Dt4GUe-GUVOHEGi-2fOl-QqF3pDjraS4,1862
|
|
12
12
|
voiceio/context_terms.py,sha256=rbVzEoqahroWdkYqiOmn4PJVsl6ftk_PDa-lXdoTBvA,11747
|
|
13
|
-
voiceio/corrections.py,sha256=
|
|
13
|
+
voiceio/corrections.py,sha256=F9b1EQDkKQHmS1bJB_QQXUAlVrSsB8ojv6RiJB4uD9w,10044
|
|
14
14
|
voiceio/demo.py,sha256=jA282e7UWDwtP1IXT2bPHH5wl6eKdBNvOJcoNDWzZlQ,8766
|
|
15
15
|
voiceio/display.py,sha256=ZGBNRjuvg3chkJjduyPJs4s5ZY5vqC_mcaov94PIPzo,5313
|
|
16
|
-
voiceio/errorlog.py,sha256=
|
|
16
|
+
voiceio/errorlog.py,sha256=e5UKVp4p-UBg0tTpcBREY5KoHMFZFJ9oNK3vOh8H6jw,7044
|
|
17
17
|
voiceio/feedback.py,sha256=69Vepy2Z0gsDdpLzdLJbgrEHzSJm2luQ7yT4_nAnZCQ,9321
|
|
18
18
|
voiceio/focus.py,sha256=PGj839UUZE7ZPwaiLDTAX3S8d_QjwaT4y6ugXyylL9M,4304
|
|
19
|
-
voiceio/health.py,sha256=
|
|
20
|
-
voiceio/hints.py,sha256=
|
|
21
|
-
voiceio/history.py,sha256=
|
|
19
|
+
voiceio/health.py,sha256=WB6j2Z_x7NmJaUdUcvnxGwvt1MXMBlxkOqGfkhJf2Cg,27948
|
|
20
|
+
voiceio/hints.py,sha256=wQPVie-zX-SFfz3C0YxL40_51SCkF1Xt8F1vwI_5yoY,1440
|
|
21
|
+
voiceio/history.py,sha256=WNjfjakY8qwgRm3W6WBDlpS9CSgS8ecZ9RGGBZsW80w,5898
|
|
22
22
|
voiceio/idle_audio.py,sha256=0GEbm0g-a2uVxIMWEKpaYus06mnrc8qvWr09a85FWS0,7225
|
|
23
|
-
voiceio/llm.py,sha256=
|
|
23
|
+
voiceio/llm.py,sha256=s8nfahibR49OVFAulsXaoZ2kaaqGhVcxV26Ik3CtSis,9326
|
|
24
24
|
voiceio/llm_api.py,sha256=4jJ5U1Dop-3uoM9RM3bjUMxB4kYNNjwKbOwIIj0ll3U,9390
|
|
25
25
|
voiceio/mic_gain.py,sha256=lMSOz80-cb9X_ggShQttynjVRqcKd1tIUw9e64fEszM,4412
|
|
26
26
|
voiceio/numbers.py,sha256=CXJtlMhmV6_9Z1FtKAF4-RXycw8voV-BYHPBpdw1I6Y,13571
|
|
27
27
|
voiceio/pidlock.py,sha256=OZLNskUyv9_F3WgyHZWw8WmKt0W7ioxH6xgHitOwCww,1216
|
|
28
|
-
voiceio/platform.py,sha256=
|
|
28
|
+
voiceio/platform.py,sha256=glRFrS8KsyQTHbpvB42sEOQPdGr9H6ypjd415ziNZjs,22288
|
|
29
29
|
voiceio/postcorrect.py,sha256=JN5l9xnyGfYq2_owSUwkJ513QiQQKxCrT3hjU5aJCpg,17322
|
|
30
30
|
voiceio/postprocess.py,sha256=01ILYaPObF3LZ7oLdCZC1iFQfAFzzGayWFCjCU8RKz8,7121
|
|
31
31
|
voiceio/power.py,sha256=mKiG5ioHbzgtW2S-OKGFOPzZFbG0HwUUyMn8kE5JRoQ,681
|
|
@@ -35,7 +35,7 @@ voiceio/prompt.py,sha256=9iza8KoQxvO_U9NPMJ8Ep7j-zkIs9nW8N5sacCRpsEk,2904
|
|
|
35
35
|
voiceio/quiet_audio.py,sha256=AapeuhrJwR20fsl-Ksgv4qpptrcQezk6A2_i4Kr18Ks,11451
|
|
36
36
|
voiceio/recorder.py,sha256=3J42IETpTY68FHcFs4FetjxXgl7jdPbAMte5hcTxfrU,18763
|
|
37
37
|
voiceio/report.py,sha256=DKuNhCAw5rZxnGy5WXIeJBEg83dRXvMGvkY2kQn1Suc,13255
|
|
38
|
-
voiceio/retention.py,sha256=
|
|
38
|
+
voiceio/retention.py,sha256=C_oAx7X8tIUDTFjIF6GWT_qFawiZ2HKTyfPz3hbiIRY,5994
|
|
39
39
|
voiceio/service.py,sha256=I2DZBozfkBmUXmCOJ8lcHMpyFEa17hy4Sd92Za2erUs,18721
|
|
40
40
|
voiceio/spool.py,sha256=k0rdBhDsocIoMa9xpo0GVFSyJ1CUCSSTtws8Sfw_ViA,4369
|
|
41
41
|
voiceio/streaming.py,sha256=PZoyAUVDjzdZsqQy3_XXDLdbDk7GeRHXY47hLHxSKVA,27970
|
|
@@ -43,19 +43,19 @@ voiceio/suggest.py,sha256=jX4bCpnddyrteKfRBPbnUgf-Rk5145LFaSTat0_Ll2E,4836
|
|
|
43
43
|
voiceio/tokens.py,sha256=y9KBDgLukUMieO576rgyBn8qEQqElra66spQwoWXDXk,6321
|
|
44
44
|
voiceio/ui.py,sha256=pwuH3zr9kMC7TovLwJwa3E3H8J5Fbt2VF4-DDTvqboQ,461
|
|
45
45
|
voiceio/vad.py,sha256=VPeefjJ0Ml5hOuRE2V6BWoBXmzawxLB7if5UP3vBKiM,6030
|
|
46
|
-
voiceio/vocab_stats.py,sha256
|
|
47
|
-
voiceio/vocabulary.py,sha256=
|
|
46
|
+
voiceio/vocab_stats.py,sha256=-mhHngHfqF4InFlAB70N7MS0_bXNEn7ZRQAB9Cze1H8,5432
|
|
47
|
+
voiceio/vocabulary.py,sha256=PhrN_A5AZu7qSrKWxse787N6hmZ0lvYaVgReEIzgr-s,11088
|
|
48
48
|
voiceio/watchdog.py,sha256=XnrpM3ULeUoJ-sMt_aNNzJSLqOuK4ocJAMHQ00knYuw,7838
|
|
49
49
|
voiceio/wordfreq.py,sha256=AxmVgpQRfm2YAYQpHCRRrBUTpa12y_ngiFNScrGr4GM,3543
|
|
50
|
-
voiceio/cli/__init__.py,sha256=
|
|
50
|
+
voiceio/cli/__init__.py,sha256=nUgKtKbcVPoOyi68co9YPyfFSiwobfA7tY9ZZdTZ33k,9919
|
|
51
51
|
voiceio/cli/configcmd.py,sha256=YF7t-LkwEYEGH4qcO86xehWVX0LvltqxjDFpMF5ljjA,2858
|
|
52
52
|
voiceio/cli/corrections.py,sha256=OBjgiOhtWlTQpQq0HLAvk5-EfKJ7NNt-hnNBHm7obEc,4247
|
|
53
|
-
voiceio/cli/doctor.py,sha256=
|
|
53
|
+
voiceio/cli/doctor.py,sha256=yEK2JfSCgWd7u1aG8MW2EMdJLzj5gLdOg2w9h6aOLn4,11524
|
|
54
54
|
voiceio/cli/history.py,sha256=7FvEEgdw8jf5XXvC7-4S7iIpcjBbn7dx4czIijg61C0,2597
|
|
55
|
-
voiceio/cli/learn.py,sha256=
|
|
55
|
+
voiceio/cli/learn.py,sha256=RtGzDgosTW0q3poHjfZ2ZHiljvWBcGxa-xD6XERSkUU,38001
|
|
56
56
|
voiceio/cli/models.py,sha256=3WFgljWKPXl706P2u3HvLZOKFQGWHMhV63kBNl_59QI,7732
|
|
57
57
|
voiceio/cli/servicecmd.py,sha256=6VpxMAPetzbqy019gHaV3wXhkZdmh2LCLixij77e_Ks,5086
|
|
58
|
-
voiceio/cli/uninstall.py,sha256=
|
|
58
|
+
voiceio/cli/uninstall.py,sha256=N1eVOir_QNq_LQ3Q8J5LSjUCxHo1YDAm00vhYZ_pWbY,9388
|
|
59
59
|
voiceio/cli/vocab.py,sha256=lxxuSukefvIHV4fFSduCQQewXY0_Bvf5sDnG4bqLWH8,4418
|
|
60
60
|
voiceio/core/__init__.py,sha256=K0b4duczohS3IrIMLp9fYhfb-GeuyQaOVH_8teYGsQM,277
|
|
61
61
|
voiceio/core/bias.py,sha256=Kxxy7UJOZbA4gYJJbJVL27-1mMaMCm8WTujDNJR9WUY,6093
|
|
@@ -63,12 +63,12 @@ voiceio/core/engine.py,sha256=7g3oXXo731Rcxem60xTWq7UXqTkKth2m_GyycUdJiUE,8665
|
|
|
63
63
|
voiceio/core/pipeline.py,sha256=p164xjnuUXlNQQoRvJVNNEahoklqNGYfwx8o7y6i8tM,7049
|
|
64
64
|
voiceio/core/decoders/__init__.py,sha256=jIzOttwCsjIPrko-rsm5hpFhAeR39hrUo2dYz-jyMjQ,3470
|
|
65
65
|
voiceio/core/decoders/base.py,sha256=D-umP8Eqk6GLg6IzTPA6Q1BomlHutU2AqsVRn4SS4XU,3787
|
|
66
|
-
voiceio/core/decoders/catalog.py,sha256=
|
|
67
|
-
voiceio/core/decoders/fetch.py,sha256=
|
|
66
|
+
voiceio/core/decoders/catalog.py,sha256=HESCH50ouwvslUGwpuq5nQV7obvmBhqFNgESiK3VAdI,6747
|
|
67
|
+
voiceio/core/decoders/fetch.py,sha256=SMnx32rQtyofNaZm0f0b6j_eFzkIaeO_lG7CImEDkDo,9172
|
|
68
68
|
voiceio/core/decoders/lanes.py,sha256=lkq7ue0Pbt-rirGd72T6_i77A6uJPD4PYzD-JPLRuWk,1452
|
|
69
69
|
voiceio/core/decoders/sherpa.py,sha256=AjvHkx8XvwdCMAjYx8oP0d0WwW2AW4bT2IpxhGjNYRA,13047
|
|
70
70
|
voiceio/core/decoders/whispercpp.py,sha256=IJvsdSrc324FuQ1JbqXu_fWUZP64JnIWX9fOxyL_oKM,3264
|
|
71
|
-
voiceio/core/decoders/faster_whisper/__init__.py,sha256=
|
|
71
|
+
voiceio/core/decoders/faster_whisper/__init__.py,sha256=UGoz5K3KY09IqsL4nBHLGGQ7x8Zj5w0YAqu5movVr6c,13448
|
|
72
72
|
voiceio/core/decoders/faster_whisper/worker.py,sha256=yKn9fzbpy2aU94Mgk2j1yM0tYXQF-fGJZDty0kYjMCs,9069
|
|
73
73
|
voiceio/data/60-voiceio-uaccess.rules,sha256=X3DvKhkevKwDzKgYaA42GmpGlWh_orr8wei3mfl_SYo,397
|
|
74
74
|
voiceio/data/__init__.py,sha256=kbyKP4Jaz3Q-rGkUPnVq5zo5d3dii254q7qIDCG4vHw,59
|
|
@@ -80,19 +80,19 @@ voiceio/hotkeys/pynput_backend.py,sha256=YHBSVsln0EDx5dPvsp_RnDSHJClcYJ6yGwzPRLI
|
|
|
80
80
|
voiceio/hotkeys/socket_backend.py,sha256=n4hHmWN1fRcTIszCSBnPLOAL4lWc9AVfH1mw1e7kL5Y,4758
|
|
81
81
|
voiceio/ibus/__init__.py,sha256=lNl3UkuetJUcYIqM0J66FEInA8l1HfHtdyra-jBnqco,3732
|
|
82
82
|
voiceio/ibus/engine.py,sha256=UT3r2ltuCXGrr6uvd4a3acfnr3tuJ_WgoQqpbzgOiQs,12642
|
|
83
|
-
voiceio/ibus/install.py,sha256=
|
|
83
|
+
voiceio/ibus/install.py,sha256=Vdxxm006UMIk27YK2eyHccT8b-TM5Dx-IbYXl9RQHv0,10921
|
|
84
84
|
voiceio/ibus/pending.py,sha256=T6Y_8oimhabahunp9RogtO-OTA5aw9d9G4T5lH1WAL4,1464
|
|
85
85
|
voiceio/ibus/session.py,sha256=wxk7w_DvknsB8QMF0u9T9_eprp8b9qXE0wAc9_DxkSs,26644
|
|
86
86
|
voiceio/ibus/textlimit.py,sha256=SJ5aSBYgMsCdg1SEjw6vJv03pLCqPcSeQjhSloa32R8,3176
|
|
87
87
|
voiceio/learn/__init__.py,sha256=Q98-C809lkMqTS0OAV1xNVtqHz9NvuekivXiHiVHBWA,750
|
|
88
|
-
voiceio/learn/augment.py,sha256=
|
|
88
|
+
voiceio/learn/augment.py,sha256=F6KpYYPKpDcFF364afeoTx4jEzpDjWLLrUt3JgxaYyI,4109
|
|
89
89
|
voiceio/learn/clean.py,sha256=1ItIfIAsqxZLZ76T4oF7kSr4Poo-z_6GEzhrlt21uMo,4922
|
|
90
|
-
voiceio/learn/evaluate.py,sha256=
|
|
91
|
-
voiceio/learn/importer.py,sha256=
|
|
90
|
+
voiceio/learn/evaluate.py,sha256=W5luvjI42OwvcxPL4x1DGHeyXdf75MnPhQjojuQz-c8,13586
|
|
91
|
+
voiceio/learn/importer.py,sha256=XL7dR8U2J_baGD3Y8qiKe0sbg5posh8CPWPcogqDFuo,3482
|
|
92
92
|
voiceio/learn/metrics.py,sha256=b2xWUzPpNpXHn6zgS1upPbEcpW3ExH9SmSLIUzPhStQ,5174
|
|
93
93
|
voiceio/learn/quiet.py,sha256=mJsJRZH0KUhkVQ-Hm95n8SiuEdKOIE16pt-YU44jXDg,7083
|
|
94
94
|
voiceio/learn/review.py,sha256=X5qs5yEf20Ao3gMhsbW3Eur62hSqy9AYlv08Pcrllxo,5572
|
|
95
|
-
voiceio/learn/store.py,sha256=
|
|
95
|
+
voiceio/learn/store.py,sha256=izXa2AmafYHuZa7yg0bqCfPQnTNHczjO2QWKcQMDuQo,12871
|
|
96
96
|
voiceio/learn/teacher.py,sha256=ZCQTklZFfgS_JywMA7lopjpAmaRsGPFnu0xIATOCobc,3778
|
|
97
97
|
voiceio/learn/train.py,sha256=ad0qk_kqjTfcl_u5UWbe7E3mVCI-35NuNt-MI69U-vg,26472
|
|
98
98
|
voiceio/models/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -103,13 +103,13 @@ voiceio/server/app.py,sha256=TCpkFrqJCqHbetbHWoSovFLFLqg8BcLiaDG_08AkPro,16598
|
|
|
103
103
|
voiceio/server/config.py,sha256=C2dMqYroZngkEUMYeEhVvqug0VS8YOrOZwzdLr6Nogs,5510
|
|
104
104
|
voiceio/server/runtime.py,sha256=rSyDdvRQ6AjqGKFA9WkyAx0u28EkBxiB_J6f4EIr0dI,12236
|
|
105
105
|
voiceio/setup/__init__.py,sha256=cXNo-LYhkoVA6pEKcnaAKEGma_A9Aiqffa3VRvV6Jm8,430
|
|
106
|
-
voiceio/setup/configfile.py,sha256=
|
|
106
|
+
voiceio/setup/configfile.py,sha256=bDJdEhYlETjyXasVkCdfYTDq63ii9Dkh_Ywv5OT-P6M,4867
|
|
107
107
|
voiceio/setup/extras.py,sha256=NGk_uAWl4GQAPwRfw_0nEPsPvma7ics9DnZqjoHgCUY,9685
|
|
108
108
|
voiceio/setup/hotkey.py,sha256=xlDp2vWzsF73wbpvPSrwaqgjtiWnv294nzjlvHy0Ets,6473
|
|
109
|
-
voiceio/setup/noninteractive.py,sha256=
|
|
109
|
+
voiceio/setup/noninteractive.py,sha256=dQ9_8Wc2CEOgjNJvFErLHpmb0aLbgwIl6WTGFhR9Uvw,10890
|
|
110
110
|
voiceio/setup/speech.py,sha256=6rNGgJyi6-Plxi998o76UbjJv1F2A_sxGOH2Xshz188,9292
|
|
111
|
-
voiceio/setup/steps.py,sha256=
|
|
112
|
-
voiceio/setup/system.py,sha256=
|
|
111
|
+
voiceio/setup/steps.py,sha256=Q6nZPxUesFWyHfDSQzL4JNKoIHc5S6W7YN-fGTNCOQs,28610
|
|
112
|
+
voiceio/setup/system.py,sha256=v6NniMk89lB5y55WCbn73ScQAnskkisa3215VSFZf2k,6657
|
|
113
113
|
voiceio/setup/ui.py,sha256=h1gmerT_8EfWftSONUn5K5Ri19elNTRP2lwFAuxsGPc,13401
|
|
114
114
|
voiceio/sounds/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
115
115
|
voiceio/sounds/alert.wav,sha256=raqr2ZVADP49Uv9VUJM7E1itMq0uOp-o5WTyIrGy7gk,38852
|
|
@@ -122,7 +122,7 @@ voiceio/tray/_indicator.py,sha256=_IjbnzUuiZT3A5ta1RpkjovlKtxTN4CwYxmrH_kdfg8,80
|
|
|
122
122
|
voiceio/tray/_pystray.py,sha256=9SRoynT7E44aegzTueDTcBkMeHU8ftkqOJ-8JOgfJ4g,3716
|
|
123
123
|
voiceio/tts/__init__.py,sha256=96OGy6MZI1a-tLZLKnFRBv1dtRFtRSPFslXqIVtqXSw,305
|
|
124
124
|
voiceio/tts/base.py,sha256=WI7RTkgceXNbV5R_gixShdh9YG8K4sFD-_mf8TDoyeM,685
|
|
125
|
-
voiceio/tts/chain.py,sha256=
|
|
125
|
+
voiceio/tts/chain.py,sha256=IzuFw95VWm0cIPobq_7_I-Fa2U5v23QHWqMcCpb4bgo,3874
|
|
126
126
|
voiceio/tts/edge_engine.py,sha256=4mH5u2xNCwjUtyVFgFj74DTNm9NxhoRFODdKR6wt4_w,2709
|
|
127
127
|
voiceio/tts/espeak.py,sha256=wHxBrCGmzmCcjn9zTkPtmBkgPJ4OG92sOr5Ahmg3Vu4,1381
|
|
128
128
|
voiceio/tts/piper_engine.py,sha256=GWDGNF-qYvCjXsbXTeQ3hxXAr6sKNtoSH35YXy2YETQ,3727
|
|
@@ -142,8 +142,8 @@ voiceio/typers/pynput_type.py,sha256=f3w131YWJfNGd4IAcWtuKd2Gcwu3467QwGW3OBUEXNI
|
|
|
142
142
|
voiceio/typers/wtype.py,sha256=11vOAKHjMat-fITd4sUoUWwgniyVp65EbH3i4mL6Vhg,1762
|
|
143
143
|
voiceio/typers/xdotool.py,sha256=OuT_zW_z07jSAqu9Cmn_gL1mJfQsiX62ecqFRvpAarQ,1332
|
|
144
144
|
voiceio/typers/ydotool.py,sha256=oY5EXB-nI7PvxTL_5Tb3JjfvyhmLNYNnUFvkb1XUn_U,5978
|
|
145
|
-
python_voiceio-1.17.
|
|
146
|
-
python_voiceio-1.17.
|
|
147
|
-
python_voiceio-1.17.
|
|
148
|
-
python_voiceio-1.17.
|
|
149
|
-
python_voiceio-1.17.
|
|
145
|
+
python_voiceio-1.17.2.dist-info/METADATA,sha256=Vm4uegiW4U831n6-FZMdbVEZ75l-1o_ocAZY6ZkopG4,9264
|
|
146
|
+
python_voiceio-1.17.2.dist-info/WHEEL,sha256=mOdXR9C3wMVov7cSY8PY-XCzo3SmmWCHvGQr5csJoao,91
|
|
147
|
+
python_voiceio-1.17.2.dist-info/entry_points.txt,sha256=iDIDmhvQ3xeN_CWsFne1t9STZ08I25I_wp0xmde_vMs,94
|
|
148
|
+
python_voiceio-1.17.2.dist-info/top_level.txt,sha256=piwtn309lD6uexQyXdZ-efAVBJF9y6Wfr48Z-8zkNhg,8
|
|
149
|
+
python_voiceio-1.17.2.dist-info/RECORD,,
|
voiceio/__init__.py
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
__version__ = "1.17.
|
|
1
|
+
__version__ = "1.17.2"
|
voiceio/app.py
CHANGED
|
@@ -202,8 +202,11 @@ class VoiceIO:
|
|
|
202
202
|
# Create a second hotkey backend for TTS
|
|
203
203
|
self._tts_hotkey = hotkey_chain.select(platform, cfg.hotkey.backend)
|
|
204
204
|
log.info("TTS: engine=%s, hotkey=%s", self._tts_engine.name, cfg.tts.hotkey)
|
|
205
|
+
elif cfg.tts.engine == "auto":
|
|
206
|
+
# The default config: read aloud once an engine is installed.
|
|
207
|
+
log.info("TTS: no engine installed, read-aloud hotkey off")
|
|
205
208
|
else:
|
|
206
|
-
log.warning("TTS
|
|
209
|
+
log.warning("TTS: engine '%s' is configured but unavailable", cfg.tts.engine)
|
|
207
210
|
|
|
208
211
|
# Optional key that cancels a dictation (read only, never grabbed: the
|
|
209
212
|
# key also reaches the focused app). Needs a backend that sees keys.
|
|
@@ -1007,11 +1010,11 @@ class VoiceIO:
|
|
|
1007
1010
|
self._cancel_hotkey.start(self.cfg.hotkey.cancel_key, self.cancel)
|
|
1008
1011
|
|
|
1009
1012
|
def run(self) -> None:
|
|
1010
|
-
from voiceio.config import PID_PATH, LOG_DIR
|
|
1013
|
+
from voiceio.config import PID_PATH, LOG_DIR, private_dir
|
|
1011
1014
|
|
|
1012
1015
|
self._typers.redetect_at_start()
|
|
1013
1016
|
|
|
1014
|
-
LOG_DIR
|
|
1017
|
+
private_dir(LOG_DIR)
|
|
1015
1018
|
self._pid_fd = open(PID_PATH, "a") # not "w": the running daemon's PID stays
|
|
1016
1019
|
try:
|
|
1017
1020
|
from voiceio.pidlock import lock_pid_file
|
voiceio/cli/__init__.py
CHANGED
|
@@ -112,9 +112,9 @@ def _cmd_run(args: argparse.Namespace) -> None:
|
|
|
112
112
|
console.setLevel(getattr(logging, cfg.daemon.log_level))
|
|
113
113
|
|
|
114
114
|
# File: always log DEBUG to rotating file
|
|
115
|
-
from voiceio.config import LOG_DIR, LOG_PATH
|
|
115
|
+
from voiceio.config import LOG_DIR, LOG_PATH, private_dir
|
|
116
116
|
from logging.handlers import RotatingFileHandler
|
|
117
|
-
LOG_DIR
|
|
117
|
+
private_dir(LOG_DIR)
|
|
118
118
|
file_handler = RotatingFileHandler(
|
|
119
119
|
str(LOG_PATH), maxBytes=2_000_000, backupCount=2,
|
|
120
120
|
)
|
|
@@ -212,8 +212,8 @@ def _entry_point() -> None:
|
|
|
212
212
|
import traceback
|
|
213
213
|
tb = traceback.format_exc()
|
|
214
214
|
try:
|
|
215
|
-
from voiceio.config import LOG_DIR
|
|
216
|
-
LOG_DIR
|
|
215
|
+
from voiceio.config import LOG_DIR, private_dir
|
|
216
|
+
private_dir(LOG_DIR)
|
|
217
217
|
with open(LOG_DIR / "crash.log", "a", encoding="utf-8") as f:
|
|
218
218
|
f.write(f"\n===== {datetime.datetime.now().isoformat()} =====\n"
|
|
219
219
|
f"argv: {sys.argv}\n{tb}")
|
voiceio/cli/doctor.py
CHANGED
|
@@ -42,6 +42,35 @@ def _confirm_privileged(description: str, command_str: str) -> bool:
|
|
|
42
42
|
return answer in ("y", "yes")
|
|
43
43
|
|
|
44
44
|
|
|
45
|
+
def _run_privileged(description: str, argv: list[str], timeout: float,
|
|
46
|
+
cmd_str: str | None = None) -> bool | None:
|
|
47
|
+
"""Ask first, then run a root command: sudo with a terminal, else pkexec
|
|
48
|
+
(see platform.privileged_argv), else print it for the user to run.
|
|
49
|
+
|
|
50
|
+
Returns True when it ran, False when it failed or could not run, None
|
|
51
|
+
when the user declined. Raises nothing.
|
|
52
|
+
"""
|
|
53
|
+
import shlex
|
|
54
|
+
import subprocess
|
|
55
|
+
|
|
56
|
+
from voiceio import platform as plat
|
|
57
|
+
cmd_str = cmd_str or shlex.join(argv)
|
|
58
|
+
if not _confirm_privileged(description, cmd_str):
|
|
59
|
+
return None
|
|
60
|
+
run_argv = plat.privileged_argv(argv)
|
|
61
|
+
if run_argv is None:
|
|
62
|
+
print(" No terminal for sudo to ask your password, and no pkexec. Run it yourself:")
|
|
63
|
+
print(f" {cmd_str}")
|
|
64
|
+
return False
|
|
65
|
+
try:
|
|
66
|
+
subprocess.run(run_argv, check=True, timeout=timeout)
|
|
67
|
+
except (subprocess.CalledProcessError, subprocess.TimeoutExpired, FileNotFoundError) as e:
|
|
68
|
+
print(f" Failed: {e} — run the command above manually.")
|
|
69
|
+
return False
|
|
70
|
+
print(" Done.")
|
|
71
|
+
return True
|
|
72
|
+
|
|
73
|
+
|
|
45
74
|
def _cmd_doctor(args: argparse.Namespace) -> None:
|
|
46
75
|
"""Run diagnostic health check, offer to fix issues."""
|
|
47
76
|
if not sys.platform.startswith("linux"):
|
|
@@ -96,12 +125,17 @@ def _cmd_doctor(args: argparse.Namespace) -> None:
|
|
|
96
125
|
import subprocess
|
|
97
126
|
|
|
98
127
|
if missing_deps and dep_cmd:
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
print(f"
|
|
128
|
+
if dep_cmd.startswith("sudo "):
|
|
129
|
+
if _run_privileged("Install system packages", dep_cmd.split(), 600,
|
|
130
|
+
cmd_str=dep_cmd) is None:
|
|
131
|
+
print(" Skipped system packages (declined).")
|
|
132
|
+
else:
|
|
133
|
+
print(f" Fixing system packages: {dep_cmd}")
|
|
134
|
+
try:
|
|
135
|
+
subprocess.run(dep_cmd.split(), check=True, timeout=600)
|
|
136
|
+
print(" Done.")
|
|
137
|
+
except (subprocess.CalledProcessError, subprocess.TimeoutExpired, FileNotFoundError) as e:
|
|
138
|
+
print(f" Failed: {e} — run the command above manually.")
|
|
105
139
|
|
|
106
140
|
fixed_any = False
|
|
107
141
|
|
|
@@ -114,11 +148,12 @@ def _cmd_doctor(args: argparse.Namespace) -> None:
|
|
|
114
148
|
if not b.ok and b.fix_cmd:
|
|
115
149
|
cmd_str = " ".join(b.fix_cmd)
|
|
116
150
|
if _is_privileged_cmd(b.fix_cmd):
|
|
117
|
-
|
|
151
|
+
ran = _run_privileged(f"Fix {b.name}", b.fix_cmd, 120, cmd_str=cmd_str)
|
|
152
|
+
if ran is None:
|
|
118
153
|
print(f" Skipped {b.name} (declined).")
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
154
|
+
fixed_any = fixed_any or bool(ran)
|
|
155
|
+
continue
|
|
156
|
+
print(f" Fixing {b.name}: {cmd_str}")
|
|
122
157
|
try:
|
|
123
158
|
subprocess.run(b.fix_cmd, check=True, timeout=30)
|
|
124
159
|
print(" Done.")
|
voiceio/cli/learn.py
CHANGED
|
@@ -536,7 +536,8 @@ def cmd_maintain(args: argparse.Namespace) -> None:
|
|
|
536
536
|
from voiceio.learn import quiet
|
|
537
537
|
learn_cfg = _maintain_settings(args)
|
|
538
538
|
if getattr(args, "when_idle", False) and os.environ.get(quiet.WORKER_ENV) != "1":
|
|
539
|
-
|
|
539
|
+
from voiceio.config import private_dir
|
|
540
|
+
private_dir(store.learn_dir())
|
|
540
541
|
code = quiet.run_while_away(
|
|
541
542
|
quiet.worker_argv(), max_load=learn_cfg.max_load,
|
|
542
543
|
away_minutes=learn_cfg.away_minutes, wait_hours=learn_cfg.wait_hours,
|
voiceio/cli/uninstall.py
CHANGED
|
@@ -165,8 +165,13 @@ def _cmd_uninstall() -> None:
|
|
|
165
165
|
continue
|
|
166
166
|
cmd = f"sudo rm {rule_path}"
|
|
167
167
|
if _confirm_privileged(f"Remove the voiceio {what} udev rule", cmd):
|
|
168
|
+
from voiceio.platform import privileged_argv
|
|
169
|
+
argv = privileged_argv(["sudo", "rm", rule_path])
|
|
170
|
+
if argv is None:
|
|
171
|
+
print(f" No terminal for sudo to ask your password. Run manually: {cmd}")
|
|
172
|
+
continue
|
|
168
173
|
try:
|
|
169
|
-
subprocess.run(
|
|
174
|
+
subprocess.run(argv, timeout=120)
|
|
170
175
|
removed.append(rule_path)
|
|
171
176
|
except (FileNotFoundError, subprocess.TimeoutExpired):
|
|
172
177
|
print(f" Failed. Run manually: {cmd}")
|
voiceio/config.py
CHANGED
|
@@ -247,6 +247,9 @@ class PostCorrectConfig:
|
|
|
247
247
|
|
|
248
248
|
@dataclass
|
|
249
249
|
class TTSConfig:
|
|
250
|
+
# With engine = "auto" this means "read aloud once an engine is
|
|
251
|
+
# installed": no engine is a quiet no-op (doctor says "off"), never a
|
|
252
|
+
# warning. Naming an engine that is missing does warn.
|
|
250
253
|
enabled: bool = True
|
|
251
254
|
engine: str = "auto" # "auto" | "piper" | "supertonic" | "espeak" | "edge-tts"
|
|
252
255
|
hotkey: str = "ctrl+alt+s" # "s" for speak
|
|
@@ -452,9 +455,17 @@ def _content_files() -> list[Path]:
|
|
|
452
455
|
]
|
|
453
456
|
|
|
454
457
|
|
|
458
|
+
def data_dir() -> Path:
|
|
459
|
+
"""$XDG_DATA_HOME/voiceio: the learning corpus and the IBus launcher.
|
|
460
|
+
Read at call time, like the learn paths built on it."""
|
|
461
|
+
base = os.environ.get("XDG_DATA_HOME", "")
|
|
462
|
+
root = Path(base) if os.path.isabs(base) else Path.home() / ".local" / "share"
|
|
463
|
+
return root / "voiceio"
|
|
464
|
+
|
|
465
|
+
|
|
455
466
|
def _content_dirs() -> list[Path]:
|
|
456
467
|
"""Directories that hold user content (0700)."""
|
|
457
|
-
return [CONFIG_DIR, LOG_DIR, RECORDINGS_DIR]
|
|
468
|
+
return [CONFIG_DIR, LOG_DIR, RECORDINGS_DIR, data_dir(), data_dir() / "learn"]
|
|
458
469
|
|
|
459
470
|
|
|
460
471
|
def _chmod(path: Path, mode: int) -> None:
|
|
@@ -467,6 +478,33 @@ def _chmod(path: Path, mode: int) -> None:
|
|
|
467
478
|
log.debug("Could not chmod %s", path, exc_info=True)
|
|
468
479
|
|
|
469
480
|
|
|
481
|
+
def private_dir(path: Path) -> Path:
|
|
482
|
+
"""Create `path` (and any missing parents) as 0700 and return it.
|
|
483
|
+
|
|
484
|
+
`mkdir(parents=True)` gives every new directory the umask's mode, which
|
|
485
|
+
is 0775 under the 002 umask of user-private-group distros (Debian,
|
|
486
|
+
Fedora): the state dir was group-readable until the daemon's startup
|
|
487
|
+
hardening caught up, and never fixed when only setup, doctor or the CLI
|
|
488
|
+
ran. Missing parents (e.g. ~/.local/state) get 0700 too, as the XDG
|
|
489
|
+
base directory spec asks. Existing parents are left alone.
|
|
490
|
+
"""
|
|
491
|
+
missing: list[Path] = []
|
|
492
|
+
p = path
|
|
493
|
+
while not p.exists() and p.parent != p:
|
|
494
|
+
missing.append(p)
|
|
495
|
+
p = p.parent
|
|
496
|
+
for d in reversed(missing):
|
|
497
|
+
try:
|
|
498
|
+
d.mkdir(mode=_SECURE_DIR)
|
|
499
|
+
except FileExistsError:
|
|
500
|
+
pass
|
|
501
|
+
_chmod(d, _SECURE_DIR) # mkdir's mode is masked by the umask
|
|
502
|
+
if (not missing and sys.platform != "win32" and path.is_dir()
|
|
503
|
+
and stat.S_IMODE(path.stat().st_mode) != _SECURE_DIR):
|
|
504
|
+
_chmod(path, _SECURE_DIR)
|
|
505
|
+
return path
|
|
506
|
+
|
|
507
|
+
|
|
470
508
|
def secure_write(path: Path, text: str, *, encoding: str = "utf-8") -> None:
|
|
471
509
|
"""Write text to a file guaranteed to be 0600 with a 0700 parent dir.
|
|
472
510
|
|
|
@@ -474,8 +512,7 @@ def secure_write(path: Path, text: str, *, encoding: str = "utf-8") -> None:
|
|
|
474
512
|
over the target, so there is no world-readable window and a crash never
|
|
475
513
|
leaves a half-written file.
|
|
476
514
|
"""
|
|
477
|
-
path.parent
|
|
478
|
-
_chmod(path.parent, _SECURE_DIR)
|
|
515
|
+
private_dir(path.parent)
|
|
479
516
|
tmp = path.with_name(f".{path.name}.tmp")
|
|
480
517
|
fd = os.open(tmp, os.O_WRONLY | os.O_CREAT | os.O_TRUNC, _SECURE_FILE)
|
|
481
518
|
try:
|
voiceio/core/decoders/catalog.py
CHANGED
|
@@ -35,10 +35,25 @@ class ModelInfo:
|
|
|
35
35
|
experimental: bool = False
|
|
36
36
|
# Models voiceio downloads itself (sherpa-onnx): a release tarball, its
|
|
37
37
|
# sha256, and its size. faster-whisper models come from the HF cache.
|
|
38
|
+
# `sha256` may be a tuple of known-good digests: upstream sometimes
|
|
39
|
+
# re-uploads an archive, and old caches and mirrors still hold the old one.
|
|
40
|
+
# Every digest is pinned by hand; never trust a live one from GitHub.
|
|
38
41
|
url: str = ""
|
|
39
|
-
sha256: str = ""
|
|
42
|
+
sha256: str | tuple[str, ...] = ""
|
|
40
43
|
size_mb: int = 0
|
|
41
44
|
|
|
45
|
+
@property
|
|
46
|
+
def sha256s(self) -> tuple[str, ...]:
|
|
47
|
+
"""Every known-good sha256 of the archive (empty when there is none)."""
|
|
48
|
+
return pins(self.sha256)
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
def pins(sha256: str | tuple[str, ...]) -> tuple[str, ...]:
|
|
52
|
+
"""A pin (one digest or a tuple of them) as a tuple, lower-cased."""
|
|
53
|
+
if isinstance(sha256, str):
|
|
54
|
+
sha256 = (sha256,) if sha256 else ()
|
|
55
|
+
return tuple(h.lower() for h in sha256)
|
|
56
|
+
|
|
42
57
|
|
|
43
58
|
_SHERPA_RELEASES = "https://github.com/k2-fsa/sherpa-onnx/releases/download/asr-models"
|
|
44
59
|
|
|
@@ -51,14 +66,18 @@ CATALOG: tuple[ModelInfo, ...] = (
|
|
|
51
66
|
notes="default when sherpa-onnx has the NeMo TDT beam-search fix: text ~0.7s after you stop "
|
|
52
67
|
"talking vs ~4.4s with Whisper, every proper noun of your vocabulary as a hotword",
|
|
53
68
|
url=f"{_SHERPA_RELEASES}/sherpa-onnx-nemo-parakeet-tdt-0.6b-v2-int8.tar.bz2",
|
|
54
|
-
|
|
69
|
+
# Re-uploaded upstream 2026-11-07 (Hugo0/voiceio#9); the old one stays valid.
|
|
70
|
+
sha256=("6fc4426b54aa549a0019b8a75b8dea59164e71790a37ac56a045ad57f915f714",
|
|
71
|
+
"157c157bc51155e03e37d2466522a3a737dd9c72bb25f36eb18912964161e1ad"),
|
|
55
72
|
size_mb=482),
|
|
56
73
|
ModelInfo(PARAKEET_V3, "sherpa-onnx", "600M", "CC-BY-4.0", BiasMode.UNBOUNDED,
|
|
57
74
|
languages=",".join(sorted(PARAKEET_V3_LANGUAGES)),
|
|
58
75
|
notes="the default for the other 24 European languages it covers; v2 stays the "
|
|
59
76
|
"English default (trained on English only, lower English WER)",
|
|
60
77
|
url=f"{_SHERPA_RELEASES}/sherpa-onnx-nemo-parakeet-tdt-0.6b-v3-int8.tar.bz2",
|
|
61
|
-
|
|
78
|
+
# Re-uploaded upstream 2026-11-07 (Hugo0/voiceio#9); the old one stays valid.
|
|
79
|
+
sha256=("1495e91b59d7fc53ddca91f3431758ec99f8fa253fdb0e1e851be0f72b14b0f9",
|
|
80
|
+
"5793d0fd397c5778d2cf2126994d58e9d56b1be7c04d13c7a15bb1b4eafb16bf"),
|
|
62
81
|
size_mb=487),
|
|
63
82
|
ModelInfo("small", "faster-whisper", "244M", "MIT", BiasMode.HOTWORDS | BiasMode.PROMPT,
|
|
64
83
|
notes="~5x realtime on a laptop CPU; hotwords cap ~35 terms; "
|
|
@@ -117,8 +117,8 @@ class Transcriber:
|
|
|
117
117
|
"cpu_threads": self._cfg.cpu_threads,
|
|
118
118
|
"language": language,
|
|
119
119
|
})
|
|
120
|
-
from voiceio.config import LOG_DIR
|
|
121
|
-
LOG_DIR
|
|
120
|
+
from voiceio.config import LOG_DIR, private_dir
|
|
121
|
+
private_dir(LOG_DIR)
|
|
122
122
|
self._stderr_path = LOG_DIR / "worker.log"
|
|
123
123
|
# Append (rotating at 1 MB) so a crash's stack dump survives the restart.
|
|
124
124
|
if self._stderr_path.exists() and self._stderr_path.stat().st_size > 1_000_000:
|
voiceio/core/decoders/fetch.py
CHANGED
|
@@ -16,7 +16,7 @@ import urllib.request
|
|
|
16
16
|
from collections.abc import Callable
|
|
17
17
|
from pathlib import Path
|
|
18
18
|
|
|
19
|
-
from voiceio.core.decoders.catalog import ModelInfo, info
|
|
19
|
+
from voiceio.core.decoders.catalog import ModelInfo, info, pins
|
|
20
20
|
|
|
21
21
|
log = logging.getLogger(__name__)
|
|
22
22
|
|
|
@@ -72,15 +72,22 @@ def download(name: str, *, progress: Callable[[int, int], None] | None = None) -
|
|
|
72
72
|
what="encoder/decoder/joiner/tokens.txt", progress=progress)
|
|
73
73
|
|
|
74
74
|
|
|
75
|
-
|
|
75
|
+
ISSUES = "https://github.com/Hugo0/voiceio/issues"
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
def download_archive(name: str, url: str, sha256: str | tuple[str, ...], size_mb: int,
|
|
76
79
|
complete: Callable[[Path], bool], *, what: str,
|
|
77
80
|
progress: Callable[[int, int], None] | None = None) -> Path:
|
|
78
81
|
"""Fetch, verify and unpack a sherpa-onnx release tarball as
|
|
79
|
-
`models_dir()/name`. `
|
|
80
|
-
|
|
82
|
+
`models_dir()/name`. `sha256` is one known-good digest or a tuple of
|
|
83
|
+
them; the archive must match one. `complete` says whether a directory
|
|
84
|
+
holds the whole model (`what` names its files for the error)."""
|
|
81
85
|
dest = model_path(name)
|
|
82
86
|
if complete(dest):
|
|
83
87
|
return dest
|
|
88
|
+
known = pins(sha256)
|
|
89
|
+
if not known:
|
|
90
|
+
raise OSError(f"{name}: no pinned sha256 — not downloading")
|
|
84
91
|
root = models_dir()
|
|
85
92
|
root.mkdir(parents=True, exist_ok=True)
|
|
86
93
|
part = root / f".{name}.{os.getpid()}.part"
|
|
@@ -98,9 +105,11 @@ def download_archive(name: str, url: str, sha256: str, size_mb: int,
|
|
|
98
105
|
done += len(block)
|
|
99
106
|
if progress is not None:
|
|
100
107
|
progress(done, total)
|
|
101
|
-
if digest.hexdigest()
|
|
108
|
+
if digest.hexdigest() not in known:
|
|
109
|
+
want = " or ".join(f"{h[:12]}…" for h in known)
|
|
102
110
|
raise OSError(f"{name}: checksum mismatch (got {digest.hexdigest()[:12]}…, "
|
|
103
|
-
f"want {
|
|
111
|
+
f"want {want}) — download again; if it keeps failing, upstream "
|
|
112
|
+
f"may have re-uploaded the archive: report it at {ISSUES}")
|
|
104
113
|
_unpack(part, staging)
|
|
105
114
|
if not complete(staging):
|
|
106
115
|
raise OSError(f"{name}: the archive has no {what}")
|
voiceio/corrections.py
CHANGED
|
@@ -7,6 +7,7 @@ import re
|
|
|
7
7
|
import threading
|
|
8
8
|
from pathlib import Path
|
|
9
9
|
|
|
10
|
+
from voiceio import config
|
|
10
11
|
from voiceio.config import CORRECTIONS_PATH, FLAGGED_PATH
|
|
11
12
|
|
|
12
13
|
log = logging.getLogger(__name__)
|
|
@@ -59,7 +60,7 @@ class CorrectionDict:
|
|
|
59
60
|
"""Write corrections.json atomically."""
|
|
60
61
|
with self._lock:
|
|
61
62
|
data = {orig: right for orig, right in self._corrections.values()}
|
|
62
|
-
self._path.parent
|
|
63
|
+
config.private_dir(self._path.parent)
|
|
63
64
|
tmp = self._path.with_suffix(".tmp")
|
|
64
65
|
tmp.write_text(json.dumps(data, indent=2, ensure_ascii=False) + "\n",
|
|
65
66
|
encoding="utf-8")
|
|
@@ -110,7 +111,7 @@ class CorrectionDict:
|
|
|
110
111
|
return
|
|
111
112
|
word = word.strip()
|
|
112
113
|
try:
|
|
113
|
-
self._flagged_path.parent
|
|
114
|
+
config.private_dir(self._flagged_path.parent)
|
|
114
115
|
with open(self._flagged_path, "a", encoding="utf-8") as f:
|
|
115
116
|
f.write(word + "\n")
|
|
116
117
|
log.info("Flagged word: '%s'", word)
|
voiceio/errorlog.py
CHANGED
|
@@ -156,7 +156,8 @@ class RepeatedErrorNotifier(logging.Handler):
|
|
|
156
156
|
fire = len(seen[key]) >= REPEATS and state.get("notified") != today
|
|
157
157
|
if fire:
|
|
158
158
|
state["notified"] = today
|
|
159
|
-
|
|
159
|
+
from voiceio.config import private_dir
|
|
160
|
+
private_dir(self._path.parent)
|
|
160
161
|
self._path.write_text(json.dumps(state))
|
|
161
162
|
if fire:
|
|
162
163
|
notify = self._notify
|
voiceio/health.py
CHANGED
|
@@ -222,17 +222,7 @@ def _check_features() -> FeatureGroups:
|
|
|
222
222
|
else:
|
|
223
223
|
groups.processing["LLM cleanup"] = "off (enable in config or re-run 'voiceio setup')"
|
|
224
224
|
|
|
225
|
-
|
|
226
|
-
if cfg.tts.enabled:
|
|
227
|
-
from voiceio.tts import probe_all as tts_probe_all
|
|
228
|
-
results = tts_probe_all(cfg.tts)
|
|
229
|
-
active = next((name for name, probe in results if probe.ok), None)
|
|
230
|
-
if active:
|
|
231
|
-
groups.processing["Text-to-speech"] = f"on ({active})"
|
|
232
|
-
else:
|
|
233
|
-
groups.processing["Text-to-speech"] = "enabled but no engine available"
|
|
234
|
-
else:
|
|
235
|
-
groups.processing["Text-to-speech"] = "off"
|
|
225
|
+
groups.processing["Text-to-speech"] = _tts_status(cfg.tts)
|
|
236
226
|
|
|
237
227
|
# ── Accuracy (learning stack) ──
|
|
238
228
|
|
|
@@ -301,6 +291,30 @@ def _check_features() -> FeatureGroups:
|
|
|
301
291
|
return groups
|
|
302
292
|
|
|
303
293
|
|
|
294
|
+
TTS_INSTALL_HINT = "pip install 'python-voiceio[tts]' or install espeak-ng"
|
|
295
|
+
|
|
296
|
+
|
|
297
|
+
def _tts_status(tts_cfg) -> str:
|
|
298
|
+
"""Doctor's Text-to-speech line.
|
|
299
|
+
|
|
300
|
+
`enabled = true` with `engine = "auto"` (the default) means "read aloud
|
|
301
|
+
when an engine is installed", so no engine there is a quiet "off", not a
|
|
302
|
+
warning: the user never asked for a particular engine. Naming an engine
|
|
303
|
+
that is missing is a real misconfiguration and still warns.
|
|
304
|
+
"""
|
|
305
|
+
if not tts_cfg.enabled:
|
|
306
|
+
return "off"
|
|
307
|
+
from voiceio.tts import probe_all as tts_probe_all
|
|
308
|
+
results = tts_probe_all(tts_cfg)
|
|
309
|
+
active = next((name for name, probe in results if probe.ok), None)
|
|
310
|
+
if active:
|
|
311
|
+
return f"on ({active})"
|
|
312
|
+
if tts_cfg.engine == "auto":
|
|
313
|
+
return f"off (no engine installed: {TTS_INSTALL_HINT})"
|
|
314
|
+
reason = next((probe.reason for _, probe in results if probe.reason), "")
|
|
315
|
+
return f"enabled but {tts_cfg.engine} unavailable" + (f" ({reason})" if reason else "")
|
|
316
|
+
|
|
317
|
+
|
|
304
318
|
def _decoder_status(cfg) -> dict[str, str]:
|
|
305
319
|
"""For a sherpa-onnx model: whether it can be biased, and why not. For
|
|
306
320
|
Whisper: whether Parakeet would do better here."""
|
voiceio/hints.py
CHANGED
|
@@ -52,7 +52,8 @@ def _load_state() -> dict:
|
|
|
52
52
|
|
|
53
53
|
def _save_state(state: dict) -> None:
|
|
54
54
|
try:
|
|
55
|
-
|
|
55
|
+
from voiceio.config import private_dir
|
|
56
|
+
private_dir(_HINTS_PATH.parent)
|
|
56
57
|
_HINTS_PATH.write_text(json.dumps(state))
|
|
57
58
|
except Exception:
|
|
58
59
|
log.debug("Failed to save hints state", exc_info=True)
|
voiceio/history.py
CHANGED
|
@@ -51,8 +51,7 @@ def append(
|
|
|
51
51
|
return
|
|
52
52
|
p = path or HISTORY_PATH
|
|
53
53
|
try:
|
|
54
|
-
p.parent
|
|
55
|
-
config._chmod(p.parent, config._SECURE_DIR)
|
|
54
|
+
config.private_dir(p.parent)
|
|
56
55
|
from voiceio import __version__
|
|
57
56
|
# The version lets `doctor` judge the current release on its own
|
|
58
57
|
# numbers instead of months of older ones.
|
voiceio/ibus/install.py
CHANGED
|
@@ -95,7 +95,8 @@ def refresh_stale_launcher() -> bool:
|
|
|
95
95
|
|
|
96
96
|
|
|
97
97
|
def _write_launcher() -> None:
|
|
98
|
-
|
|
98
|
+
from voiceio.config import private_dir
|
|
99
|
+
private_dir(LAUNCHER_DIR)
|
|
99
100
|
LAUNCHER_PATH.write_text(_launcher_script())
|
|
100
101
|
LAUNCHER_PATH.chmod(LAUNCHER_PATH.stat().st_mode | stat.S_IEXEC | stat.S_IXGRP | stat.S_IXOTH)
|
|
101
102
|
|
voiceio/learn/augment.py
CHANGED
|
@@ -21,6 +21,7 @@ from pathlib import Path
|
|
|
21
21
|
|
|
22
22
|
import numpy as np
|
|
23
23
|
|
|
24
|
+
from voiceio import config
|
|
24
25
|
from voiceio.learn.store import learn_dir
|
|
25
26
|
|
|
26
27
|
log = logging.getLogger(__name__)
|
|
@@ -62,8 +63,7 @@ def synthesize(terms: Iterable[str], tts, *, per_term: int = 8, voices: tuple[st
|
|
|
62
63
|
progress: Callable[[str, int], None] | None = None) -> int:
|
|
63
64
|
"""Write synthetic clips + manifest rows for each term. Returns clip count."""
|
|
64
65
|
rng = random.Random(seed)
|
|
65
|
-
out = augment_dir()
|
|
66
|
-
out.mkdir(parents=True, exist_ok=True)
|
|
66
|
+
out = config.private_dir(augment_dir())
|
|
67
67
|
manifest = out / "manifest.jsonl"
|
|
68
68
|
n = 0
|
|
69
69
|
with open(manifest, "a", encoding="utf-8") as mf:
|
voiceio/learn/evaluate.py
CHANGED
|
@@ -28,6 +28,7 @@ from pathlib import Path
|
|
|
28
28
|
|
|
29
29
|
from voiceio.core.decoders.base import Bias, Decoder
|
|
30
30
|
from voiceio.learn import metrics
|
|
31
|
+
from voiceio import config
|
|
31
32
|
from voiceio.learn.store import learn_dir, read_split
|
|
32
33
|
from voiceio.learn.teacher import load_wav
|
|
33
34
|
|
|
@@ -146,8 +147,7 @@ def _replay(decoder: Decoder, audio, bias: Bias, freeze_secs: float,
|
|
|
146
147
|
|
|
147
148
|
|
|
148
149
|
def save(result: EvalResult) -> Path:
|
|
149
|
-
runs = learn_dir() / "runs"
|
|
150
|
-
runs.mkdir(parents=True, exist_ok=True)
|
|
150
|
+
runs = config.private_dir(learn_dir() / "runs")
|
|
151
151
|
path = runs / f"eval-{time.strftime('%Y%m%d-%H%M%S')}.json"
|
|
152
152
|
data = asdict(result) | {"wer": result.wer, "term_recall": result.term_recall,
|
|
153
153
|
"rtf": result.rtf, "metrics": metrics.METRICS_VERSION}
|
voiceio/learn/importer.py
CHANGED
|
@@ -70,9 +70,8 @@ def import_dir(src: Path, source: str) -> ImportReport:
|
|
|
70
70
|
if not shutil.which("ffmpeg"):
|
|
71
71
|
raise RuntimeError("ffmpeg is required to import audio")
|
|
72
72
|
out_dir = learn_dir() / IMPORT_PREFIX / source
|
|
73
|
-
out_dir.mkdir(parents=True, exist_ok=True)
|
|
74
73
|
for d in (learn_dir(), out_dir.parent, out_dir):
|
|
75
|
-
config.
|
|
74
|
+
config.private_dir(d)
|
|
76
75
|
have = {row["audio"] for row in _rows(imports_path()) if "audio" in row}
|
|
77
76
|
report = ImportReport()
|
|
78
77
|
files = sorted(p for p in Path(src).expanduser().rglob("*")
|
voiceio/learn/store.py
CHANGED
|
@@ -32,9 +32,7 @@ SPLITS = ("train", "dev", "test")
|
|
|
32
32
|
|
|
33
33
|
|
|
34
34
|
def learn_dir() -> Path:
|
|
35
|
-
|
|
36
|
-
root = Path(base) if os.path.isabs(base) else Path.home() / ".local" / "share"
|
|
37
|
-
return root / "voiceio" / "learn"
|
|
35
|
+
return config.data_dir() / "learn"
|
|
38
36
|
|
|
39
37
|
|
|
40
38
|
def labels_path() -> Path:
|
|
@@ -174,8 +172,7 @@ def add_label(audio: str, segments: list[Segment] | tuple[Segment, ...],
|
|
|
174
172
|
source: str) -> Label:
|
|
175
173
|
lab = Label(audio=audio, segments=tuple(segments), source=source, ts=time.time())
|
|
176
174
|
path = labels_path()
|
|
177
|
-
path.parent
|
|
178
|
-
config._chmod(path.parent, config._SECURE_DIR)
|
|
175
|
+
config.private_dir(path.parent)
|
|
179
176
|
new = not path.exists()
|
|
180
177
|
with open(path, "a", encoding="utf-8") as f:
|
|
181
178
|
f.write(lab.to_json() + "\n")
|
|
@@ -293,8 +290,7 @@ def build_dataset(*, reviewed_only: bool = False) -> Path:
|
|
|
293
290
|
for p in group if p.text.strip()]
|
|
294
291
|
rows[split].append({**base, "start": w.start, "end": w.end, "text": w.text,
|
|
295
292
|
"parts": parts})
|
|
296
|
-
root = learn_dir() / "datasets"
|
|
297
|
-
root.mkdir(parents=True, exist_ok=True)
|
|
293
|
+
root = config.private_dir(learn_dir() / "datasets")
|
|
298
294
|
existing = sorted(p.name for p in root.glob("v[0-9]*"))
|
|
299
295
|
version = f"v{int(existing[-1][1:]) + 1:04d}" if existing else "v0001"
|
|
300
296
|
# Built aside and moved into place whole: a build that is stopped halfway
|
voiceio/llm.py
CHANGED
|
@@ -87,12 +87,14 @@ def install_ollama(*, cpu_only: bool | None = None) -> bool:
|
|
|
87
87
|
try:
|
|
88
88
|
if cpu_only:
|
|
89
89
|
# Direct binary download (~60 MB) — skip GPU libraries
|
|
90
|
-
|
|
90
|
+
from voiceio.platform import privileged_argv
|
|
91
|
+
argv = privileged_argv(
|
|
91
92
|
["sudo", "bash", "-c",
|
|
92
93
|
"curl -fL https://ollama.com/download/ollama-linux-amd64 "
|
|
93
|
-
"-o /usr/local/bin/ollama && chmod +x /usr/local/bin/ollama"]
|
|
94
|
-
|
|
95
|
-
|
|
94
|
+
"-o /usr/local/bin/ollama && chmod +x /usr/local/bin/ollama"])
|
|
95
|
+
if argv is None: # no terminal for sudo and no pkexec
|
|
96
|
+
return False
|
|
97
|
+
result = subprocess.run(argv, timeout=120)
|
|
96
98
|
else:
|
|
97
99
|
# Full install with GPU libraries (~800 MB)
|
|
98
100
|
result = subprocess.run(
|
voiceio/platform.py
CHANGED
|
@@ -243,6 +243,71 @@ _INSTALL_CMDS: dict[str, str] = {
|
|
|
243
243
|
"brew": "brew install",
|
|
244
244
|
}
|
|
245
245
|
|
|
246
|
+
# A package manager asks "continue? [Y/n]" on stdin; with no terminal to
|
|
247
|
+
# answer it the install aborts. Only added when the caller has no terminal and
|
|
248
|
+
# the user already said yes (setup --install-deps, a doctor --fix prompt).
|
|
249
|
+
_ASSUME_YES: dict[str, str] = {
|
|
250
|
+
"apt": "-y", "apt-get": "-y", "dnf": "-y", "zypper": "-y",
|
|
251
|
+
"pacman": "--noconfirm", "xbps-install": "-y",
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
|
|
255
|
+
def _has_tty() -> bool:
|
|
256
|
+
"""Can sudo ask for a password here? It reads /dev/tty, not stdin."""
|
|
257
|
+
try:
|
|
258
|
+
fd = os.open("/dev/tty", os.O_RDWR)
|
|
259
|
+
except OSError:
|
|
260
|
+
return False
|
|
261
|
+
os.close(fd)
|
|
262
|
+
return True
|
|
263
|
+
|
|
264
|
+
|
|
265
|
+
def _sudo_without_password() -> bool:
|
|
266
|
+
"""Cached credentials or NOPASSWD: sudo works with no terminal."""
|
|
267
|
+
import subprocess
|
|
268
|
+
try:
|
|
269
|
+
return subprocess.run(["sudo", "-n", "true"], capture_output=True,
|
|
270
|
+
timeout=5).returncode == 0
|
|
271
|
+
except (OSError, subprocess.TimeoutExpired):
|
|
272
|
+
return False
|
|
273
|
+
|
|
274
|
+
|
|
275
|
+
def _assume_yes(argv: list[str]) -> list[str]:
|
|
276
|
+
"""`apt install x` -> `apt install -y x` (flag after the subcommand)."""
|
|
277
|
+
flag = _ASSUME_YES.get(os.path.basename(argv[0])) if argv else None
|
|
278
|
+
if not flag or flag in argv or len(argv) < 2:
|
|
279
|
+
return argv
|
|
280
|
+
return [argv[0], argv[1], flag, *argv[2:]]
|
|
281
|
+
|
|
282
|
+
|
|
283
|
+
def privileged_argv(argv: list[str]) -> list[str] | None:
|
|
284
|
+
"""How to run a command that needs root from here, or None if it can't be.
|
|
285
|
+
|
|
286
|
+
A command needs root when it starts with sudo or is a shell script that
|
|
287
|
+
calls sudo (the udev-rule fixes). With a terminal it runs unchanged and
|
|
288
|
+
sudo asks for the password. Without one (setup driven by an agent, a
|
|
289
|
+
launcher, a GUI) sudo cannot ask: passwordless or cached sudo still works;
|
|
290
|
+
else pkexec, whose polkit agent shows the desktop's password dialog (a
|
|
291
|
+
script under pkexec runs as root, where its inner sudo needs no password);
|
|
292
|
+
else None, and the caller prints the command for the user to run.
|
|
293
|
+
Ask the user before calling this: it never asks.
|
|
294
|
+
"""
|
|
295
|
+
if not argv:
|
|
296
|
+
return argv
|
|
297
|
+
direct = argv[0] == "sudo"
|
|
298
|
+
if not direct and not any("sudo " in a for a in argv[1:]):
|
|
299
|
+
return argv
|
|
300
|
+
if _has_tty():
|
|
301
|
+
return argv
|
|
302
|
+
rest = _assume_yes(argv[1:]) if direct else argv
|
|
303
|
+
if _sudo_without_password():
|
|
304
|
+
return ["sudo", "-n", *rest] if direct else argv
|
|
305
|
+
if shutil.which("pkexec") and (os.environ.get("WAYLAND_DISPLAY")
|
|
306
|
+
or os.environ.get("DISPLAY")):
|
|
307
|
+
return ["pkexec", *rest]
|
|
308
|
+
return None
|
|
309
|
+
|
|
310
|
+
|
|
246
311
|
# Package name overrides per package manager (when they differ from apt names)
|
|
247
312
|
_PKG_NAMES: dict[str, dict[str, str]] = {
|
|
248
313
|
"dnf": {
|
voiceio/retention.py
CHANGED
|
@@ -53,8 +53,7 @@ def save_audio(audio: np.ndarray, ts: float, cfg: DataConfig) -> str | None:
|
|
|
53
53
|
name = time.strftime("%Y%m%d-%H%M%S", time.localtime(ts)) + f"-{int(ts * 1000) % 1000:03d}.wav"
|
|
54
54
|
path = RECORDINGS_DIR / name
|
|
55
55
|
try:
|
|
56
|
-
|
|
57
|
-
config._chmod(RECORDINGS_DIR, config._SECURE_DIR)
|
|
56
|
+
config.private_dir(RECORDINGS_DIR)
|
|
58
57
|
pcm = (np.clip(audio, -1.0, 1.0) * 32767).astype(np.int16)
|
|
59
58
|
with wave.open(str(path), "wb") as wf:
|
|
60
59
|
wf.setnchannels(1)
|
|
@@ -126,8 +125,7 @@ def append_jsonl(path: Path, entry: dict) -> None:
|
|
|
126
125
|
on a disk the min_free_gb floor is trying to protect.
|
|
127
126
|
"""
|
|
128
127
|
try:
|
|
129
|
-
path.parent
|
|
130
|
-
config._chmod(path.parent, config._SECURE_DIR)
|
|
128
|
+
config.private_dir(path.parent)
|
|
131
129
|
newly_created = not path.exists()
|
|
132
130
|
if not newly_created and path.stat().st_size > _JSONL_MAX_BYTES:
|
|
133
131
|
lines = path.read_text(encoding="utf-8").splitlines(keepends=True)
|
voiceio/setup/configfile.py
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"""Merge-preserving config.toml writer used by both setup paths."""
|
|
2
2
|
from __future__ import annotations
|
|
3
3
|
|
|
4
|
-
from voiceio.config import CONFIG_DIR, CONFIG_PATH
|
|
4
|
+
from voiceio.config import CONFIG_DIR, CONFIG_PATH, private_dir
|
|
5
5
|
from voiceio.ui import DIM, GREEN, RESET
|
|
6
6
|
|
|
7
7
|
|
|
@@ -84,7 +84,7 @@ def _write_config(
|
|
|
84
84
|
keys, unknown keys, and secrets (e.g. a saved API key when the user didn't
|
|
85
85
|
enter a new one) are preserved verbatim.
|
|
86
86
|
"""
|
|
87
|
-
CONFIG_DIR
|
|
87
|
+
private_dir(CONFIG_DIR)
|
|
88
88
|
from voiceio.config import _migrate_v1
|
|
89
89
|
cfg = _migrate_v1(_load_raw_config()) # e.g. [autocorrect] → [cloud]
|
|
90
90
|
|
voiceio/setup/noninteractive.py
CHANGED
|
@@ -76,9 +76,13 @@ def run_setup_noninteractive(answers: dict | None = None, *, install_deps: bool
|
|
|
76
76
|
cmd = plat.system_deps_install_cmd(missing)
|
|
77
77
|
_progress("preflight", status="missing", deps=",".join(missing), cmd=repr(cmd))
|
|
78
78
|
if install_deps or answers.get("install_system_deps"):
|
|
79
|
-
|
|
79
|
+
argv = plat.privileged_argv(cmd.split())
|
|
80
|
+
if argv is None:
|
|
81
|
+
return _fail("preflight", "no terminal for sudo to ask a password and no "
|
|
82
|
+
f"pkexec: run it yourself, then re-run setup: {cmd}", 4)
|
|
83
|
+
_progress("preflight", status="installing", cmd=repr(" ".join(argv)))
|
|
80
84
|
try:
|
|
81
|
-
rc = subprocess.run(
|
|
85
|
+
rc = subprocess.run(argv, timeout=600).returncode
|
|
82
86
|
except (FileNotFoundError, subprocess.TimeoutExpired) as e:
|
|
83
87
|
return _fail("preflight", f"installer failed: {e}", 4)
|
|
84
88
|
if rc != 0:
|
voiceio/setup/steps.py
CHANGED
|
@@ -342,7 +342,11 @@ def _select_output_backend(state: SetupState) -> None:
|
|
|
342
342
|
def _step_tts(state: SetupState) -> None:
|
|
343
343
|
_print_step(5, _TOTAL_STEPS, "Text-to-speech")
|
|
344
344
|
print(f" {DIM}Select text and press ctrl+alt+s to hear it spoken.{RESET}")
|
|
345
|
-
print(f" {DIM}Engines: piper (offline), edge-tts (cloud), espeak-ng (system).{RESET}
|
|
345
|
+
print(f" {DIM}Engines: piper (offline), edge-tts (cloud), espeak-ng (system).{RESET}")
|
|
346
|
+
if not _tts_engine_installed():
|
|
347
|
+
print(f" {DIM}None is installed yet: 'Enabled' stays silent until you install one,"
|
|
348
|
+
f" 'Choose engine' installs one now.{RESET}")
|
|
349
|
+
print()
|
|
346
350
|
tts_top_options = [
|
|
347
351
|
("Enabled", "auto-select best available engine"),
|
|
348
352
|
("Choose engine", "hear a demo and pick"),
|
|
@@ -355,6 +359,16 @@ def _step_tts(state: SetupState) -> None:
|
|
|
355
359
|
_choose_tts_engine(state)
|
|
356
360
|
|
|
357
361
|
|
|
362
|
+
def _tts_engine_installed() -> bool:
|
|
363
|
+
"""Is any auto-selectable TTS engine usable right now? Never raises."""
|
|
364
|
+
try:
|
|
365
|
+
from voiceio.config import TTSConfig
|
|
366
|
+
from voiceio.tts import probe_all
|
|
367
|
+
return any(probe.ok for _, probe in probe_all(TTSConfig()))
|
|
368
|
+
except Exception: # noqa: BLE001 — a hint only
|
|
369
|
+
return True
|
|
370
|
+
|
|
371
|
+
|
|
358
372
|
def _choose_tts_engine(state: SetupState) -> None:
|
|
359
373
|
# Let user pick an engine first, then demo it
|
|
360
374
|
engine_options = [
|
voiceio/setup/system.py
CHANGED
|
@@ -157,9 +157,14 @@ def _preflight_deps(interactive: bool = True, install_deps: bool = False) -> Non
|
|
|
157
157
|
print(f" {DIM}Run the command above, then re-run setup.{RESET}")
|
|
158
158
|
return
|
|
159
159
|
|
|
160
|
-
|
|
160
|
+
argv = plat.privileged_argv(cmd.split())
|
|
161
|
+
if argv is None:
|
|
162
|
+
print(f" {YELLOW}⚠{RESET} No terminal for sudo to ask your password, and no pkexec.")
|
|
163
|
+
print(f" {DIM}Run the command above yourself, then re-run setup.{RESET}")
|
|
164
|
+
return
|
|
165
|
+
print(f"\n {CYAN}Running:{RESET} {' '.join(argv)}\n")
|
|
161
166
|
try:
|
|
162
|
-
result = subprocess.run(
|
|
167
|
+
result = subprocess.run(argv, timeout=600)
|
|
163
168
|
if result.returncode == 0:
|
|
164
169
|
print(f"\n {GREEN}✓{RESET} System dependencies installed.")
|
|
165
170
|
# Some deps (evdev build) only take effect on a fresh Python process.
|
voiceio/tts/chain.py
CHANGED
|
@@ -98,5 +98,7 @@ def select(cfg: TTSConfig, allow_network: bool = True):
|
|
|
98
98
|
except Exception as e:
|
|
99
99
|
log.debug("TTS: %s failed: %s", name, e)
|
|
100
100
|
|
|
101
|
-
|
|
101
|
+
# Auto-selection finding nothing is the normal state of an install
|
|
102
|
+
# without the [tts] extra or espeak-ng; the caller decides if it matters.
|
|
103
|
+
log.info("TTS: no engine available")
|
|
102
104
|
return None
|
voiceio/vocab_stats.py
CHANGED
|
@@ -63,7 +63,8 @@ class VocabStats:
|
|
|
63
63
|
def save(self) -> None:
|
|
64
64
|
p = self.path
|
|
65
65
|
try:
|
|
66
|
-
|
|
66
|
+
from voiceio import config
|
|
67
|
+
config.private_dir(p.parent)
|
|
67
68
|
tmp = p.with_suffix(".tmp")
|
|
68
69
|
tmp.write_text(json.dumps(self._stats, indent=1), encoding="utf-8")
|
|
69
70
|
tmp.replace(p)
|
voiceio/vocabulary.py
CHANGED
|
@@ -181,7 +181,11 @@ def add_terms(terms: list[str], model_cfg: ModelConfig) -> int:
|
|
|
181
181
|
Creates the file if missing. Returns the number of terms actually added.
|
|
182
182
|
"""
|
|
183
183
|
path = resolve_vocab_path(model_cfg)
|
|
184
|
-
|
|
184
|
+
from voiceio import config
|
|
185
|
+
if path.parent == config.CONFIG_DIR:
|
|
186
|
+
config.private_dir(path.parent)
|
|
187
|
+
else: # a vocabulary_file the user chose: their directory, their modes
|
|
188
|
+
path.parent.mkdir(parents=True, exist_ok=True)
|
|
185
189
|
|
|
186
190
|
existing = _read_terms(path) if path.exists() else []
|
|
187
191
|
existing_lower = {t.lower() for t in existing}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|