Free, open-source real-time voice changer for Windows: 20 live voices, local AI voice conversion (Seed-VC on ONNX Runtime), soundboard, virtual mic, hotkeys.
AI voices: smoothing setting that trades delay for accuracy
sky0c776b5ee441
diff --git a/README.md b/README.mdindex b677aec..8d966e3 100644--- a/README.md+++ b/README.md@@ -37,6 +37,8 @@ The standard installer is a web installer:- [x] **20 real-time voices**: robot, demon, deep, chipmunk, male↔female, radio, telephone, megaphone, cave, alien, ghost, auto-tune and more.- [x] **AI voices from your own recording.** Click **New AI voice**, then pick a clip or record 10 s of someone talking. It uses Seed-VC (Whisper encoder → diffusion transformer → BigVGAN) running locally on ONNX Runtime + DirectML, so it works on any DirectX 12 GPU.+ * **Quality (diffusion steps)**: more steps sound cleaner, with diminishing returns past about 10–15. Each step costs GPU time, so if the voice starts stuttering, lower it or raise smoothing. 6–8 is a good start; up to 30 is allowed.+ * **Smoothing (adds delay)**: `off` / `low` / `medium` / `high`. Higher levels give the model bigger chunks and a peek at what you say next, so the voice is more accurate and steadier, at the cost of extra delay (roughly +0.2 s, +0.5 s, +1 s). Handy for recording or streaming where lag doesn't matter. CLI: `--block-time` and `--lookahead`.- [x] **Soundboard**: point it at a folder of sounds and they mix into your mic.- [x] **Virtual microphone** (VB-CABLE), plus **hear myself** monitoring on your headphones.- [x] **Global hotkeys**: <kbd>Ctrl</kbd>+<kbd>Alt</kbd>+<kbd>F9</kbd> voice changer · <kbd>F10</kbd> hear myself · <kbd>F11</kbd> mute mic · <kbd>F12</kbd> stop sounds. You can change them in Settings.diff --git a/tests/test_smoothing.py b/tests/test_smoothing.pynew file mode 100644index 0000000..40d4947--- /dev/null+++ b/tests/test_smoothing.py@@ -0,0 +1,21 @@+from voxshift.presets import SMOOTHING, load_spec, smoothing_overrides+++def test_off_keeps_voice_settings():+ spec = {"block_time": 0.2, "extra_time_right": 0.02}+ assert smoothing_overrides(spec, "off") == {"block_time": 0.2}+++def test_levels_only_add_delay():+ spec = load_spec("ai-realtime")+ prev_block, prev_right = spec["block_time"], spec["extra_time_right"]+ for level in list(SMOOTHING)[1:]:+ o = smoothing_overrides(spec, level)+ assert o["block_time"] > prev_block+ assert o["extra_time_right"] >= prev_right+ prev_block, prev_right = o["block_time"], o["extra_time_right"]+++def test_unknown_level_falls_back_to_off():+ spec = {"block_time": 0.5}+ assert smoothing_overrides(spec, "bogus") == {"block_time": 0.5}diff --git a/voxshift/cli.py b/voxshift/cli.pyindex 7d9ad26..219624c 100644--- a/voxshift/cli.py+++ b/voxshift/cli.py@@ -10,7 +10,7 @@ import numpy as npdef _ai_overrides(a) -> dict:return {"diffusion_steps": a.diffusion_steps, "block_time": a.block_time,- "inference_cfg_rate": a.cfg_rate}+ "inference_cfg_rate": a.cfg_rate, "extra_time_right": a.lookahead}def cmd_devices(a):@@ -189,6 +189,8 @@ def build_parser() -> argparse.ArgumentParser:s.add_argument("--diffusion-steps", type=int)s.add_argument("--block-time", type=float)s.add_argument("--cfg-rate", type=float)+ s.add_argument("--lookahead", type=float,+ help="AI right look-ahead in seconds (more delay, more accurate)")s = sub.add_parser("convert", help="render a file through a voice")s.add_argument("input")diff --git a/voxshift/gui.py b/voxshift/gui.pyindex 34daed9..17b7717 100644--- a/voxshift/gui.py+++ b/voxshift/gui.py@@ -20,8 +20,8 @@ from . import __version__, winsysfrom .audio.cable import find_cables, install_vbcablefrom .audio.engine import AudioEngine, NoVirtualCable, default_hostapi, list_devicesfrom .paths import FROZEN, log_dir-from .presets import (NEEDS_DOWNLOAD, build_processor, create_ai_voice, delete_user_voice, is_ai, list_presets,- unavailable_reason)+from .presets import (NEEDS_DOWNLOAD, SMOOTHING, build_processor, create_ai_voice, delete_user_voice, is_ai,+ list_presets, smoothing_overrides, unavailable_reason)from .settings import SettingsSR = 48000@@ -296,8 +296,14 @@ class App:self.ai_box = ttk.Frame(right)ttk.Label(self.ai_box, text="Quality (diffusion steps)").pack(side="left")self.steps = tk.IntVar(value=self.s.diffusion_steps)- ttk.Spinbox(self.ai_box, from_=2, to=12, textvariable=self.steps, width=4,+ ttk.Spinbox(self.ai_box, from_=2, to=30, textvariable=self.steps, width=4,command=self._steps_changed).pack(side="left", padx=8)+ ttk.Label(self.ai_box, text="Smoothing (adds delay)").pack(side="left", padx=(12, 0))+ self.smoothing = tk.StringVar(value=self.s.ai_smoothing if self.s.ai_smoothing in SMOOTHING else "off")+ sm = ttk.Combobox(self.ai_box, textvariable=self.smoothing, values=list(SMOOTHING),+ state="readonly", width=7)+ sm.pack(side="left", padx=8)+ sm.bind("<<ComboboxSelected>>", lambda e: self._smoothing_changed())self.del_btn = ttk.Button(self.ai_box, text="Delete voice", command=self._delete_voice)self.progress = ttk.Progressbar(right, mode="indeterminate", length=240)@@ -374,10 +380,11 @@ class App:self.progress.start(12)self.status.set(f"Loading {spec.get('name')}…")steps = int(self.steps.get()) # Tk state is read on the UI thread only+ smooth = smoothing_overrides(spec, self.smoothing.get())def run():try:- proc = build_processor(spec, SR, diffusion_steps=steps, ai_mode="threaded")+ proc = build_processor(spec, SR, diffusion_steps=steps, ai_mode="threaded", **smooth)proc.warmup()self.call_soon(lambda: token == self._load_token and self._apply_processor(proc, spec))except Exception as e:@@ -403,6 +410,12 @@ class App:if self.current_key:self._load_processor(self.presets[self.current_key])+ def _smoothing_changed(self):+ self.s.ai_smoothing = self.smoothing.get()+ self.s.save()+ if self.current_key:+ self._load_processor(self.presets[self.current_key])+def _delete_voice(self):key = self.current_keyif key and messagebox.askyesno("Delete voice", f"Delete '{self.presets[key].get('name')}'?"):diff --git a/voxshift/presets.py b/voxshift/presets.pyindex 83a891a..9e5952a 100644--- a/voxshift/presets.py+++ b/voxshift/presets.py@@ -14,6 +14,26 @@ BUILTIN_DIR = Path(__file__).resolve().parent / "voices"ONNX_MODEL = "whisper-small-bigvgan"NEEDS_DOWNLOAD = "AI voices need a one-time download (about 820 MB)"+# AI "smoothing": trade extra delay for accuracy. Each level scales the voice's+# block size (more context per pass, more time per pass for diffusion steps) and+# sets the right look-ahead (the model hears a bit of what comes next).+# (block_time multiplier, extra_time_right seconds)+SMOOTHING = {+ "off": (1.0, None), # the voice's own settings+ "low": (1.5, 0.10),+ "medium": (2.0, 0.25),+ "high": (3.0, 0.50),+}+++def smoothing_overrides(spec: dict, level: str) -> dict:+ """StreamConfig overrides for an AI voice at a smoothing level."""+ mult, right = SMOOTHING.get(level, SMOOTHING["off"])+ out = {"block_time": round(float(spec.get("block_time", 0.3)) * mult, 3)}+ if right is not None:+ out["extra_time_right"] = max(right, float(spec.get("extra_time_right", 0.02)))+ return out+def preset_dirs() -> list[Path]:return [BUILTIN_DIR, user_voices_dir()]diff --git a/voxshift/settings.py b/voxshift/settings.pyindex 78711d0..6e8469c 100644--- a/voxshift/settings.py+++ b/voxshift/settings.py@@ -20,6 +20,7 @@ class Settings:output_gain_db: float = 0.0monitor_gain_db: float = -6.0diffusion_steps: int = 6+ ai_smoothing: str = "off" # presets.SMOOTHING levelsoundboard_dir: str = ""start_minimized: bool = Falseclose_to_tray: bool = True