python-voiceio 1.18.10__tar.gz → 1.18.12__tar.gz
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.18.10/python_voiceio.egg-info → python_voiceio-1.18.12}/PKG-INFO +1 -1
- {python_voiceio-1.18.10 → python_voiceio-1.18.12}/pyproject.toml +1 -1
- {python_voiceio-1.18.10 → python_voiceio-1.18.12/python_voiceio.egg-info}/PKG-INFO +1 -1
- {python_voiceio-1.18.10 → python_voiceio-1.18.12}/python_voiceio.egg-info/SOURCES.txt +2 -0
- python_voiceio-1.18.12/tests/test_mic_test.py +150 -0
- {python_voiceio-1.18.10 → python_voiceio-1.18.12}/tests/test_tts.py +18 -0
- python_voiceio-1.18.12/tests/test_tts_socket.py +156 -0
- python_voiceio-1.18.12/voiceio/__init__.py +1 -0
- {python_voiceio-1.18.10 → python_voiceio-1.18.12}/voiceio/app.py +8 -2
- {python_voiceio-1.18.10 → python_voiceio-1.18.12}/voiceio/cli/__init__.py +3 -0
- {python_voiceio-1.18.10 → python_voiceio-1.18.12}/voiceio/hotkeys/socket_backend.py +11 -7
- {python_voiceio-1.18.10 → python_voiceio-1.18.12}/voiceio/setup/speech.py +51 -12
- {python_voiceio-1.18.10 → python_voiceio-1.18.12}/voiceio/setup/steps.py +5 -1
- {python_voiceio-1.18.10 → python_voiceio-1.18.12}/voiceio/tts/piper_engine.py +5 -2
- python_voiceio-1.18.10/voiceio/__init__.py +0 -1
- {python_voiceio-1.18.10 → python_voiceio-1.18.12}/LICENSE +0 -0
- {python_voiceio-1.18.10 → python_voiceio-1.18.12}/README.md +0 -0
- {python_voiceio-1.18.10 → python_voiceio-1.18.12}/python_voiceio.egg-info/dependency_links.txt +0 -0
- {python_voiceio-1.18.10 → python_voiceio-1.18.12}/python_voiceio.egg-info/entry_points.txt +0 -0
- {python_voiceio-1.18.10 → python_voiceio-1.18.12}/python_voiceio.egg-info/requires.txt +0 -0
- {python_voiceio-1.18.10 → python_voiceio-1.18.12}/python_voiceio.egg-info/top_level.txt +0 -0
- {python_voiceio-1.18.10 → python_voiceio-1.18.12}/setup.cfg +0 -0
- {python_voiceio-1.18.10 → python_voiceio-1.18.12}/tests/test_announce.py +0 -0
- {python_voiceio-1.18.10 → python_voiceio-1.18.12}/tests/test_app_wiring.py +0 -0
- {python_voiceio-1.18.10 → python_voiceio-1.18.12}/tests/test_audio_quality.py +0 -0
- {python_voiceio-1.18.10 → python_voiceio-1.18.12}/tests/test_audio_source.py +0 -0
- {python_voiceio-1.18.10 → python_voiceio-1.18.12}/tests/test_backend_probes.py +0 -0
- {python_voiceio-1.18.10 → python_voiceio-1.18.12}/tests/test_cancel.py +0 -0
- {python_voiceio-1.18.10 → python_voiceio-1.18.12}/tests/test_cli.py +0 -0
- {python_voiceio-1.18.10 → python_voiceio-1.18.12}/tests/test_clipboard_read.py +0 -0
- {python_voiceio-1.18.10 → python_voiceio-1.18.12}/tests/test_clipboard_typer.py +0 -0
- {python_voiceio-1.18.10 → python_voiceio-1.18.12}/tests/test_commands.py +0 -0
- {python_voiceio-1.18.10 → python_voiceio-1.18.12}/tests/test_concurrency_lockdown.py +0 -0
- {python_voiceio-1.18.10 → python_voiceio-1.18.12}/tests/test_config.py +0 -0
- {python_voiceio-1.18.10 → python_voiceio-1.18.12}/tests/test_context_terms.py +0 -0
- {python_voiceio-1.18.10 → python_voiceio-1.18.12}/tests/test_corrections.py +0 -0
- {python_voiceio-1.18.10 → python_voiceio-1.18.12}/tests/test_cuda_setup_hint.py +0 -0
- {python_voiceio-1.18.10 → python_voiceio-1.18.12}/tests/test_dead_mic.py +0 -0
- {python_voiceio-1.18.10 → python_voiceio-1.18.12}/tests/test_decoders.py +0 -0
- {python_voiceio-1.18.10 → python_voiceio-1.18.12}/tests/test_engine.py +0 -0
- {python_voiceio-1.18.10 → python_voiceio-1.18.12}/tests/test_errorlog.py +0 -0
- {python_voiceio-1.18.10 → python_voiceio-1.18.12}/tests/test_evdev_uaccess.py +0 -0
- {python_voiceio-1.18.10 → python_voiceio-1.18.12}/tests/test_evdev_x11_optional.py +0 -0
- {python_voiceio-1.18.10 → python_voiceio-1.18.12}/tests/test_fallback.py +0 -0
- {python_voiceio-1.18.10 → python_voiceio-1.18.12}/tests/test_fcitx_bridge.py +0 -0
- {python_voiceio-1.18.10 → python_voiceio-1.18.12}/tests/test_feedback_stream.py +0 -0
- {python_voiceio-1.18.10 → python_voiceio-1.18.12}/tests/test_focus.py +0 -0
- {python_voiceio-1.18.10 → python_voiceio-1.18.12}/tests/test_gpu_fallback.py +0 -0
- {python_voiceio-1.18.10 → python_voiceio-1.18.12}/tests/test_health.py +0 -0
- {python_voiceio-1.18.10 → python_voiceio-1.18.12}/tests/test_hints.py +0 -0
- {python_voiceio-1.18.10 → python_voiceio-1.18.12}/tests/test_history.py +0 -0
- {python_voiceio-1.18.10 → python_voiceio-1.18.12}/tests/test_hotkey_modes.py +0 -0
- {python_voiceio-1.18.10 → python_voiceio-1.18.12}/tests/test_ibus_engine_limits.py +0 -0
- {python_voiceio-1.18.10 → python_voiceio-1.18.12}/tests/test_ibus_engine_listener.py +0 -0
- {python_voiceio-1.18.10 → python_voiceio-1.18.12}/tests/test_ibus_pending.py +0 -0
- {python_voiceio-1.18.10 → python_voiceio-1.18.12}/tests/test_ibus_pids.py +0 -0
- {python_voiceio-1.18.10 → python_voiceio-1.18.12}/tests/test_ibus_ping.py +0 -0
- {python_voiceio-1.18.10 → python_voiceio-1.18.12}/tests/test_ibus_session.py +0 -0
- {python_voiceio-1.18.10 → python_voiceio-1.18.12}/tests/test_ibus_textlimit.py +0 -0
- {python_voiceio-1.18.10 → python_voiceio-1.18.12}/tests/test_ibus_typer.py +0 -0
- {python_voiceio-1.18.10 → python_voiceio-1.18.12}/tests/test_idle_audio.py +0 -0
- {python_voiceio-1.18.10 → python_voiceio-1.18.12}/tests/test_install_env.py +0 -0
- {python_voiceio-1.18.10 → python_voiceio-1.18.12}/tests/test_learn_clean.py +0 -0
- {python_voiceio-1.18.10 → python_voiceio-1.18.12}/tests/test_learn_import.py +0 -0
- {python_voiceio-1.18.10 → python_voiceio-1.18.12}/tests/test_learn_language.py +0 -0
- {python_voiceio-1.18.10 → python_voiceio-1.18.12}/tests/test_learn_metrics.py +0 -0
- {python_voiceio-1.18.10 → python_voiceio-1.18.12}/tests/test_learn_pipeline.py +0 -0
- {python_voiceio-1.18.10 → python_voiceio-1.18.12}/tests/test_learn_quiet.py +0 -0
- {python_voiceio-1.18.10 → python_voiceio-1.18.12}/tests/test_learn_resume.py +0 -0
- {python_voiceio-1.18.10 → python_voiceio-1.18.12}/tests/test_learn_review.py +0 -0
- {python_voiceio-1.18.10 → python_voiceio-1.18.12}/tests/test_learn_summary.py +0 -0
- {python_voiceio-1.18.10 → python_voiceio-1.18.12}/tests/test_learn_targets.py +0 -0
- {python_voiceio-1.18.10 → python_voiceio-1.18.12}/tests/test_llm.py +0 -0
- {python_voiceio-1.18.10 → python_voiceio-1.18.12}/tests/test_llm_api.py +0 -0
- {python_voiceio-1.18.10 → python_voiceio-1.18.12}/tests/test_mic_gain.py +0 -0
- {python_voiceio-1.18.10 → python_voiceio-1.18.12}/tests/test_modifier_guard.py +0 -0
- {python_voiceio-1.18.10 → python_voiceio-1.18.12}/tests/test_numbers.py +0 -0
- {python_voiceio-1.18.10 → python_voiceio-1.18.12}/tests/test_paste_last.py +0 -0
- {python_voiceio-1.18.10 → python_voiceio-1.18.12}/tests/test_pipeline.py +0 -0
- {python_voiceio-1.18.10 → python_voiceio-1.18.12}/tests/test_platform.py +0 -0
- {python_voiceio-1.18.10 → python_voiceio-1.18.12}/tests/test_postcorrect.py +0 -0
- {python_voiceio-1.18.10 → python_voiceio-1.18.12}/tests/test_postprocess.py +0 -0
- {python_voiceio-1.18.10 → python_voiceio-1.18.12}/tests/test_prebuffer.py +0 -0
- {python_voiceio-1.18.10 → python_voiceio-1.18.12}/tests/test_presence.py +0 -0
- {python_voiceio-1.18.10 → python_voiceio-1.18.12}/tests/test_prompt.py +0 -0
- {python_voiceio-1.18.10 → python_voiceio-1.18.12}/tests/test_quiet_audio.py +0 -0
- {python_voiceio-1.18.10 → python_voiceio-1.18.12}/tests/test_recorder_integration.py +0 -0
- {python_voiceio-1.18.10 → python_voiceio-1.18.12}/tests/test_replies.py +0 -0
- {python_voiceio-1.18.10 → python_voiceio-1.18.12}/tests/test_report.py +0 -0
- {python_voiceio-1.18.10 → python_voiceio-1.18.12}/tests/test_retention.py +0 -0
- {python_voiceio-1.18.10 → python_voiceio-1.18.12}/tests/test_robustness.py +0 -0
- {python_voiceio-1.18.10 → python_voiceio-1.18.12}/tests/test_security_hardening.py +0 -0
- {python_voiceio-1.18.10 → python_voiceio-1.18.12}/tests/test_server.py +0 -0
- {python_voiceio-1.18.10 → python_voiceio-1.18.12}/tests/test_service.py +0 -0
- {python_voiceio-1.18.10 → python_voiceio-1.18.12}/tests/test_setup.py +0 -0
- {python_voiceio-1.18.10 → python_voiceio-1.18.12}/tests/test_sherpa.py +0 -0
- {python_voiceio-1.18.10 → python_voiceio-1.18.12}/tests/test_spool.py +0 -0
- {python_voiceio-1.18.10 → python_voiceio-1.18.12}/tests/test_streaming.py +0 -0
- {python_voiceio-1.18.10 → python_voiceio-1.18.12}/tests/test_suggest.py +0 -0
- {python_voiceio-1.18.10 → python_voiceio-1.18.12}/tests/test_telemetry.py +0 -0
- {python_voiceio-1.18.10 → python_voiceio-1.18.12}/tests/test_tokens.py +0 -0
- {python_voiceio-1.18.10 → python_voiceio-1.18.12}/tests/test_transcriber.py +0 -0
- {python_voiceio-1.18.10 → python_voiceio-1.18.12}/tests/test_tray.py +0 -0
- {python_voiceio-1.18.10 → python_voiceio-1.18.12}/tests/test_typer_manager.py +0 -0
- {python_voiceio-1.18.10 → python_voiceio-1.18.12}/tests/test_vad.py +0 -0
- {python_voiceio-1.18.10 → python_voiceio-1.18.12}/tests/test_vocabulary.py +0 -0
- {python_voiceio-1.18.10 → python_voiceio-1.18.12}/tests/test_wordfreq.py +0 -0
- {python_voiceio-1.18.10 → python_voiceio-1.18.12}/tests/test_worker_decode.py +0 -0
- {python_voiceio-1.18.10 → python_voiceio-1.18.12}/voiceio/__main__.py +0 -0
- {python_voiceio-1.18.10 → python_voiceio-1.18.12}/voiceio/announce.py +0 -0
- {python_voiceio-1.18.10 → python_voiceio-1.18.12}/voiceio/audio_source.py +0 -0
- {python_voiceio-1.18.10 → python_voiceio-1.18.12}/voiceio/backends.py +0 -0
- {python_voiceio-1.18.10 → python_voiceio-1.18.12}/voiceio/cli/configcmd.py +0 -0
- {python_voiceio-1.18.10 → python_voiceio-1.18.12}/voiceio/cli/corrections.py +0 -0
- {python_voiceio-1.18.10 → python_voiceio-1.18.12}/voiceio/cli/doctor.py +0 -0
- {python_voiceio-1.18.10 → python_voiceio-1.18.12}/voiceio/cli/history.py +0 -0
- {python_voiceio-1.18.10 → python_voiceio-1.18.12}/voiceio/cli/learn.py +0 -0
- {python_voiceio-1.18.10 → python_voiceio-1.18.12}/voiceio/cli/models.py +0 -0
- {python_voiceio-1.18.10 → python_voiceio-1.18.12}/voiceio/cli/replies.py +0 -0
- {python_voiceio-1.18.10 → python_voiceio-1.18.12}/voiceio/cli/servicecmd.py +0 -0
- {python_voiceio-1.18.10 → python_voiceio-1.18.12}/voiceio/cli/uninstall.py +0 -0
- {python_voiceio-1.18.10 → python_voiceio-1.18.12}/voiceio/cli/vocab.py +0 -0
- {python_voiceio-1.18.10 → python_voiceio-1.18.12}/voiceio/clipboard_read.py +0 -0
- {python_voiceio-1.18.10 → python_voiceio-1.18.12}/voiceio/commands.py +0 -0
- {python_voiceio-1.18.10 → python_voiceio-1.18.12}/voiceio/config.py +0 -0
- {python_voiceio-1.18.10 → python_voiceio-1.18.12}/voiceio/consent.py +0 -0
- {python_voiceio-1.18.10 → python_voiceio-1.18.12}/voiceio/context_terms.py +0 -0
- {python_voiceio-1.18.10 → python_voiceio-1.18.12}/voiceio/core/__init__.py +0 -0
- {python_voiceio-1.18.10 → python_voiceio-1.18.12}/voiceio/core/bias.py +0 -0
- {python_voiceio-1.18.10 → python_voiceio-1.18.12}/voiceio/core/decoders/__init__.py +0 -0
- {python_voiceio-1.18.10 → python_voiceio-1.18.12}/voiceio/core/decoders/base.py +0 -0
- {python_voiceio-1.18.10 → python_voiceio-1.18.12}/voiceio/core/decoders/catalog.py +0 -0
- {python_voiceio-1.18.10 → python_voiceio-1.18.12}/voiceio/core/decoders/faster_whisper/__init__.py +0 -0
- {python_voiceio-1.18.10 → python_voiceio-1.18.12}/voiceio/core/decoders/faster_whisper/worker.py +0 -0
- {python_voiceio-1.18.10 → python_voiceio-1.18.12}/voiceio/core/decoders/fetch.py +0 -0
- {python_voiceio-1.18.10 → python_voiceio-1.18.12}/voiceio/core/decoders/lanes.py +0 -0
- {python_voiceio-1.18.10 → python_voiceio-1.18.12}/voiceio/core/decoders/sherpa.py +0 -0
- {python_voiceio-1.18.10 → python_voiceio-1.18.12}/voiceio/core/decoders/whispercpp.py +0 -0
- {python_voiceio-1.18.10 → python_voiceio-1.18.12}/voiceio/core/engine.py +0 -0
- {python_voiceio-1.18.10 → python_voiceio-1.18.12}/voiceio/core/pipeline.py +0 -0
- {python_voiceio-1.18.10 → python_voiceio-1.18.12}/voiceio/corrections.py +0 -0
- {python_voiceio-1.18.10 → python_voiceio-1.18.12}/voiceio/data/60-voiceio-uaccess.rules +0 -0
- {python_voiceio-1.18.10 → python_voiceio-1.18.12}/voiceio/data/__init__.py +0 -0
- {python_voiceio-1.18.10 → python_voiceio-1.18.12}/voiceio/demo.py +0 -0
- {python_voiceio-1.18.10 → python_voiceio-1.18.12}/voiceio/display.py +0 -0
- {python_voiceio-1.18.10 → python_voiceio-1.18.12}/voiceio/errorlog.py +0 -0
- {python_voiceio-1.18.10 → python_voiceio-1.18.12}/voiceio/feedback.py +0 -0
- {python_voiceio-1.18.10 → python_voiceio-1.18.12}/voiceio/focus.py +0 -0
- {python_voiceio-1.18.10 → python_voiceio-1.18.12}/voiceio/health.py +0 -0
- {python_voiceio-1.18.10 → python_voiceio-1.18.12}/voiceio/hints.py +0 -0
- {python_voiceio-1.18.10 → python_voiceio-1.18.12}/voiceio/history.py +0 -0
- {python_voiceio-1.18.10 → python_voiceio-1.18.12}/voiceio/hotkeys/__init__.py +0 -0
- {python_voiceio-1.18.10 → python_voiceio-1.18.12}/voiceio/hotkeys/base.py +0 -0
- {python_voiceio-1.18.10 → python_voiceio-1.18.12}/voiceio/hotkeys/chain.py +0 -0
- {python_voiceio-1.18.10 → python_voiceio-1.18.12}/voiceio/hotkeys/evdev.py +0 -0
- {python_voiceio-1.18.10 → python_voiceio-1.18.12}/voiceio/hotkeys/pynput_backend.py +0 -0
- {python_voiceio-1.18.10 → python_voiceio-1.18.12}/voiceio/ibus/__init__.py +0 -0
- {python_voiceio-1.18.10 → python_voiceio-1.18.12}/voiceio/ibus/engine.py +0 -0
- {python_voiceio-1.18.10 → python_voiceio-1.18.12}/voiceio/ibus/install.py +0 -0
- {python_voiceio-1.18.10 → python_voiceio-1.18.12}/voiceio/ibus/pending.py +0 -0
- {python_voiceio-1.18.10 → python_voiceio-1.18.12}/voiceio/ibus/session.py +0 -0
- {python_voiceio-1.18.10 → python_voiceio-1.18.12}/voiceio/ibus/textlimit.py +0 -0
- {python_voiceio-1.18.10 → python_voiceio-1.18.12}/voiceio/idle_audio.py +0 -0
- {python_voiceio-1.18.10 → python_voiceio-1.18.12}/voiceio/install_env.py +0 -0
- {python_voiceio-1.18.10 → python_voiceio-1.18.12}/voiceio/learn/__init__.py +0 -0
- {python_voiceio-1.18.10 → python_voiceio-1.18.12}/voiceio/learn/augment.py +0 -0
- {python_voiceio-1.18.10 → python_voiceio-1.18.12}/voiceio/learn/clean.py +0 -0
- {python_voiceio-1.18.10 → python_voiceio-1.18.12}/voiceio/learn/evaluate.py +0 -0
- {python_voiceio-1.18.10 → python_voiceio-1.18.12}/voiceio/learn/importer.py +0 -0
- {python_voiceio-1.18.10 → python_voiceio-1.18.12}/voiceio/learn/lastrun.py +0 -0
- {python_voiceio-1.18.10 → python_voiceio-1.18.12}/voiceio/learn/metrics.py +0 -0
- {python_voiceio-1.18.10 → python_voiceio-1.18.12}/voiceio/learn/quiet.py +0 -0
- {python_voiceio-1.18.10 → python_voiceio-1.18.12}/voiceio/learn/review.py +0 -0
- {python_voiceio-1.18.10 → python_voiceio-1.18.12}/voiceio/learn/store.py +0 -0
- {python_voiceio-1.18.10 → python_voiceio-1.18.12}/voiceio/learn/summary.py +0 -0
- {python_voiceio-1.18.10 → python_voiceio-1.18.12}/voiceio/learn/teacher.py +0 -0
- {python_voiceio-1.18.10 → python_voiceio-1.18.12}/voiceio/learn/train.py +0 -0
- {python_voiceio-1.18.10 → python_voiceio-1.18.12}/voiceio/llm.py +0 -0
- {python_voiceio-1.18.10 → python_voiceio-1.18.12}/voiceio/llm_api.py +0 -0
- {python_voiceio-1.18.10 → python_voiceio-1.18.12}/voiceio/mic_gain.py +0 -0
- {python_voiceio-1.18.10 → python_voiceio-1.18.12}/voiceio/models/__init__.py +0 -0
- {python_voiceio-1.18.10 → python_voiceio-1.18.12}/voiceio/models/silero_vad.onnx +0 -0
- {python_voiceio-1.18.10 → python_voiceio-1.18.12}/voiceio/numbers.py +0 -0
- {python_voiceio-1.18.10 → python_voiceio-1.18.12}/voiceio/pidlock.py +0 -0
- {python_voiceio-1.18.10 → python_voiceio-1.18.12}/voiceio/platform.py +0 -0
- {python_voiceio-1.18.10 → python_voiceio-1.18.12}/voiceio/postcorrect.py +0 -0
- {python_voiceio-1.18.10 → python_voiceio-1.18.12}/voiceio/postprocess.py +0 -0
- {python_voiceio-1.18.10 → python_voiceio-1.18.12}/voiceio/power.py +0 -0
- {python_voiceio-1.18.10 → python_voiceio-1.18.12}/voiceio/presence.py +0 -0
- {python_voiceio-1.18.10 → python_voiceio-1.18.12}/voiceio/privacy.py +0 -0
- {python_voiceio-1.18.10 → python_voiceio-1.18.12}/voiceio/prompt.py +0 -0
- {python_voiceio-1.18.10 → python_voiceio-1.18.12}/voiceio/quiet_audio.py +0 -0
- {python_voiceio-1.18.10 → python_voiceio-1.18.12}/voiceio/recorder.py +0 -0
- {python_voiceio-1.18.10 → python_voiceio-1.18.12}/voiceio/replies.py +0 -0
- {python_voiceio-1.18.10 → python_voiceio-1.18.12}/voiceio/report.py +0 -0
- {python_voiceio-1.18.10 → python_voiceio-1.18.12}/voiceio/retention.py +0 -0
- {python_voiceio-1.18.10 → python_voiceio-1.18.12}/voiceio/server/__init__.py +0 -0
- {python_voiceio-1.18.10 → python_voiceio-1.18.12}/voiceio/server/__main__.py +0 -0
- {python_voiceio-1.18.10 → python_voiceio-1.18.12}/voiceio/server/app.py +0 -0
- {python_voiceio-1.18.10 → python_voiceio-1.18.12}/voiceio/server/config.py +0 -0
- {python_voiceio-1.18.10 → python_voiceio-1.18.12}/voiceio/server/runtime.py +0 -0
- {python_voiceio-1.18.10 → python_voiceio-1.18.12}/voiceio/service.py +0 -0
- {python_voiceio-1.18.10 → python_voiceio-1.18.12}/voiceio/setup/__init__.py +0 -0
- {python_voiceio-1.18.10 → python_voiceio-1.18.12}/voiceio/setup/configfile.py +0 -0
- {python_voiceio-1.18.10 → python_voiceio-1.18.12}/voiceio/setup/extras.py +0 -0
- {python_voiceio-1.18.10 → python_voiceio-1.18.12}/voiceio/setup/hotkey.py +0 -0
- {python_voiceio-1.18.10 → python_voiceio-1.18.12}/voiceio/setup/noninteractive.py +0 -0
- {python_voiceio-1.18.10 → python_voiceio-1.18.12}/voiceio/setup/system.py +0 -0
- {python_voiceio-1.18.10 → python_voiceio-1.18.12}/voiceio/setup/ui.py +0 -0
- {python_voiceio-1.18.10 → python_voiceio-1.18.12}/voiceio/sounds/__init__.py +0 -0
- {python_voiceio-1.18.10 → python_voiceio-1.18.12}/voiceio/sounds/alert.wav +0 -0
- {python_voiceio-1.18.10 → python_voiceio-1.18.12}/voiceio/sounds/commit.wav +0 -0
- {python_voiceio-1.18.10 → python_voiceio-1.18.12}/voiceio/sounds/start.wav +0 -0
- {python_voiceio-1.18.10 → python_voiceio-1.18.12}/voiceio/sounds/stop.wav +0 -0
- {python_voiceio-1.18.10 → python_voiceio-1.18.12}/voiceio/spool.py +0 -0
- {python_voiceio-1.18.10 → python_voiceio-1.18.12}/voiceio/streaming.py +0 -0
- {python_voiceio-1.18.10 → python_voiceio-1.18.12}/voiceio/suggest.py +0 -0
- {python_voiceio-1.18.10 → python_voiceio-1.18.12}/voiceio/telemetry.py +0 -0
- {python_voiceio-1.18.10 → python_voiceio-1.18.12}/voiceio/tokens.py +0 -0
- {python_voiceio-1.18.10 → python_voiceio-1.18.12}/voiceio/tray/__init__.py +0 -0
- {python_voiceio-1.18.10 → python_voiceio-1.18.12}/voiceio/tray/_icons.py +0 -0
- {python_voiceio-1.18.10 → python_voiceio-1.18.12}/voiceio/tray/_indicator.py +0 -0
- {python_voiceio-1.18.10 → python_voiceio-1.18.12}/voiceio/tray/_pystray.py +0 -0
- {python_voiceio-1.18.10 → python_voiceio-1.18.12}/voiceio/tts/__init__.py +0 -0
- {python_voiceio-1.18.10 → python_voiceio-1.18.12}/voiceio/tts/base.py +0 -0
- {python_voiceio-1.18.10 → python_voiceio-1.18.12}/voiceio/tts/chain.py +0 -0
- {python_voiceio-1.18.10 → python_voiceio-1.18.12}/voiceio/tts/edge_engine.py +0 -0
- {python_voiceio-1.18.10 → python_voiceio-1.18.12}/voiceio/tts/espeak.py +0 -0
- {python_voiceio-1.18.10 → python_voiceio-1.18.12}/voiceio/tts/player.py +0 -0
- {python_voiceio-1.18.10 → python_voiceio-1.18.12}/voiceio/tts/supertonic_engine.py +0 -0
- {python_voiceio-1.18.10 → python_voiceio-1.18.12}/voiceio/typers/__init__.py +0 -0
- {python_voiceio-1.18.10 → python_voiceio-1.18.12}/voiceio/typers/base.py +0 -0
- {python_voiceio-1.18.10 → python_voiceio-1.18.12}/voiceio/typers/chain.py +0 -0
- {python_voiceio-1.18.10 → python_voiceio-1.18.12}/voiceio/typers/clipboard.py +0 -0
- {python_voiceio-1.18.10 → python_voiceio-1.18.12}/voiceio/typers/collecting.py +0 -0
- {python_voiceio-1.18.10 → python_voiceio-1.18.12}/voiceio/typers/fcitx_bridge.py +0 -0
- {python_voiceio-1.18.10 → python_voiceio-1.18.12}/voiceio/typers/ibus.py +0 -0
- {python_voiceio-1.18.10 → python_voiceio-1.18.12}/voiceio/typers/manager.py +0 -0
- {python_voiceio-1.18.10 → python_voiceio-1.18.12}/voiceio/typers/modifier_guard.py +0 -0
- {python_voiceio-1.18.10 → python_voiceio-1.18.12}/voiceio/typers/paste.py +0 -0
- {python_voiceio-1.18.10 → python_voiceio-1.18.12}/voiceio/typers/pynput_type.py +0 -0
- {python_voiceio-1.18.10 → python_voiceio-1.18.12}/voiceio/typers/wtype.py +0 -0
- {python_voiceio-1.18.10 → python_voiceio-1.18.12}/voiceio/typers/xdotool.py +0 -0
- {python_voiceio-1.18.10 → python_voiceio-1.18.12}/voiceio/typers/ydotool.py +0 -0
- {python_voiceio-1.18.10 → python_voiceio-1.18.12}/voiceio/ui.py +0 -0
- {python_voiceio-1.18.10 → python_voiceio-1.18.12}/voiceio/vad.py +0 -0
- {python_voiceio-1.18.10 → python_voiceio-1.18.12}/voiceio/vocab_stats.py +0 -0
- {python_voiceio-1.18.10 → python_voiceio-1.18.12}/voiceio/vocabulary.py +0 -0
- {python_voiceio-1.18.10 → python_voiceio-1.18.12}/voiceio/watchdog.py +0 -0
- {python_voiceio-1.18.10 → python_voiceio-1.18.12}/voiceio/wordfreq.py +0 -0
|
@@ -60,6 +60,7 @@ tests/test_learn_targets.py
|
|
|
60
60
|
tests/test_llm.py
|
|
61
61
|
tests/test_llm_api.py
|
|
62
62
|
tests/test_mic_gain.py
|
|
63
|
+
tests/test_mic_test.py
|
|
63
64
|
tests/test_modifier_guard.py
|
|
64
65
|
tests/test_numbers.py
|
|
65
66
|
tests/test_paste_last.py
|
|
@@ -89,6 +90,7 @@ tests/test_tokens.py
|
|
|
89
90
|
tests/test_transcriber.py
|
|
90
91
|
tests/test_tray.py
|
|
91
92
|
tests/test_tts.py
|
|
93
|
+
tests/test_tts_socket.py
|
|
92
94
|
tests/test_typer_manager.py
|
|
93
95
|
tests/test_vad.py
|
|
94
96
|
tests/test_vocabulary.py
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
"""The setup/doctor mic test (`_streaming_test`): when it stops listening.
|
|
2
|
+
|
|
3
|
+
Runs the real loop on a fake clock and a fake sounddevice stream, so a
|
|
4
|
+
"delayed audio path" (IP-KVM, remote desktop) is seconds of silence first.
|
|
5
|
+
"""
|
|
6
|
+
from __future__ import annotations
|
|
7
|
+
|
|
8
|
+
import types
|
|
9
|
+
|
|
10
|
+
import numpy as np
|
|
11
|
+
import pytest
|
|
12
|
+
|
|
13
|
+
from voiceio.setup import speech
|
|
14
|
+
|
|
15
|
+
SR = 16000
|
|
16
|
+
CHUNK = 0.5
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
class _Clock:
|
|
20
|
+
"""time.time/sleep for the speech module; sleeping feeds the stream."""
|
|
21
|
+
|
|
22
|
+
def __init__(self):
|
|
23
|
+
self.now = 0.0
|
|
24
|
+
self.stream = None
|
|
25
|
+
|
|
26
|
+
def time(self):
|
|
27
|
+
return self.now
|
|
28
|
+
|
|
29
|
+
def sleep(self, secs):
|
|
30
|
+
self.now += secs
|
|
31
|
+
if self.stream is not None:
|
|
32
|
+
self.stream.feed(self.now)
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
def _fake_sd(clock: _Clock, level, deliver: bool = True):
|
|
36
|
+
"""A sounddevice whose InputStream delivers 0.5 s chunks in clock time;
|
|
37
|
+
`level(t)` is the speech amplitude of the audio recorded at t."""
|
|
38
|
+
|
|
39
|
+
class InputStream:
|
|
40
|
+
def __init__(self, samplerate, channels, dtype, blocksize, callback):
|
|
41
|
+
self.cb = callback
|
|
42
|
+
self.sent = 0
|
|
43
|
+
clock.stream = self
|
|
44
|
+
|
|
45
|
+
def start(self):
|
|
46
|
+
pass
|
|
47
|
+
|
|
48
|
+
def feed(self, now):
|
|
49
|
+
while deliver and (self.sent + 1) * CHUNK <= now:
|
|
50
|
+
t0 = self.sent * CHUNK
|
|
51
|
+
n = int(SR * CHUNK)
|
|
52
|
+
t = t0 + np.arange(n) / SR
|
|
53
|
+
amp = level(t0)
|
|
54
|
+
data = (amp * np.sin(2 * np.pi * 220 * t)).astype(np.float32)
|
|
55
|
+
self.cb(data.reshape(-1, 1), n, None, None)
|
|
56
|
+
self.sent += 1
|
|
57
|
+
|
|
58
|
+
def stop(self):
|
|
59
|
+
pass
|
|
60
|
+
|
|
61
|
+
def close(self):
|
|
62
|
+
pass
|
|
63
|
+
|
|
64
|
+
return types.SimpleNamespace(InputStream=InputStream)
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
class _Model:
|
|
68
|
+
"""Recognizes "hello world" in any audio that holds a tone."""
|
|
69
|
+
|
|
70
|
+
def __init__(self):
|
|
71
|
+
self.calls = 0
|
|
72
|
+
|
|
73
|
+
def transcribe(self, audio, **_):
|
|
74
|
+
self.calls += 1
|
|
75
|
+
if np.max(np.abs(audio), initial=0.0) > 1e-3:
|
|
76
|
+
return [types.SimpleNamespace(text="hello world")], None
|
|
77
|
+
return [], None
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
@pytest.fixture
|
|
81
|
+
def run(monkeypatch):
|
|
82
|
+
def _run(level, deliver=True):
|
|
83
|
+
clock = _Clock()
|
|
84
|
+
monkeypatch.setattr(speech, "time", clock)
|
|
85
|
+
monkeypatch.setitem(__import__("sys").modules, "sounddevice",
|
|
86
|
+
_fake_sd(clock, level, deliver))
|
|
87
|
+
text = speech._streaming_test(model=_Model(), language="en")
|
|
88
|
+
return text, clock.now
|
|
89
|
+
return _run
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
def _speech(start, length, amp=0.1):
|
|
93
|
+
return lambda t: amp if start <= t < start + length else 0.0
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
def test_delayed_speech_is_waited_for(run, capsys):
|
|
97
|
+
# The KVM case: 6 s of silence, then 3 s of speech.
|
|
98
|
+
text, ended = run(_speech(6.0, 3.0))
|
|
99
|
+
assert "hello world" in text.lower()
|
|
100
|
+
assert ended >= 9.0 + speech._STOP_SILENCE_SECS - 1.0
|
|
101
|
+
assert ended < 9.0 + speech._STOP_SILENCE_SECS + 2.0
|
|
102
|
+
assert "No speech" not in capsys.readouterr().out
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
def test_prompt_speech_stops_soon_after_it_ends(run):
|
|
106
|
+
# The normal case is no slower: speech at once, stop ~1.5 s after.
|
|
107
|
+
text, ended = run(_speech(0.0, 2.0))
|
|
108
|
+
assert text
|
|
109
|
+
assert ended < 2.0 + speech._STOP_SILENCE_SECS + 1.5
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+
def test_silence_waits_then_says_nothing_arrived(run, capsys):
|
|
113
|
+
text, ended = run(lambda t: 0.0)
|
|
114
|
+
assert text == ""
|
|
115
|
+
assert speech._WAIT_FOR_SPEECH_SECS <= ended < speech._WAIT_FOR_SPEECH_SECS + 1.0
|
|
116
|
+
out = capsys.readouterr().out
|
|
117
|
+
assert f"No speech arrived within {speech._WAIT_FOR_SPEECH_SECS}s" in out
|
|
118
|
+
assert "IP-KVM" in out and "keep talking" in out
|
|
119
|
+
|
|
120
|
+
|
|
121
|
+
def test_quiet_mic_recognized_words_count_as_speech(run):
|
|
122
|
+
# Below the RMS threshold for its whole length, yet decodable: the words
|
|
123
|
+
# alone keep the test going and end it once they stop changing.
|
|
124
|
+
text, ended = run(_speech(5.0, 3.0, amp=0.005))
|
|
125
|
+
assert text
|
|
126
|
+
assert ended < speech._WAIT_FOR_SPEECH_SECS + speech._MAX_SPEECH_SECS
|
|
127
|
+
|
|
128
|
+
|
|
129
|
+
def test_long_speech_is_capped(run):
|
|
130
|
+
text, ended = run(_speech(1.0, 60.0))
|
|
131
|
+
assert text
|
|
132
|
+
assert ended < 1.0 + speech._MAX_SPEECH_SECS + 1.5
|
|
133
|
+
|
|
134
|
+
|
|
135
|
+
def test_stream_with_no_audio_says_so(run, capsys):
|
|
136
|
+
text, _ = run(lambda t: 0.0, deliver=False)
|
|
137
|
+
assert text == ""
|
|
138
|
+
assert "delivered no audio" in capsys.readouterr().out
|
|
139
|
+
|
|
140
|
+
|
|
141
|
+
@pytest.mark.parametrize("elapsed,heard_at,silent,stop", [
|
|
142
|
+
(1.6, None, 1.6, False), # initial silence alone never stops it
|
|
143
|
+
(11.9, None, 11.9, False),
|
|
144
|
+
(12.0, None, 12.0, True),
|
|
145
|
+
(7.0, 6.0, 1.0, False),
|
|
146
|
+
(8.0, 6.0, 1.5, True),
|
|
147
|
+
(16.0, 6.0, 0.0, True), # speech cap
|
|
148
|
+
])
|
|
149
|
+
def test_should_stop(elapsed, heard_at, silent, stop):
|
|
150
|
+
assert speech._test_should_stop(elapsed, heard_at, silent) is stop
|
|
@@ -391,6 +391,7 @@ def test_piper_skips_download_when_model_present(tmp_path):
|
|
|
391
391
|
from voiceio.tts import piper_engine
|
|
392
392
|
|
|
393
393
|
(tmp_path / "en_US-lessac-medium.onnx").write_bytes(b"onnx")
|
|
394
|
+
(tmp_path / "en_US-lessac-medium.onnx.json").write_text("{}")
|
|
394
395
|
modules = _fake_piper()
|
|
395
396
|
engine = piper_engine.PiperEngine()
|
|
396
397
|
|
|
@@ -401,6 +402,23 @@ def test_piper_skips_download_when_model_present(tmp_path):
|
|
|
401
402
|
modules["piper.download_voices"].download_voice.assert_not_called()
|
|
402
403
|
|
|
403
404
|
|
|
405
|
+
def test_piper_redownloads_a_voice_missing_its_config(tmp_path):
|
|
406
|
+
"""An interrupted download leaves the .onnx without its .onnx.json:
|
|
407
|
+
loading that raised FileNotFoundError on every start."""
|
|
408
|
+
from voiceio.tts import piper_engine
|
|
409
|
+
|
|
410
|
+
(tmp_path / "en_US-lessac-medium.onnx").write_bytes(b"onnx")
|
|
411
|
+
modules = _fake_piper()
|
|
412
|
+
engine = piper_engine.PiperEngine()
|
|
413
|
+
|
|
414
|
+
with patch.dict("sys.modules", modules), \
|
|
415
|
+
patch.object(piper_engine, "_models_dir", return_value=tmp_path):
|
|
416
|
+
engine._ensure_voice()
|
|
417
|
+
|
|
418
|
+
modules["piper.download_voices"].download_voice.assert_called_once_with(
|
|
419
|
+
"en_US-lessac-medium", tmp_path)
|
|
420
|
+
|
|
421
|
+
|
|
404
422
|
def test_piper_never_writes_to_the_cwd(tmp_path):
|
|
405
423
|
"""piper's `download_dir` defaults to the current working directory. A
|
|
406
424
|
daemon's cwd is not ours to litter in."""
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
"""One socket listener per daemon: `voiceio toggle` dictates, `voiceio speak`
|
|
2
|
+
reads aloud. A second SocketHotkey for the TTS key used to steal the socket
|
|
3
|
+
path, so the toggle shortcut read the clipboard aloud instead of recording."""
|
|
4
|
+
from __future__ import annotations
|
|
5
|
+
|
|
6
|
+
import socket
|
|
7
|
+
import sys
|
|
8
|
+
import threading
|
|
9
|
+
import time
|
|
10
|
+
from unittest.mock import MagicMock, patch
|
|
11
|
+
|
|
12
|
+
import pytest
|
|
13
|
+
|
|
14
|
+
from voiceio.config import Config
|
|
15
|
+
from voiceio.hotkeys import socket_backend as sb
|
|
16
|
+
from voiceio.typers.base import TyperBackend
|
|
17
|
+
|
|
18
|
+
pytestmark = pytest.mark.skipif(sys.platform == "win32", reason="Unix socket path")
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
@pytest.fixture
|
|
22
|
+
def sock_path(tmp_path, monkeypatch):
|
|
23
|
+
monkeypatch.setattr(sb, "SOCKET_PATH", tmp_path / "v.sock")
|
|
24
|
+
return tmp_path / "v.sock"
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
def _make_app(tts_engine):
|
|
28
|
+
"""The hotkey chain resolves to the socket backend (no evdev, no pynput)."""
|
|
29
|
+
typer = MagicMock(spec=TyperBackend)
|
|
30
|
+
typer.name = "clipboard"
|
|
31
|
+
with patch("voiceio.app.hotkey_chain.select", side_effect=lambda *a, **k: sb.SocketHotkey()), \
|
|
32
|
+
patch("voiceio.app.typer_chain.select", return_value=typer), \
|
|
33
|
+
patch("voiceio.app.build_decoder", return_value=MagicMock()), \
|
|
34
|
+
patch("voiceio.tts.select", return_value=tts_engine), \
|
|
35
|
+
patch("voiceio.tts.player.TTSPlayer", return_value=MagicMock()), \
|
|
36
|
+
patch("voiceio.app.plat.detect") as detect:
|
|
37
|
+
detect.return_value = MagicMock(display_server="wayland", desktop="gnome")
|
|
38
|
+
from voiceio.app import VoiceIO
|
|
39
|
+
vio = VoiceIO(Config())
|
|
40
|
+
return vio
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
def _start(vio):
|
|
44
|
+
"""What run() does with the hotkeys."""
|
|
45
|
+
vio._start_hotkeys()
|
|
46
|
+
if vio._tts_hotkey:
|
|
47
|
+
vio._tts_hotkey.start(vio.cfg.tts.hotkey, vio.on_tts_hotkey)
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
def _stop(vio):
|
|
51
|
+
vio._hotkey.stop()
|
|
52
|
+
if vio._socket is not None:
|
|
53
|
+
vio._socket.stop()
|
|
54
|
+
if vio._tts_hotkey:
|
|
55
|
+
vio._tts_hotkey.stop()
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
def _wait_for(cond, timeout=3.0):
|
|
59
|
+
deadline = time.monotonic() + timeout
|
|
60
|
+
while not cond() and time.monotonic() < deadline:
|
|
61
|
+
time.sleep(0.02)
|
|
62
|
+
return cond()
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
def test_toggle_dictates_when_tts_is_on_and_the_chain_is_socket(sock_path):
|
|
66
|
+
engine = MagicMock()
|
|
67
|
+
engine.name = "espeak"
|
|
68
|
+
vio = _make_app(engine)
|
|
69
|
+
assert vio._hotkey.name == "socket"
|
|
70
|
+
assert vio._socket is None and vio._tts_hotkey is None
|
|
71
|
+
|
|
72
|
+
vio.on_hotkey = MagicMock()
|
|
73
|
+
vio.on_tts_hotkey = MagicMock()
|
|
74
|
+
binds = []
|
|
75
|
+
real_start = sb.SocketHotkey.start
|
|
76
|
+
with patch.object(sb.SocketHotkey, "start", autospec=True,
|
|
77
|
+
side_effect=lambda self, *a, **k: (binds.append(self),
|
|
78
|
+
real_start(self, *a, **k))):
|
|
79
|
+
_start(vio)
|
|
80
|
+
try:
|
|
81
|
+
assert len(binds) == 1
|
|
82
|
+
assert sb.send_command("toggle")
|
|
83
|
+
assert _wait_for(lambda: vio.on_hotkey.called)
|
|
84
|
+
time.sleep(0.1)
|
|
85
|
+
vio.on_tts_hotkey.assert_not_called()
|
|
86
|
+
|
|
87
|
+
assert sb.send_command("speak")
|
|
88
|
+
assert _wait_for(lambda: vio.on_tts_hotkey.called)
|
|
89
|
+
vio.on_hotkey.assert_called_once()
|
|
90
|
+
finally:
|
|
91
|
+
_stop(vio)
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
def test_speak_is_ignored_without_a_tts_engine(sock_path):
|
|
95
|
+
vio = _make_app(None)
|
|
96
|
+
vio.on_hotkey = MagicMock()
|
|
97
|
+
vio.on_tts_hotkey = MagicMock()
|
|
98
|
+
_start(vio)
|
|
99
|
+
try:
|
|
100
|
+
assert sb.send_command("speak")
|
|
101
|
+
assert sb.send_command("toggle")
|
|
102
|
+
assert _wait_for(lambda: vio.on_hotkey.called)
|
|
103
|
+
vio.on_tts_hotkey.assert_not_called()
|
|
104
|
+
finally:
|
|
105
|
+
_stop(vio)
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
def test_non_socket_tts_backend_still_gets_its_own_key():
|
|
109
|
+
key_backend = MagicMock()
|
|
110
|
+
key_backend.name = "evdev"
|
|
111
|
+
typer = MagicMock(spec=TyperBackend)
|
|
112
|
+
typer.name = "clipboard"
|
|
113
|
+
engine = MagicMock()
|
|
114
|
+
engine.name = "espeak"
|
|
115
|
+
with patch("voiceio.app.hotkey_chain.select", return_value=key_backend), \
|
|
116
|
+
patch("voiceio.app.typer_chain.select", return_value=typer), \
|
|
117
|
+
patch("voiceio.app.build_decoder", return_value=MagicMock()), \
|
|
118
|
+
patch("voiceio.tts.select", return_value=engine), \
|
|
119
|
+
patch("voiceio.tts.player.TTSPlayer", return_value=MagicMock()), \
|
|
120
|
+
patch("voiceio.app.plat.detect") as detect:
|
|
121
|
+
detect.return_value = MagicMock(display_server="wayland", desktop="gnome")
|
|
122
|
+
from voiceio.app import VoiceIO
|
|
123
|
+
vio = VoiceIO(Config())
|
|
124
|
+
assert vio._tts_hotkey is key_backend
|
|
125
|
+
vio._socket = MagicMock()
|
|
126
|
+
vio._start_hotkeys()
|
|
127
|
+
vio._socket.handle.assert_any_call("speak", vio.on_tts_hotkey)
|
|
128
|
+
|
|
129
|
+
|
|
130
|
+
def _free_udp_port():
|
|
131
|
+
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
|
|
132
|
+
s.bind(("127.0.0.1", 0))
|
|
133
|
+
port = s.getsockname()[1]
|
|
134
|
+
s.close()
|
|
135
|
+
return port
|
|
136
|
+
|
|
137
|
+
|
|
138
|
+
@pytest.mark.parametrize("udp", [False, True], ids=["unix", "windows-udp"])
|
|
139
|
+
def test_debounce_is_per_command(sock_path, monkeypatch, udp):
|
|
140
|
+
if udp:
|
|
141
|
+
monkeypatch.setattr(sb, "_IS_WINDOWS", True)
|
|
142
|
+
monkeypatch.setattr(sb, "_UDP_PORT", _free_udp_port())
|
|
143
|
+
got = []
|
|
144
|
+
done = threading.Event()
|
|
145
|
+
hk = sb.SocketHotkey()
|
|
146
|
+
hk.start("x", lambda: got.append("toggle"))
|
|
147
|
+
hk.handle("speak", lambda: got.append("speak"))
|
|
148
|
+
hk.handle("cancel", lambda: done.set())
|
|
149
|
+
try:
|
|
150
|
+
for command in ("toggle", "speak", "toggle", "speak", "cancel"):
|
|
151
|
+
assert sb.send_command(command)
|
|
152
|
+
assert done.wait(3)
|
|
153
|
+
# A toggle doesn't suppress a speak; repeats of each are debounced.
|
|
154
|
+
assert got == ["toggle", "speak"]
|
|
155
|
+
finally:
|
|
156
|
+
hk.stop()
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "1.18.12"
|
|
@@ -199,8 +199,12 @@ class VoiceIO:
|
|
|
199
199
|
self._tts_engine = tts_select(cfg.tts)
|
|
200
200
|
if self._tts_engine:
|
|
201
201
|
self._tts_player = TTSPlayer()
|
|
202
|
-
#
|
|
203
|
-
|
|
202
|
+
# A key backend of its own for the TTS key. Never a second
|
|
203
|
+
# socket listener: it would steal the path from dictation.
|
|
204
|
+
# On the socket path, `voiceio speak` is the TTS key.
|
|
205
|
+
tts_hotkey = hotkey_chain.select(platform, cfg.hotkey.backend)
|
|
206
|
+
if tts_hotkey.name != "socket":
|
|
207
|
+
self._tts_hotkey = tts_hotkey
|
|
204
208
|
log.info("TTS: engine=%s, hotkey=%s", self._tts_engine.name, cfg.tts.hotkey)
|
|
205
209
|
elif cfg.tts.engine == "auto":
|
|
206
210
|
# The default config: read aloud once an engine is installed.
|
|
@@ -1004,6 +1008,8 @@ class VoiceIO:
|
|
|
1004
1008
|
control.handle("release", self.on_hotkey_release)
|
|
1005
1009
|
control.handle("cancel", self.cancel)
|
|
1006
1010
|
control.handle("paste-last", self.paste_last)
|
|
1011
|
+
if self._tts_engine is not None:
|
|
1012
|
+
control.handle("speak", self.on_tts_hotkey)
|
|
1007
1013
|
if hasattr(control, "handle_payload"):
|
|
1008
1014
|
control.handle_payload("say", self.on_say)
|
|
1009
1015
|
if self._cancel_hotkey is not None:
|
|
@@ -43,6 +43,9 @@ def main() -> None:
|
|
|
43
43
|
edge.add_argument("--release", dest="edge", action="store_const", const="release",
|
|
44
44
|
help="key up: ends a held push-to-talk recording")
|
|
45
45
|
p_toggle.set_defaults(func=lambda a: _send(a.edge or "toggle"))
|
|
46
|
+
sub.add_parser("speak", help="Read the selected text aloud, or stop reading "
|
|
47
|
+
"(bind it to a shortcut; same as the TTS hotkey)"
|
|
48
|
+
).set_defaults(func=lambda a: _send("speak"))
|
|
46
49
|
sub.add_parser("cancel", help="Abandon the current dictation: nothing is typed or kept"
|
|
47
50
|
).set_defaults(func=lambda a: _send("cancel"))
|
|
48
51
|
|
|
@@ -29,14 +29,17 @@ class SocketHotkey:
|
|
|
29
29
|
"""Listens on a Unix DGRAM socket (or UDP on Windows) for commands.
|
|
30
30
|
|
|
31
31
|
"toggle" fires on_trigger (it is the hotkey: debounced against evdev
|
|
32
|
-
seeing the same keypress); handle() adds others ("press", "release"
|
|
32
|
+
seeing the same keypress); handle() adds others ("press", "release",
|
|
33
|
+
"speak"...). One listener per daemon owns the socket path: every
|
|
34
|
+
command routes through it.
|
|
33
35
|
A DE shortcut runs a command on key down only, so this backend reports
|
|
34
36
|
no release unless the compositor binds one (`voiceio toggle --release`).
|
|
35
37
|
"""
|
|
36
38
|
|
|
37
39
|
name = "socket"
|
|
38
|
-
#
|
|
39
|
-
|
|
40
|
+
# Debounced commands -> debounce group. "toggle" and "press" may be the
|
|
41
|
+
# same keypress (also seen by evdev/pynput); "speak" is its own key.
|
|
42
|
+
_DEBOUNCED = {"toggle": "hotkey", "press": "hotkey", "speak": "speak"}
|
|
40
43
|
|
|
41
44
|
def __init__(self) -> None:
|
|
42
45
|
self._handlers: dict[str, Callable[[], None]] = {}
|
|
@@ -63,7 +66,7 @@ class SocketHotkey:
|
|
|
63
66
|
on_release: Callable[[], None] | None = None) -> None:
|
|
64
67
|
self._handlers["toggle"] = on_trigger
|
|
65
68
|
self._running = True
|
|
66
|
-
self._last_trigger: float =
|
|
69
|
+
self._last_trigger: dict[str, float] = {}
|
|
67
70
|
|
|
68
71
|
if _IS_WINDOWS:
|
|
69
72
|
self._sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
|
|
@@ -91,11 +94,12 @@ class SocketHotkey:
|
|
|
91
94
|
fn = self._handlers.get(command)
|
|
92
95
|
if fn is None:
|
|
93
96
|
continue
|
|
94
|
-
|
|
97
|
+
group = self._DEBOUNCED.get(command)
|
|
98
|
+
if group is not None:
|
|
95
99
|
now = time.monotonic()
|
|
96
|
-
if now - self._last_trigger < DEBOUNCE_SECS:
|
|
100
|
+
if now - self._last_trigger.get(group, -DEBOUNCE_SECS) < DEBOUNCE_SECS:
|
|
97
101
|
continue
|
|
98
|
-
self._last_trigger = now
|
|
102
|
+
self._last_trigger[group] = now
|
|
99
103
|
fn()
|
|
100
104
|
except socket.timeout:
|
|
101
105
|
continue
|
|
@@ -116,6 +116,24 @@ def _download_model(model_name: str) -> bool:
|
|
|
116
116
|
return False
|
|
117
117
|
|
|
118
118
|
|
|
119
|
+
# The mic test's timing. Silence ends the test only once something has been
|
|
120
|
+
# heard: an audio path with seconds of latency (remote desktop, IP-KVM,
|
|
121
|
+
# Bluetooth) delivers nothing but silence at first, and stopping then said
|
|
122
|
+
# "no speech" before the user's voice had even arrived.
|
|
123
|
+
_STOP_SILENCE_SECS = 1.5 # after speech: this much quiet ends the test
|
|
124
|
+
_WAIT_FOR_SPEECH_SECS = 12 # before speech: give up after this long
|
|
125
|
+
_MAX_SPEECH_SECS = 10 # after speech starts: record at most this long
|
|
126
|
+
|
|
127
|
+
|
|
128
|
+
def _test_should_stop(elapsed: float, heard_at: float | None, silent_secs: float) -> bool:
|
|
129
|
+
"""Whether the mic test is done, `elapsed` seconds in. `heard_at` is when
|
|
130
|
+
speech was first heard (None: not yet); `silent_secs` is the quiet since."""
|
|
131
|
+
if heard_at is None:
|
|
132
|
+
return elapsed >= _WAIT_FOR_SPEECH_SECS
|
|
133
|
+
return (silent_secs >= _STOP_SILENCE_SECS
|
|
134
|
+
or elapsed - heard_at >= _MAX_SPEECH_SECS)
|
|
135
|
+
|
|
136
|
+
|
|
119
137
|
def _streaming_test(model=None, language: str | None = None) -> str:
|
|
120
138
|
"""Record audio and stream transcription results in real-time. Returns transcribed text."""
|
|
121
139
|
import numpy as np
|
|
@@ -127,7 +145,6 @@ def _streaming_test(model=None, language: str | None = None) -> str:
|
|
|
127
145
|
chunk_secs = 0.5
|
|
128
146
|
chunk_size = int(sample_rate * chunk_secs)
|
|
129
147
|
silence_threshold = 0.01
|
|
130
|
-
max_duration = 10
|
|
131
148
|
|
|
132
149
|
if model is None:
|
|
133
150
|
with Spinner("Loading model...") as sp:
|
|
@@ -142,27 +159,31 @@ def _streaming_test(model=None, language: str | None = None) -> str:
|
|
|
142
159
|
lang = language if language != "auto" else None
|
|
143
160
|
lang_str = lang or "en"
|
|
144
161
|
|
|
145
|
-
print(f"\n {YELLOW}Speak now!{RESET} (
|
|
162
|
+
print(f"\n {YELLOW}Speak now!{RESET} (stops {_STOP_SILENCE_SECS:g}s after you finish, "
|
|
163
|
+
f"waits up to {_WAIT_FOR_SPEECH_SECS}s for your voice)")
|
|
146
164
|
print(f" {DIM}{'─' * 40}{RESET}")
|
|
147
165
|
sys.stdout.write(f" {BOLD}")
|
|
148
166
|
sys.stdout.flush()
|
|
149
167
|
|
|
150
168
|
audio_chunks: list[np.ndarray] = []
|
|
151
|
-
silent_time = 0.0
|
|
169
|
+
silent_time = 0.0 # seconds of audio below the threshold, in a row
|
|
170
|
+
heard_sound = False # a chunk above the threshold arrived
|
|
171
|
+
heard_at: float | None = None
|
|
152
172
|
last_text = ""
|
|
153
173
|
last_text_len = 0 # characters printed on screen
|
|
154
174
|
recording = True
|
|
155
175
|
|
|
156
176
|
def callback(indata, frames, time_info, status):
|
|
157
|
-
nonlocal silent_time,
|
|
177
|
+
nonlocal silent_time, heard_sound
|
|
158
178
|
if not recording:
|
|
159
179
|
return
|
|
160
180
|
audio_chunks.append(indata.copy())
|
|
161
181
|
rms = np.sqrt(np.mean(indata ** 2))
|
|
162
182
|
if rms < silence_threshold:
|
|
163
|
-
silent_time +=
|
|
183
|
+
silent_time += frames / sample_rate
|
|
164
184
|
else:
|
|
165
185
|
silent_time = 0.0
|
|
186
|
+
heard_sound = True
|
|
166
187
|
|
|
167
188
|
stream = sd.InputStream(
|
|
168
189
|
samplerate=sample_rate, channels=1, dtype="float32",
|
|
@@ -170,18 +191,16 @@ def _streaming_test(model=None, language: str | None = None) -> str:
|
|
|
170
191
|
)
|
|
171
192
|
stream.start()
|
|
172
193
|
start_time = time.time()
|
|
194
|
+
elapsed = 0.0
|
|
173
195
|
|
|
174
196
|
try:
|
|
175
197
|
while recording:
|
|
176
198
|
time.sleep(0.8)
|
|
177
199
|
elapsed = time.time() - start_time
|
|
178
200
|
|
|
179
|
-
if
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
# Stop on sustained silence (but only after we've heard something)
|
|
184
|
-
if silent_time >= 1.5 and len(audio_chunks) > 3:
|
|
201
|
+
if heard_at is None and heard_sound:
|
|
202
|
+
heard_at = elapsed
|
|
203
|
+
if _test_should_stop(elapsed, heard_at, silent_time):
|
|
185
204
|
recording = False
|
|
186
205
|
break
|
|
187
206
|
|
|
@@ -199,6 +218,13 @@ def _streaming_test(model=None, language: str | None = None) -> str:
|
|
|
199
218
|
text = cleanup(text, lang_str)
|
|
200
219
|
|
|
201
220
|
if text and text != last_text:
|
|
221
|
+
# New words are speech too, even from a mic too quiet to
|
|
222
|
+
# cross the threshold: for that mic they are the only sign
|
|
223
|
+
# of speech, so they also hold off the silence stop.
|
|
224
|
+
if heard_at is None:
|
|
225
|
+
heard_at = time.time() - start_time
|
|
226
|
+
if not heard_sound:
|
|
227
|
+
silent_time = 0.0
|
|
202
228
|
# Clear previous text and rewrite
|
|
203
229
|
if last_text_len > 0:
|
|
204
230
|
sys.stdout.write("\b" * last_text_len + " " * last_text_len + "\b" * last_text_len)
|
|
@@ -209,6 +235,7 @@ def _streaming_test(model=None, language: str | None = None) -> str:
|
|
|
209
235
|
except KeyboardInterrupt:
|
|
210
236
|
pass
|
|
211
237
|
finally:
|
|
238
|
+
recording = False
|
|
212
239
|
stream.stop()
|
|
213
240
|
stream.close()
|
|
214
241
|
|
|
@@ -231,11 +258,23 @@ def _streaming_test(model=None, language: str | None = None) -> str:
|
|
|
231
258
|
if last_text:
|
|
232
259
|
print(f" {GREEN}✓{RESET} Transcribed successfully!")
|
|
233
260
|
else:
|
|
234
|
-
print(f" {YELLOW}⚠{RESET}
|
|
261
|
+
print(f" {YELLOW}⚠{RESET} {_no_speech_message(elapsed, bool(audio_chunks), heard_sound)}")
|
|
235
262
|
|
|
236
263
|
return last_text
|
|
237
264
|
|
|
238
265
|
|
|
266
|
+
def _no_speech_message(elapsed: float, got_audio: bool, heard_sound: bool) -> str:
|
|
267
|
+
if not got_audio:
|
|
268
|
+
return (f"The microphone delivered no audio in {elapsed:.0f}s. "
|
|
269
|
+
"Check the input device in your sound settings.")
|
|
270
|
+
if heard_sound:
|
|
271
|
+
return ("Heard sound, but no words were recognized. "
|
|
272
|
+
"Speak closer to the microphone or raise its input level.")
|
|
273
|
+
return (f"No speech arrived within {elapsed:.0f}s. Check your microphone. "
|
|
274
|
+
"If your audio goes through a remote desktop, IP-KVM or Bluetooth "
|
|
275
|
+
"link with a delay, keep talking until your words appear.")
|
|
276
|
+
|
|
277
|
+
|
|
239
278
|
def run_test() -> None:
|
|
240
279
|
"""Standalone test command: voiceio-test."""
|
|
241
280
|
print(f"{CYAN}{BOLD}voiceio doctor --live{RESET}\n")
|
|
@@ -387,7 +387,11 @@ def _select_output_backend(state: SetupState) -> None:
|
|
|
387
387
|
|
|
388
388
|
def _step_tts(state: SetupState) -> None:
|
|
389
389
|
_print_step(5, _TOTAL_STEPS, "Text-to-speech")
|
|
390
|
-
|
|
390
|
+
if state.backend == "socket":
|
|
391
|
+
print(f" {DIM}Select text and run 'voiceio speak' (bind it to a shortcut)"
|
|
392
|
+
f" to hear it spoken.{RESET}")
|
|
393
|
+
else:
|
|
394
|
+
print(f" {DIM}Select text and press ctrl+alt+s to hear it spoken.{RESET}")
|
|
391
395
|
print(f" {DIM}Engines: piper (offline), edge-tts (cloud), espeak-ng (system).{RESET}")
|
|
392
396
|
if not _tts_engine_installed():
|
|
393
397
|
print(f" {DIM}None is installed yet: 'Enabled' stays silent until you install one,"
|
|
@@ -61,8 +61,11 @@ class PiperEngine:
|
|
|
61
61
|
models_dir = _models_dir()
|
|
62
62
|
models_dir.mkdir(parents=True, exist_ok=True)
|
|
63
63
|
model_path = models_dir / f"{self._model_name}.onnx"
|
|
64
|
+
config_path = Path(f"{model_path}.json")
|
|
64
65
|
|
|
65
|
-
|
|
66
|
+
# Both files: an interrupted download leaves the .onnx without its
|
|
67
|
+
# .json, and loading that raises FileNotFoundError on every start.
|
|
68
|
+
if not (model_path.exists() and config_path.exists()):
|
|
66
69
|
log.info("TTS: downloading piper voice '%s'...", self._model_name)
|
|
67
70
|
download_voice(self._model_name, models_dir)
|
|
68
71
|
|
|
@@ -72,7 +75,7 @@ class PiperEngine:
|
|
|
72
75
|
# ours to write into.
|
|
73
76
|
self._voice = PiperVoice.load(
|
|
74
77
|
model_path,
|
|
75
|
-
config_path=
|
|
78
|
+
config_path=config_path,
|
|
76
79
|
download_dir=models_dir,
|
|
77
80
|
)
|
|
78
81
|
self._sample_rate = self._voice.config.sample_rate
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = "1.18.10"
|
|
File without changes
|
|
File without changes
|
{python_voiceio-1.18.10 → python_voiceio-1.18.12}/python_voiceio.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|