Skip to content

VoiceStudio is the open-source, fully-local ElevenLabs alternative — voice cloning, voice design, video dubbing, dictation, transcription & audiobook creation in 646 languages.

fix: honor the chosen install location and expose Supertonic-3 preset voices

velixio84ae4fd80228
diff --git a/CHANGELOG.md b/CHANGELOG.md
index abbe0d4ad..19984a7e2 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -16,6 +16,11 @@ metadata and the backend fallback mirror it.
- Preview iOS and Android companion apps: drive your own VoiceStudio from your phone (speak, voices and cloning, dubbing, dictation) after pairing by QR code; build from source for now ([guide](docs/mobile.md)) (#2965)
+### Fixed
+
+- The install location chosen in first-run setup now also holds your data, model cache and temp files instead of quietly filling `C:`, and the setup screen shows each path (#2971, #PR)
+- Supertonic-3's preset voices can be picked in the voice controls and are used for generation (#2938, #PR)
+
### Docs
- Contributor guides and the pull request template explain how to sign the CLA before opening a first pull request (#2676)
diff --git a/backend/api/routers/generation.py b/backend/api/routers/generation.py
index c7d645c16..90bfec4b1 100644
--- a/backend/api/routers/generation.py
+++ b/backend/api/routers/generation.py
@@ -1218,7 +1218,7 @@ def _run_backend_inference(
used_seed, effect_preset="broadcast",
max_chunk_chars=None, crossfade_ms=None, *, t_shift=None,
layer_penalty_factor=None, position_temperature=None,
- class_temperature=None, dropped_sink=None,
+ class_temperature=None, dropped_sink=None, preset_voice=None,
):
"""Engine-aware twin of :func:`_run_inference` (issue #312).
@@ -1241,6 +1241,8 @@ def _run_backend_inference(
instruct=instruct, num_step=num_step, guidance_scale=guidance_scale,
speed=speed, denoise=denoise, postprocess_output=postprocess_output,
)
+ if preset_voice:
+ gen_kwargs["voice"] = preset_voice
native_proxy = bool(
getattr(backend, "supports_native_omnivoice_controls", False)
)
@@ -1697,6 +1699,9 @@ async def generate_speech(
effect_preset: str = Form("broadcast"),
wav_bits: Literal["16", "24", "32"] = Form("16"),
engine: Optional[str] = Form(None),
+ # #2938: one of the engine's built-in voices (``preset_voices`` in the engine
+ # list). Only for engines that ship presets and no cloning reference.
+ preset_voice: Optional[str] = Form(None),
# Wave 1.2 — unlimited-length generation: long text is split at sentence
# boundaries and crossfaded. 0 disables chunking (whole text to engine).
max_chunk_chars: int = Form(800, ge=0),
@@ -1826,6 +1831,18 @@ async def generate_speech(
from api.routers.engines import _get_engine_instance
_backend = _get_engine_instance(backend_cls)
+ preset_voice = (preset_voice or "").strip() or None
+ if preset_voice:
+ from services.tts_backend import preset_voices_of
+ _presets = preset_voices_of(backend_cls)
+ if not _presets:
+ preset_voice = None # engine has no presets: ignore, like other engine-specific fields
+ elif preset_voice not in _presets:
+ raise HTTPException(
+ status_code=422,
+ detail=f"Unknown preset voice {preset_voice!r}. Valid: {', '.join(_presets)}",
+ )
+
# ── Routing gate (#21 — no silent CPU fallback). Computed ONCE per
# request (host caps are constant; the per-request engine= override
# bypasses the /engines/select gate, so this is the only place it's
@@ -2199,6 +2216,7 @@ async def generate_speech(
position_temperature=position_temperature,
class_temperature=class_temperature,
dropped_sink=_dropped_sink,
+ preset_voice=preset_voice,
),
what="TTS generate",
min_vram_gb=_engine_min_vram_gb,
@@ -2427,6 +2445,7 @@ async def generate_speech(
position_temperature=position_temperature,
class_temperature=class_temperature,
dropped_sink=_dropped_text,
+ preset_voice=preset_voice,
)
else:
_local_render = functools.partial(
diff --git a/backend/engines/supertonic3/backend.py b/backend/engines/supertonic3/backend.py
index 3b7bce218..4d814a20e 100644
--- a/backend/engines/supertonic3/backend.py
+++ b/backend/engines/supertonic3/backend.py
@@ -81,6 +81,10 @@ class Supertonic3Backend(SubprocessBackend):
display_name = "Supertonic-3 (31 langs, CPU ONNX, 7 preset voices, OpenRAIL-M)"
supports_voice_design = False # preset voices only
supports_cloning = False # preset voices only; generate() never reads ref_audio
+ #: Selectable built-in voices; /generate's ``preset_voice`` and the voice
+ #: picker read these (#2938). Same list ``generate()`` validates against.
+ PRESET_VOICES = list(st3_constants.VOICE_PRESETS)
+ DEFAULT_VOICE = st3_constants.DEFAULT_VOICE
# TTS-04: honest hardware reporting. Supertonic-3 has no CUDA / MPS
# path in the SDK ‑‑ ONNX Runtime CPU EP only.
gpu_compat: tuple[str, ...] = ("cpu",)
diff --git a/backend/services/tts_backend.py b/backend/services/tts_backend.py
index bab75f4c3..36b9856c2 100644
--- a/backend/services/tts_backend.py
+++ b/backend/services/tts_backend.py
@@ -3552,6 +3552,14 @@ def voice_design_support(cls) -> Optional[bool]:
return value if isinstance(value, bool) else None
+def preset_voices_of(cls) -> list[str]:
+ """Built-in voice ids an engine class exposes for selection (empty if none)."""
+ voices = getattr(cls, "PRESET_VOICES", None)
+ if not isinstance(voices, (list, tuple)):
+ return []
+ return [v for v in voices if isinstance(v, str)]
+
+
def list_backends(*, include_hidden: bool = False) -> list[dict]:
"""Enumerate the engine catalogue with each backend's availability state.
@@ -3584,6 +3592,8 @@ def list_backends(*, include_hidden: bool = False) -> list[dict]:
"instruct_vocabulary": "tags" | "freeform", # OmniVoice tag set vs model-native text
"supports_voice_design": Optional[bool], # False = needs a reference clip;
# None = undeclared (design allowed)
+ "preset_voices": list[str], # built-in voice ids a request may pick (``voice``); [] = none
+ "default_voice": Optional[str], # preset used when none is picked
"max_ref_seconds": Optional[float], # seconds of a clone clip the engine uses
"ref_strategy": Optional[str], # "best_window" | "head" | "full"; None = unverified
"effective_device": str, # device this engine uses on THIS host
@@ -3715,6 +3725,8 @@ def list_backends(*, include_hidden: bool = False) -> list[dict]:
# Reference-length truth (#2281): how much of a clone clip the
# engine really uses and how it picks it. None = not verified.
"max_ref_seconds": getattr(cls, "max_ref_seconds", None),
+ "preset_voices": preset_voices_of(cls),
+ "default_voice": getattr(cls, "DEFAULT_VOICE", None) if preset_voices_of(cls) else None,
"ref_strategy": getattr(cls, "ref_strategy", None),
"install_hint": _INSTALL_HINTS.get(bid),
# Exact `export VAR=...` line for path-gated opt-in engines, or None.
diff --git a/docs/install/uninstall.md b/docs/install/uninstall.md
index c5aa3d356..fa9f75c29 100644
--- a/docs/install/uninstall.md
+++ b/docs/install/uninstall.md
@@ -170,7 +170,8 @@ model paths don't hit the 260-character `MAX_PATH` limit.
set `OMNIVOICE_DATA_DIR` / `OMNIVOICE_CACHE_DIR` / `HF_HOME` /
`HF_HUB_CACHE`), your data is there instead of the defaults above. A Python
runtime you moved to another drive lives in the `VoiceStudio` folder you
- picked.
+ picked. When you picked that folder during first-run setup, your data and models
+ live inside it too (`data`, `models`) and are offered as separate choices.
- **Portable mode:** everything lives in an `OmniVoiceStudio-Data/` folder next
to the app binary — delete that one folder and you're done.
- **App-managed engine sidecars:** if VoiceStudio installed IndexTTS 2.5,
diff --git a/docs/install/windows.md b/docs/install/windows.md
index 22d8e70fe..c938eaf3b 100644
--- a/docs/install/windows.md
+++ b/docs/install/windows.md
@@ -72,11 +72,14 @@ drive (for example an external SSD):
1. Run the installer and choose the external drive on its **Installation
Folder** page.
-2. On the setup screen, press **Change…** beside **App environment** to put the
- Python environment on the drive. uv's download cache and managed Python stay
- beside that environment, so multi-GB wheels are not staged on `C:`.
-3. In **Settings > Storage**, move the application data folder (voices,
- projects, settings) and the model cache to the drive.
+2. On the setup screen, press **Change…** beside **App environment** and pick
+ the drive. That one folder then holds the Python environment, uv's download
+ cache, managed Python, your data (`data`), the model cache (`models`) and
+ scratch files (`tmp`), so nothing is staged on `C:`. The setup screen lists
+ each effective location. Variables you set yourself (`OMNIVOICE_DATA_DIR`,
+ `OMNIVOICE_CACHE_DIR`, `TEMP`) win over the folder.
+3. An existing installation is never moved. To relocate its data or model cache
+ later, use **Settings > Storage**.
The drive must be connected when VoiceStudio starts.
diff --git a/electron/src/main/backend-setup.test.ts b/electron/src/main/backend-setup.test.ts
index 7d7589ee5..4927652cf 100644
--- a/electron/src/main/backend-setup.test.ts
+++ b/electron/src/main/backend-setup.test.ts
@@ -589,7 +589,7 @@ it('installs into a newly selected custom destination that does not yet exist',
await supervisor.start();
await supervisor.setupRuntime();
expect(mocks.install.mock.calls[0][1]).toBe(join(selected, 'project'));
- expect(mocks.runtimeConfig).toEqual({ root: selected, owned: true });
+ expect(mocks.runtimeConfig).toEqual({ root: selected, owned: true, scoped: false });
await supervisor.shutdown();
});
@@ -616,7 +616,7 @@ it.each([[[] as string[]], [['.DS_Store', 'desktop.ini']]])(
await supervisor.start();
await supervisor.setupRuntime();
expect(mocks.install.mock.calls[0][1]).toBe(join(selected, 'project'));
- expect(mocks.runtimeConfig).toEqual({ root: selected, owned: true });
+ expect(mocks.runtimeConfig).toEqual({ root: selected, owned: true, scoped: false });
await supervisor.shutdown();
},
);
diff --git a/electron/src/main/backend.ts b/electron/src/main/backend.ts
index 00a336857..788878131 100644
--- a/electron/src/main/backend.ts
+++ b/electron/src/main/backend.ts
@@ -15,6 +15,7 @@ import { devProbeStamped, writeDevProbeStamp } from './dev-probe-stamp';
import { CrashJournal } from './crash-journal';
import { nativeFaultSummary } from '../shared/utils/crashReport';
import { availableBackendPort } from './backend-port';
+import { scopedStorage, scopedStorageEnv, type ScopedStorage } from './storage-scope';
import { legacyStorageEnv } from './legacy-storage';
import { spawn, spawnSync, type ChildProcess, type StdioOptions } from 'node:child_process';
import { EventEmitter } from 'node:events';
@@ -102,6 +103,8 @@ export function isExpectedPipeClose(error: unknown): boolean {
interface RuntimeLocationConfig {
root: string;
owned: boolean;
+ /** Chosen during first-run setup: data, models and temp live beside the runtime. */
+ scoped: boolean;
}
function runtimePreferencesPath(): string {
@@ -338,9 +341,9 @@ function storedRuntimeLocation(): RuntimeLocationConfig | null {
try {
const parsed = JSON.parse(
readFileSync(join(app.getPath('userData'), RUNTIME_LOCATION_FILE), 'utf8'),
- ) as { root?: unknown; owned?: unknown };
+ ) as { root?: unknown; owned?: unknown; scoped?: unknown };
return typeof parsed.root === 'string' && isAbsolute(parsed.root)
- ? { root: resolve(parsed.root), owned: parsed.owned === true }
+ ? { root: resolve(parsed.root), owned: parsed.owned === true, scoped: parsed.scoped === true }
: null;
} catch {
return null;
@@ -351,10 +354,20 @@ function storedRuntimeRoot(): string | null {
return storedRuntimeLocation()?.root ?? null;
}
-function writeRuntimeLocation(root: string, owned: boolean): void {
+function writeRuntimeLocation(
+ root: string,
+ owned: boolean,
+ scoped: boolean = storedRuntimeLocation()?.scoped === true,
+): void {
const locationFile = join(app.getPath('userData'), RUNTIME_LOCATION_FILE);
mkdirSync(dirname(locationFile), { recursive: true });
- writeFileSync(locationFile, JSON.stringify({ root: resolve(root), owned }), 'utf8');
+ writeFileSync(locationFile, JSON.stringify({ root: resolve(root), owned, scoped }), 'utf8');
+}
+
+/** The recorded first-run location whose data/models/temp follow the runtime, if any. */
+function scopedRuntimeRoot(): string | null {
+ const stored = storedRuntimeLocation();
+ return stored?.scoped && !samePath(stored.root, defaultRuntimeRoot()) ? stored.root : null;
}
function selectedRuntimeRoot(parent: string): string {
@@ -458,6 +471,17 @@ function childEnv(
...(app.isPackaged ? legacyStorageEnv(legacyTauriRoots()) : {}),
...process.env,
};
+ const scopedRoot = app.isPackaged ? scopedRuntimeRoot() : null;
+ if (scopedRoot) {
+ Object.assign(env, scopedStorageEnv(scopedRoot, env));
+ for (const dir of [scopedStorage(scopedRoot).temp]) {
+ try {
+ mkdirSync(dir, { recursive: true });
+ } catch {
+ /* An unwritable folder surfaces through the setup space/permission checks. */
+ }
+ }
+ }
const packagedToken =
typeof __POSTHOG_PROJECT_TOKEN__ === 'string' ? __POSTHOG_PROJECT_TOKEN__ : '';
const packagedHost = typeof __POSTHOG_HOST__ === 'string' ? __POSTHOG_HOST__ : '';
@@ -660,6 +684,7 @@ export class BackendSupervisor extends EventEmitter<{
defaultRuntimeRoot(),
),
runtimeRegion: this.runtimeRegion,
+ ...this.runtimeStorage(),
}
: {}),
};
@@ -1083,6 +1108,12 @@ export class BackendSupervisor extends EventEmitter<{
return this.connection;
}
+ private runtimeStorage(): { runtimeStorage?: ScopedStorage } {
+ const scoped = scopedRuntimeRoot();
+ const root = this.runtimeProject ? dirname(this.runtimeProject) : null;
+ return scoped && root && samePath(scoped, root) ? { runtimeStorage: scopedStorage(scoped) } : {};
+ }
+
setRuntimeLocation(parent: string | null): { path: string; custom: boolean } {
if (
!app.isPackaged ||
@@ -1097,7 +1128,7 @@ export class BackendSupervisor extends EventEmitter<{
if (samePath(root, defaultRoot)) {
rmSync(locationFile, { force: true });
} else {
- writeRuntimeLocation(root, false);
+ writeRuntimeLocation(root, false, true);
}
this.runtimeProject = join(root, 'project');
this.message = undefined;
@@ -1127,6 +1158,17 @@ export class BackendSupervisor extends EventEmitter<{
: null;
}
+ /**
+ * What an uninstall may remove from the runtime location. A location chosen in
+ * setup also holds the user's data and models, which the uninstall prompt
+ * handles as separate choices, so only the runtime's own folders are listed.
+ */
+ get ownedRuntimeEntries(): string | string[] | null {
+ const root = this.ownedRuntimeRoot;
+ if (!root || storedRuntimeLocation()?.scoped !== true) return root;
+ return ['project', '.uv-cache', '.python', '.tmp', 'tmp'].map((name) => join(root, name));
+ }
+
websocketUrl(path: '/ws/transcribe' | '/ws/events' | '/ws/tts'): Promise<string> {
return remoteWebSocketUrl(this.baseUrl, path, this.remoteUrl ? this.activeSession() : null);
}
diff --git a/electron/src/main/ipc.ts b/electron/src/main/ipc.ts
index 1d00cd345..1764f0fb5 100644
--- a/electron/src/main/ipc.ts
+++ b/electron/src/main/ipc.ts
@@ -302,7 +302,7 @@ async function uninstallRoots(supervisor: BackendSupervisor): Promise<UninstallR
return {
data: roots.data,
environment: app.getPath('userData'),
- runtimeEnvironment: supervisor.ownedRuntimeRoot,
+ runtimeEnvironment: supervisor.ownedRuntimeEntries,
logs: app.getPath('logs'),
userEnvironment: join(homedir(), '.config', 'omnivoice'),
models: roots.models,
diff --git a/electron/src/main/runtime-project.test.ts b/electron/src/main/runtime-project.test.ts
index 9e6a9b411..5f4308e91 100644
--- a/electron/src/main/runtime-project.test.ts
+++ b/electron/src/main/runtime-project.test.ts
@@ -265,6 +265,8 @@ describe('packaged runtime setup', () => {
const syncEnv = run.mock.calls[0]?.[3];
expect(syncEnv?.UV_CACHE_DIR).toBe(join(project, '..', '.uv-cache'));
+ for (const key of ['TEMP', 'TMP', 'TMPDIR'])
+ expect(syncEnv?.[key]).toBe(join(project, '..', '.tmp'));
expect(syncEnv?.UV_PYTHON_INSTALL_DIR).toBe(join(project, '..', '.python'));
});
it('uses managed Python for new runtime setup and verifies native tokenizer imports', async () => {
diff --git a/electron/src/main/runtime-project.ts b/electron/src/main/runtime-project.ts
index f5fa1ab5e..bdfc09e5b 100644
--- a/electron/src/main/runtime-project.ts
+++ b/electron/src/main/runtime-project.ts
@@ -542,6 +542,10 @@ export async function installRuntime(
))
)
uv = privateUv;
+ // #2971: uv and pip unpack wheels into the temp dir. Left at the system default
+ // it fills the system drive even when the runtime was placed on another one.
+ const scratch = join(project, '..', '.tmp');
+ await mkdir(scratch, { recursive: true });
const env: NodeJS.ProcessEnv = {
...downloadProxyEnv(),
...(await runtimeDownloadEnv(region, signal)),
@@ -550,6 +554,9 @@ export async function installRuntime(
// rebuild a broken venv without paying the multi-gigabyte transfer twice.
UV_CACHE_DIR: join(project, '..', '.uv-cache'),
UV_PYTHON_INSTALL_DIR: join(project, '..', '.python'),
+ TEMP: scratch,
+ TMP: scratch,
+ TMPDIR: scratch,
};
if (!uv) {
phase('downloading_uv');
diff --git a/electron/src/main/storage-scope.test.ts b/electron/src/main/storage-scope.test.ts
new file mode 100644
index 000000000..a261fcdd4
--- /dev/null
+++ b/electron/src/main/storage-scope.test.ts
@@ -0,0 +1,25 @@
+// @vitest-environment node
+import { expect, it } from 'vitest';
+import { join } from 'node:path';
+import { scopedStorage, scopedStorageEnv } from './storage-scope';
+
+const root = join('E:', 'VoiceStudio');
+
+it('puts data, models and every temp variable under the chosen location (#2971)', () => {
+ const s = scopedStorage(root);
+ expect(scopedStorageEnv(root)).toEqual({
+ OMNIVOICE_DATA_DIR: s.data,
+ OMNIVOICE_CACHE_DIR: s.models,
+ TEMP: s.temp,
+ TMP: s.temp,
+ TMPDIR: s.temp,
+ });
+ expect(s.data.startsWith(root) && s.models.startsWith(root) && s.temp.startsWith(root)).toBe(true);
+});
+
+it('keeps values the user already set explicitly', () => {
+ const out = scopedStorageEnv(root, { OMNIVOICE_CACHE_DIR: 'D:\\models', TEMP: 'D:\\t' });
+ expect(out.OMNIVOICE_CACHE_DIR).toBeUndefined();
+ expect(out.TEMP).toBeUndefined();
+ expect(out.OMNIVOICE_DATA_DIR).toBe(scopedStorage(root).data);
+});
diff --git a/electron/src/main/storage-scope.ts b/electron/src/main/storage-scope.ts
new file mode 100644
index 000000000..f1737e4ea
--- /dev/null
+++ b/electron/src/main/storage-scope.ts
@@ -0,0 +1,37 @@
+import { join } from 'node:path';
+
+/** What a user-chosen setup location holds, beyond the Python runtime itself. */
+export interface ScopedStorage {
+ data: string;
+ models: string;
+ temp: string;
+}
+
+export function scopedStorage(root: string): ScopedStorage {
+ return { data: join(root, 'data'), models: join(root, 'models'), temp: join(root, 'tmp') };
+}
+
+/**
+ * Child-process defaults for a location chosen during first-run setup (#2971).
+ * One folder owns the user's data, the model/HF cache and scratch space, so
+ * nothing quietly lands on the system drive and fills it. Explicit user
+ * environment values are kept; an existing install (no recorded choice) never
+ * reaches this and so never has data moved or redirected.
+ */
+export function scopedStorageEnv(
+ root: string,
+ env: NodeJS.ProcessEnv = {},
+): NodeJS.ProcessEnv {
+ const s = scopedStorage(root);
+ const out: NodeJS.ProcessEnv = {};
+ const set = (key: string, value: string) => {
+ if (!env[key]?.trim()) out[key] = value;
+ };
+ set('OMNIVOICE_DATA_DIR', s.data);
+ set('OMNIVOICE_CACHE_DIR', s.models);
+ // Temp must move as a set: Windows tools read TEMP/TMP, POSIX tools TMPDIR.
+ set('TEMP', s.temp);
+ set('TMP', s.temp);
+ set('TMPDIR', s.temp);
+ return out;
+}
diff --git a/electron/src/main/uninstall-data.test.ts b/electron/src/main/uninstall-data.test.ts
index 83ed8df3c..66611585f 100644
--- a/electron/src/main/uninstall-data.test.ts
+++ b/electron/src/main/uninstall-data.test.ts
@@ -67,3 +67,23 @@ it('does not offer a nested private model directory as a separately shared targe
});
expect(targets.some((target) => target.key === 'models')).toBe(false);
});
+
+it('lists a setup-chosen location by its runtime folders so data and models stay separate choices (#2971)', async () => {
+ const roots = await fixture();
+ const chosen = join(roots.root, 'E', 'VoiceStudio');
+ const data = join(chosen, 'data');
+ const entries = [join(chosen, 'project'), join(chosen, '.uv-cache')];
+ for (const path of [data, ...entries]) await mkdir(path, { recursive: true });
+ const targets = await scanUninstallTargets({
+ ...roots,
+ data,
+ models: join(chosen, 'models'),
+ runtimeEnvironment: entries,
+ });
+ const paths = targets.map((target) => target.path);
+ expect(paths).toEqual(expect.arrayContaining([data, ...entries]));
+ expect(paths).not.toContain(chosen);
+ const plan = await createUninstallPlan(targets.filter((t) => t.path !== data), false, null);
+ expect(plan.paths).toEqual(expect.arrayContaining(entries));
+ expect(plan.paths).not.toContain(data);
+});
diff --git a/electron/src/main/uninstall-data.ts b/electron/src/main/uninstall-data.ts
index 9974b9d55..dd03bc3db 100644
--- a/electron/src/main/uninstall-data.ts
+++ b/electron/src/main/uninstall-data.ts
@@ -11,7 +11,8 @@ import {
export interface UninstallRoots {
data: string;
environment: string;
- runtimeEnvironment?: string | null;
+ /** The runtime Electron created; a list when data/models share its folder and must stay separate targets. */
+ runtimeEnvironment?: string | string[] | null;
logs: string | null;
userEnvironment: string;
models: string;
@@ -58,9 +59,11 @@ export async function scanUninstallTargets(roots: UninstallRoots): Promise<Unins
const candidates = uniqueRoots([
{ key: 'data', path: roots.data, shared: false },
{ key: 'env', path: roots.environment, shared: false },
- ...(roots.runtimeEnvironment
- ? [{ key: 'env' as const, path: roots.runtimeEnvironment, shared: false }]
- : []),
+ ...[roots.runtimeEnvironment ?? []].flat().map((path) => ({
+ key: 'env' as const,
+ path,
+ shared: false,
+ })),
...(roots.logs ? [{ key: 'logs' as const, path: roots.logs, shared: false }] : []),
{ key: 'userenv', path: roots.userEnvironment, shared: false },
...(!modelNested
diff --git a/electron/src/preload/index.d.ts b/electron/src/preload/index.d.ts
index c60857f65..1bd662874 100644
--- a/electron/src/preload/index.d.ts
+++ b/electron/src/preload/index.d.ts
@@ -77,6 +77,8 @@ export interface BackendStatus {
runtimePath?: string;
runtimeCustom?: boolean;
runtimeRegion?: RuntimeRegion;
+ /** Where data, models and temp files go when the location was chosen during setup. */
+ runtimeStorage?: { data: string; models: string; temp: string };
}
export type RuntimeRegion = 'auto' | 'global' | 'china' | 'russia' | 'restricted';
diff --git a/electron/src/renderer/src/components/backend-gate.tsx b/electron/src/renderer/src/components/backend-gate.tsx
index be3ce7f19..303d3797b 100644
--- a/electron/src/renderer/src/components/backend-gate.tsx
+++ b/electron/src/renderer/src/components/backend-gate.tsx
@@ -449,7 +449,7 @@ export function BackendGate({ children, repairDock }: BackendGateProps) {
<div className="min-w-0 flex-1">
<p className="text-sm font-medium">{t('firstrun.env_dir')}</p>
<p className="mt-0.5 text-xs text-muted-foreground">
- {t('firstrun.env_dir_desc')}
+ {t(status.runtimeStorage ? 'firstrun.env_dir_desc_scoped' : 'firstrun.env_dir_desc')}
</p>
<p
className="mt-2 truncate font-mono text-xs text-muted-foreground"
@@ -457,6 +457,21 @@ export function BackendGate({ children, repairDock }: BackendGateProps) {
>
{status.runtimePath}
</p>
+ {status.runtimeStorage && (
+ <dl className="mt-2 space-y-0.5 text-xs text-muted-foreground">
+ {(['data', 'models', 'temp'] as const).map((kind) => (
+ <div key={kind} className="flex gap-2">
+ <dt className="shrink-0">{t(`firstrun.storage_${kind}`)}</dt>
+ <dd
+ className="min-w-0 truncate font-mono"
+ title={status.runtimeStorage?.[kind]}
+ >
+ {status.runtimeStorage?.[kind]}
+ </dd>
+ </div>
+ ))}
+ </dl>
+ )}
</div>
</div>
<div className="mt-3 flex justify-end gap-2">
diff --git a/electron/src/renderer/src/features/clone/action-bar.tsx b/electron/src/renderer/src/features/clone/action-bar.tsx
index e9f6d7482..01adfb1c1 100644
--- a/electron/src/renderer/src/features/clone/action-bar.tsx
+++ b/electron/src/renderer/src/features/clone/action-bar.tsx
@@ -42,6 +42,7 @@ import {
} from '@/lib/store/clone-settings';
import { cn } from '@/lib/utils';
import { EngineLanguagePicker } from './engine-language-picker';
+import { PresetVoicePicker } from './preset-voice-picker';
import { QualityControls } from './quality-controls';
import { CloneDemoAction } from './clone-demo';
import { useCloneDemo } from '@/hooks/use-clone-demo';
@@ -408,6 +409,7 @@ export function ActionBar() {
<div className="flex flex-wrap items-center gap-3">
<div className="flex items-center gap-1 rounded-lg bg-background/50 p-1 ring-1 ring-border/50">
<EngineLanguagePicker />
+ <PresetVoicePicker disabled={isGenerating} />
<span aria-hidden="true" className="mx-1 h-4 w-px bg-border" />
<QualityControls disabled={isGenerating} />
<VoiceControls />
diff --git a/electron/src/renderer/src/features/clone/preset-voice-picker.test.tsx b/electron/src/renderer/src/features/clone/preset-voice-picker.test.tsx
new file mode 100644
index 000000000..d106fefda
--- /dev/null
+++ b/electron/src/renderer/src/features/clone/preset-voice-picker.test.tsx
@@ -0,0 +1,29 @@
+import { cleanup, fireEvent, render, screen } from '@testing-library/react';
+import { afterEach, beforeEach, expect, it, vi } from 'vitest';
+import { PresetVoicePicker } from './preset-voice-picker';
+import { cloneSettingsStore, DEFAULT_CLONE_SETTINGS } from '@/lib/store/clone-settings';
+
+const engine = vi.hoisted(() => ({
+ active: null as { preset_voices?: string[]; default_voice?: string | null } | null,
+}));
+vi.mock('@/hooks/use-engines', () => ({ useEngines: () => ({ activeTts: engine.active }) }));
+vi.mock('react-i18next', () => ({ useTranslation: () => ({ t: (key: string) => key }) }));
+
+beforeEach(() => cloneSettingsStore.setState(() => ({ ...DEFAULT_CLONE_SETTINGS })));
+afterEach(cleanup);
+
+it('lists the engine presets and stores the pick (#2938)', () => {
+ engine.active = { preset_voices: ['M1', 'F3'], default_voice: 'M1' };
+ render(<PresetVoicePicker />);
+ const select = screen.getByRole('combobox', { name: 'presetVoice.label' }) as HTMLSelectElement;
+ expect(select.value).toBe('M1');
+ expect([...select.options].map((o) => o.value)).toEqual(['M1', 'F3']);
+ fireEvent.change(select, { target: { value: 'F3' } });
+ expect(cloneSettingsStore.state.presetVoice).toBe('F3');
+});
+
+it('renders nothing for engines without presets', () => {
+ engine.active = { preset_voices: [] };
+ const { container } = render(<PresetVoicePicker />);
+ expect(container).toBeEmptyDOMElement();
+});
diff --git a/electron/src/renderer/src/features/clone/preset-voice-picker.tsx b/electron/src/renderer/src/features/clone/preset-voice-picker.tsx
new file mode 100644
index 000000000..2d4b2a5c4
--- /dev/null
+++ b/electron/src/renderer/src/features/clone/preset-voice-picker.tsx
@@ -0,0 +1,33 @@
+import { useTranslation } from 'react-i18next';
+import { useEngines } from '@/hooks/use-engines';
+import { setCloneSetting, useCloneSettings } from '@/lib/store/clone-settings';
+
+/** Built-in voices of engines that ship presets instead of cloning (e.g. Supertonic-3, #2938). */
+export function PresetVoicePicker({ disabled = false }: { disabled?: boolean }) {
+ const { t } = useTranslation();
+ const { activeTts } = useEngines();
+ const settings = useCloneSettings();
+ const voices = activeTts?.preset_voices ?? [];
+ if (!voices.length) return null;
+ const value = voices.includes(settings.presetVoice)
+ ? settings.presetVoice
+ : (activeTts?.default_voice ?? voices[0]);
+ return (
+ <label className="flex items-center gap-1.5 px-2 text-xs">
+ <span className="text-muted-foreground">{t('presetVoice.label')}</span>
+ <select
+ aria-label={t('presetVoice.label')}
+ className="rounded-md border border-border/60 bg-background px-1.5 py-1 text-xs"
+ value={value}
+ disabled={disabled}
+ onChange={(event) => setCloneSetting('presetVoice', event.target.value)}
+ >
+ {voices.map((voice) => (
+ <option key={voice} value={voice}>
+ {voice}
+ </option>
+ ))}
+ </select>
+ </label>
+ );
+}
diff --git a/electron/src/renderer/src/hooks/use-generate.ts b/electron/src/renderer/src/hooks/use-generate.ts
index 8abb47dd9..b6c32c66d 100644
--- a/electron/src/renderer/src/hooks/use-generate.ts
+++ b/electron/src/renderer/src/hooks/use-generate.ts
@@ -335,6 +335,9 @@ function useGenerateController(): UseGenerateClone {
),
wavBits: settings.wavBits,
effectPreset: settings.effectPreset,
+ presetVoice: activeTts?.preset_voices?.includes(settings.presetVoice)
+ ? settings.presetVoice
+ : undefined,
cfg: settings.cfg,
speed: settings.speed,
tShift: settings.tShift,
@@ -389,7 +392,7 @@ function useGenerateController(): UseGenerateClone {
.catch(() => {});
}
},
- [queryClient, onProgress, blocker, designBlockerFor, instructVocabulary],
+ [queryClient, onProgress, blocker, designBlockerFor, instructVocabulary, activeTts],
);
const cancel = useCallback(() => {
diff --git a/electron/src/renderer/src/i18n/locales/ar.json b/electron/src/renderer/src/i18n/locales/ar.json
index 878488ce8..e9e74e4e9 100644
--- a/electron/src/renderer/src/i18n/locales/ar.json
+++ b/electron/src/renderer/src/i18n/locales/ar.json
@@ -22,6 +22,9 @@
"preset32": "أصلي",
"sizeUnknown": "يظهر الحجم بعد إنشاء الصوت."
},
+ "presetVoice": {
+ "label": "الصوت الجاهز"
+ },
"audioQuality": {
"check": "فحص الصوت",
"failed": "تحليل الصوت غير متاح.",
@@ -2294,6 +2297,10 @@
"lib_show_all": "عرض {{count}} نموذجًا اختياريًا",
"env_dir": "بيئة التطبيق",
"env_dir_desc": "بيئة Python ومكتبات الذكاء الاصطناعي.",
+ "env_dir_desc_scoped": "بيئة Python ومكتبات الذكاء الاصطناعي والنماذج وبياناتك والملفات المؤقتة.",
+ "storage_data": "البيانات",
+ "storage_models": "النماذج",
+ "storage_temp": "الملفات المؤقتة",
"change": "تغيير…",
"reset_default": "إعادة التعيين إلى الوضع الافتراضي",
"region_label": "منطقة التنزيل"
diff --git a/electron/src/renderer/src/i18n/locales/de.json b/electron/src/renderer/src/i18n/locales/de.json
index 3a476d101..ae35491a5 100644
--- a/electron/src/renderer/src/i18n/locales/de.json
+++ b/electron/src/renderer/src/i18n/locales/de.json
@@ -22,6 +22,9 @@
"preset32": "Original",
"sizeUnknown": "Die Größe wird nach der Erzeugung angezeigt."
},
+ "presetVoice": {
+ "label": "Voreingestellte Stimme"
+ },
"audioQuality": {
"check": "Audio prüfen",
"failed": "Audioanalyse nicht verfügbar.",
@@ -2286,6 +2289,10 @@
"lib_show_all": "{{count}} optionale Modelle anzeigen",
"env_dir": "App-Umgebung",
"env_dir_desc": "Python-Runtime und KI-Bibliotheken.",
+ "env_dir_desc_scoped": "Python-Laufzeit, KI-Bibliotheken, Modelle, deine Daten und temporäre Dateien.",
+ "storage_data": "Daten",
+ "storage_models": "Modelle",
+ "storage_temp": "Temporäre Dateien",
"change": "Ändern…",
"reset_default": "Auf Standard zurücksetzen",
"region_label": "Download-Region"
diff --git a/electron/src/renderer/src/i18n/locales/en.json b/electron/src/renderer/src/i18n/locales/en.json
index 73cb05747..32b5e14aa 100644
--- a/electron/src/renderer/src/i18n/locales/en.json
+++ b/electron/src/renderer/src/i18n/locales/en.json
@@ -22,6 +22,9 @@
"preset32": "Original",
"sizeUnknown": "Size shown after generation."
},
+ "presetVoice": {
+ "label": "Preset voice"
+ },
"audioQuality": {
"check": "Check audio",
"failed": "Audio analysis unavailable.",
@@ -2343,6 +2346,10 @@
"lib_show_all": "Show {{count}} more models",
"env_dir": "App environment",
"env_dir_desc": "Python runtime and AI libraries.",
+ "env_dir_desc_scoped": "Python runtime, AI libraries, models, your data and temp files.",
+ "storage_data": "Data",
+ "storage_models": "Models",
+ "storage_temp": "Temp files",
"change": "Change…",
"reset_default": "Reset to default",
"region_label": "Download region"
diff --git a/electron/src/renderer/src/i18n/locales/es.json b/electron/src/renderer/src/i18n/locales/es.json
index a96464926..9aeb47399 100644
--- a/electron/src/renderer/src/i18n/locales/es.json
+++ b/electron/src/renderer/src/i18n/locales/es.json
@@ -22,6 +22,9 @@
"preset32": "Original",
"sizeUnknown": "El tamaño se muestra después de generar el audio."
},
+ "presetVoice": {
+ "label": "Voz predefinida"
+ },
"audioQuality": {
"check": "Revisar audio",
"failed": "Análisis de audio no disponible.",
@@ -2288,6 +2291,10 @@
"lib_show_all": "Mostrar {{count}} modelos opcionales",
"env_dir": "Entorno de la aplicación",
"env_dir_desc": "Runtime de Python y bibliotecas de IA.",
+ "env_dir_desc_scoped": "Entorno de Python, bibliotecas de IA, modelos, tus datos y archivos temporales.",
+ "storage_data": "Datos",
+ "storage_models": "Modelos",
+ "storage_temp": "Archivos temporales",
"change": "Cambiar…",
"reset_default": "Restablecer los valores predeterminados",
"region_label": "Región de descarga"
diff --git a/electron/src/renderer/src/i18n/locales/fr.json b/electron/src/renderer/src/i18n/locales/fr.json
index 5463ff265..eb637a850 100644
--- a/electron/src/renderer/src/i18n/locales/fr.json
+++ b/electron/src/renderer/src/i18n/locales/fr.json
@@ -22,6 +22,9 @@
"preset32": "Original",
"sizeUnknown": "La taille sera affichée après la génération."
},
+ "presetVoice": {
+ "label": "Voix prédéfinie"
+ },
"audioQuality": {
"check": "Vérifier l’audio",
"failed": "Analyse audio indisponible.",
@@ -2288,6 +2291,10 @@
"lib_show_all": "Afficher {{count}} modèles optionnels",
"env_dir": "Environnement de l'application",
"env_dir_desc": "Runtime Python et bibliothèques d'IA.",
+ "env_dir_desc_scoped": "Environnement Python, bibliothèques d'IA, modèles, vos données et fichiers temporaires.",
+ "storage_data": "Données",
+ "storage_models": "Modèles",
+ "storage_temp": "Fichiers temporaires",
"change": "Modifier…",
"reset_default": "Réinitialiser aux valeurs par défaut",
"region_label": "Région de téléchargement"
diff --git a/electron/src/renderer/src/i18n/locales/hi.json b/electron/src/renderer/src/i18n/locales/hi.json
index 97422a188..dbfad0f94 100644
--- a/electron/src/renderer/src/i18n/locales/hi.json
+++ b/electron/src/renderer/src/i18n/locales/hi.json
@@ -22,6 +22,9 @@
"preset32": "मूल",
"sizeUnknown": "ऑडियो बनने के बाद आकार दिखेगा।"
},
+ "presetVoice": {
+ "label": "प्रीसेट आवाज़"
+ },
"audioQuality": {
"check": "ऑडियो जाँचें",
"failed": "ऑडियो विश्लेषण उपलब्ध नहीं है।",
@@ -2286,6 +2289,10 @@
"lib_show_all": "{{count}} वैकल्पिक मॉडल दिखाएँ",
"env_dir": "ऐप एनवायरनमेंट",
"env_dir_desc": "Python रनटाइम और AI लाइब्रेरीज़।",
+ "env_dir_desc_scoped": "Python रनटाइम, AI लाइब्रेरी, मॉडल, आपका डेटा और अस्थायी फ़ाइलें।",
+ "storage_data": "डेटा",
+ "storage_models": "मॉडल",
+ "storage_temp": "अस्थायी फ़ाइलें",
"change": "बदलें…",
"reset_default": "डिफ़ॉल्ट पर रीसेट करें",
"region_label": "डाउनलोड क्षेत्र"
diff --git a/electron/src/renderer/src/i18n/locales/id.json b/electron/src/renderer/src/i18n/locales/id.json
index 341c510a7..fed09ed76 100644
--- a/electron/src/renderer/src/i18n/locales/id.json
+++ b/electron/src/renderer/src/i18n/locales/id.json
@@ -22,6 +22,9 @@
"preset32": "Asli",
"sizeUnknown": "Ukuran ditampilkan setelah audio dibuat."
},
+ "presetVoice": {
+ "label": "Suara bawaan"
+ },
"audioQuality": {
"check": "Periksa audio",
"failed": "Analisis audio tidak tersedia.",
@@ -2286,6 +2289,10 @@
"lib_show_all": "Tampilkan {{count}} model opsional",
"env_dir": "Lingkungan aplikasi",
"env_dir_desc": "Runtime Python dan pustaka AI.",
+ "env_dir_desc_scoped": "Runtime Python, pustaka AI, model, data Anda, dan file sementara.",
+ "storage_data": "Data",
+ "storage_models": "Model",
+ "storage_temp": "File sementara",
"change": "Ubah…",
"reset_default": "Atur ulang ke default",
"region_label": "Wilayah unduhan"
diff --git a/electron/src/renderer/src/i18n/locales/it.json b/electron/src/renderer/src/i18n/locales/it.json
index 6d566614d..aa5fee35c 100644
--- a/electron/src/renderer/src/i18n/locales/it.json
+++ b/electron/src/renderer/src/i18n/locales/it.json
@@ -22,6 +22,9 @@
"preset32": "Originale",
"sizeUnknown": "La dimensione viene mostrata dopo la generazione."
},
+ "presetVoice": {
+ "label": "Voce predefinita"
+ },
"audioQuality": {
"check": "Controlla audio",
"failed": "Analisi audio non disponibile.",
@@ -2288,6 +2291,10 @@
"lib_show_all": "Mostra {{count}} modelli opzionali",
"env_dir": "Ambiente dell'app",
"env_dir_desc": "Runtime Python e librerie IA.",
+ "env_dir_desc_scoped": "Runtime Python, librerie IA, modelli, i tuoi dati e file temporanei.",
+ "storage_data": "Dati",
+ "storage_models": "Modelli",
+ "storage_temp": "File temporanei",
"change": "Cambia…",
"reset_default": "Ripristina le impostazioni predefinite",
"region_label": "Area di download"
diff --git a/electron/src/renderer/src/i18n/locales/ja.json b/electron/src/renderer/src/i18n/locales/ja.json
index b7591621b..71d326c42 100644
--- a/electron/src/renderer/src/i18n/locales/ja.json
+++ b/electron/src/renderer/src/i18n/locales/ja.json
@@ -22,6 +22,9 @@
"preset32": "オリジナル",
"sizeUnknown": "生成後にサイズを表示します。"
},
+ "presetVoice": {
+ "label": "プリセット音声"
+ },
"audioQuality": {
"check": "音声を確認",
"failed": "音声を解析できません。",
@@ -2286,6 +2289,10 @@
"lib_show_all": "任意モデル {{count}} 件を表示",
"env_dir": "アプリ実行環境",
"env_dir_desc": "Python ランタイムと AI ライブラリ。",
+ "env_dir_desc_scoped": "Python ランタイム、AI ライブラリ、モデル、データ、一時ファイル。",
+ "storage_data": "データ",
+ "storage_models": "モデル",
+ "storage_temp": "一時ファイル",
"change": "変更…",
"reset_default": "デフォルトにリセットする",
"region_label": "ダウンロード地域"
diff --git a/electron/src/renderer/src/i18n/locales/ko.json b/electron/src/renderer/src/i18n/locales/ko.json
index 9d1215b8a..1d6987b8a 100644
--- a/electron/src/renderer/src/i18n/locales/ko.json
+++ b/electron/src/renderer/src/i18n/locales/ko.json
@@ -22,6 +22,9 @@
"preset32": "원본",
"sizeUnknown": "생성 후 파일 크기가 표시됩니다."
},
+ "presetVoice": {
+ "label": "프리셋 음성"
+ },
"audioQuality": {
"check": "오디오 확인",
"failed": "오디오를 분석할 수 없습니다.",
@@ -2286,6 +2289,10 @@
"lib_show_all": "모델 {{count}}개 더 보기",
"env_dir": "앱 실행 환경",
"env_dir_desc": "Python 런타임과 AI 라이브러리.",
+ "env_dir_desc_scoped": "Python 런타임, AI 라이브러리, 모델, 내 데이터와 임시 파일.",
+ "storage_data": "데이터",
+ "storage_models": "모델",
+ "storage_temp": "임시 파일",
"change": "변경…",
"reset_default": "기본값으로 재설정",
"region_label": "다운로드 지역"
diff --git a/electron/src/renderer/src/i18n/locales/nl.json b/electron/src/renderer/src/i18n/locales/nl.json
index 4b405d9ee..a631ccd6e 100644
--- a/electron/src/renderer/src/i18n/locales/nl.json
+++ b/electron/src/renderer/src/i18n/locales/nl.json
@@ -22,6 +22,9 @@
"preset32": "Origineel",
"sizeUnknown": "De grootte wordt na het genereren getoond."
},
+ "presetVoice": {
+ "label": "Voorgeprogrammeerde stem"
+ },
"audioQuality": {
"check": "Audio controleren",
"failed": "Audioanalyse niet beschikbaar.",
@@ -2286,6 +2289,10 @@
"lib_show_all": "Toon {{count}} optionele modellen",
"env_dir": "App-omgeving",
"env_dir_desc": "Python-runtime en AI-bibliotheken.",
+ "env_dir_desc_scoped": "Python-runtime, AI-bibliotheken, modellen, je gegevens en tijdelijke bestanden.",
+ "storage_data": "Gegevens",
+ "storage_models": "Modellen",
+ "storage_temp": "Tijdelijke bestanden",
"change": "Wijzigen…",
"reset_default": "Resetten naar standaard",
"region_label": "Downloadregio"
diff --git a/electron/src/renderer/src/i18n/locales/pl.json b/electron/src/renderer/src/i18n/locales/pl.json
index 766ae1ac8..6c3ac4ee0 100644
--- a/electron/src/renderer/src/i18n/locales/pl.json
+++ b/electron/src/renderer/src/i18n/locales/pl.json
@@ -22,6 +22,9 @@
"preset32": "Oryginalna",
"sizeUnknown": "Rozmiar pojawi się po wygenerowaniu."
},
+ "presetVoice": {
+ "label": "Głos wbudowany"
+ },
"audioQuality": {
"check": "Sprawdź dźwięk",
"failed": "Analiza dźwięku niedostępna.",
@@ -2290,6 +2293,10 @@
"lib_show_all": "Pokaż opcjonalne modele: {{count}}",
"env_dir": "Środowisko aplikacji",
"env_dir_desc": "Środowisko Python i biblioteki AI.",
+ "env_dir_desc_scoped": "Środowisko Python, biblioteki AI, modele, Twoje dane i pliki tymczasowe.",
+ "storage_data": "Dane",
+ "storage_models": "Modele",
+ "storage_temp": "Pliki tymczasowe",
"change": "Zmień…",
"reset_default": "Przywróć ustawienia domyślne",
"region_label": "Region pobierania"
diff --git a/electron/src/renderer/src/i18n/locales/pt.json b/electron/src/renderer/src/i18n/locales/pt.json
index 32dcc75a7..1c5099c20 100644
--- a/electron/src/renderer/src/i18n/locales/pt.json
+++ b/electron/src/renderer/src/i18n/locales/pt.json
@@ -22,6 +22,9 @@
"preset32": "Original",
"sizeUnknown": "O tamanho aparece após a geração."
},
+ "presetVoice": {
+ "label": "Voz predefinida"
+ },
"audioQuality": {
"check": "Verificar áudio",
"failed": "Análise de áudio indisponível.",
@@ -2288,6 +2291,10 @@
"lib_show_all": "Mostrar {{count}} modelos opcionais",
"env_dir": "Ambiente do aplicativo",
"env_dir_desc": "Runtime Python e bibliotecas de IA.",
+ "env_dir_desc_scoped": "Ambiente Python, bibliotecas de IA, modelos, seus dados e arquivos temporários.",
+ "storage_data": "Dados",
+ "storage_models": "Modelos",
+ "storage_temp": "Arquivos temporários",
"change": "Alterar…",
"reset_default": "Redefinir para o padrão",
"region_label": "Região de download"
diff --git a/electron/src/renderer/src/i18n/locales/ru.json b/electron/src/renderer/src/i18n/locales/ru.json
index dde141501..8a271d760 100644
--- a/electron/src/renderer/src/i18n/locales/ru.json
+++ b/electron/src/renderer/src/i18n/locales/ru.json
@@ -22,6 +22,9 @@
"preset32": "Оригинал",
"sizeUnknown": "Размер будет показан после генерации."
},
+ "presetVoice": {
+ "label": "Встроенный голос"
+ },
"audioQuality": {
"check": "Проверить аудио",
"failed": "Анализ аудио недоступен.",
@@ -2290,6 +2293,10 @@
"lib_show_all": "Показать опциональные модели: {{count}}",
"env_dir": "Среда приложения",
"env_dir_desc": "Python и библиотеки ИИ.",
+ "env_dir_desc_scoped": "Среда Python, ИИ-библиотеки, модели, ваши данные и временные файлы.",
+ "storage_data": "Данные",
+ "storage_models": "Модели",
+ "storage_temp": "Временные файлы",
"change": "Изменить…",
"reset_default": "Сбросить настройки по умолчанию",
"region_label": "Регион загрузки"
diff --git a/electron/src/renderer/src/i18n/locales/sv.json b/electron/src/renderer/src/i18n/locales/sv.json
index 25efc2956..ce28a1edf 100644
--- a/electron/src/renderer/src/i18n/locales/sv.json
+++ b/electron/src/renderer/src/i18n/locales/sv.json
@@ -22,6 +22,9 @@
"preset32": "Original",
"sizeUnknown": "Storleken visas efter genereringen."
},
+ "presetVoice": {
+ "label": "Förinställd röst"
+ },
"audioQuality": {
"check": "Kontrollera ljud",
"failed": "Ljudanalys är inte tillgänglig.",
@@ -2286,6 +2289,10 @@
"lib_show_all": "Visa {{count}} valfria modeller",
"env_dir": "Appmiljö",
"env_dir_desc": "Python-runtime och AI-bibliotek.",
+ "env_dir_desc_scoped": "Python-miljö, AI-bibliotek, modeller, dina data och tillfälliga filer.",
+ "storage_data": "Data",
+ "storage_models": "Modeller",
+ "storage_temp": "Tillfälliga filer",
"change": "Ändra…",
"reset_default": "Återställ till standard",
"region_label": "Nedladdningsregion"
diff --git a/electron/src/renderer/src/i18n/locales/th.json b/electron/src/renderer/src/i18n/locales/th.json
index a1daaace6..cbd70078e 100644
--- a/electron/src/renderer/src/i18n/locales/th.json
+++ b/electron/src/renderer/src/i18n/locales/th.json
@@ -22,6 +22,9 @@
"preset32": "ต้นฉบับ",
"sizeUnknown": "ขนาดจะแสดงหลังสร้างเสียงเสร็จ"
},
+ "presetVoice": {
+ "label": "เสียงที่ตั้งไว้ล่วงหน้า"
+ },
"audioQuality": {
"check": "ตรวจสอบเสียง",
"failed": "ไม่สามารถวิเคราะห์เสียงได้",
@@ -2286,6 +2289,10 @@
"lib_show_all": "แสดงโมเดลตัวเลือก {{count}} รายการ",
"env_dir": "สภาพแวดล้อมของแอป",
"env_dir_desc": "Python runtime และไลบรารี AI",
+ "env_dir_desc_scoped": "รันไทม์ Python ไลบรารี AI โมเดล ข้อมูลของคุณ และไฟล์ชั่วคราว",
+ "storage_data": "ข้อมูล",
+ "storage_models": "โมเดล",
+ "storage_temp": "ไฟล์ชั่วคราว",
"change": "เปลี่ยน…",
"reset_default": "รีเซ็ตเป็นค่าเริ่มต้น",
"region_label": "ภูมิภาคการดาวน์โหลด"
diff --git a/electron/src/renderer/src/i18n/locales/tr.json b/electron/src/renderer/src/i18n/locales/tr.json
index 1a11776d0..34ee65e8e 100644
--- a/electron/src/renderer/src/i18n/locales/tr.json
+++ b/electron/src/renderer/src/i18n/locales/tr.json
@@ -22,6 +22,9 @@
"preset32": "Orijinal",
"sizeUnknown": "Boyut, oluşturma tamamlandıktan sonra gösterilir."
},
+ "presetVoice": {
+ "label": "Hazır ses"
+ },
"audioQuality": {
"check": "Sesi kontrol et",
"failed": "Ses analizi kullanılamıyor.",
@@ -2286,6 +2289,10 @@
"lib_show_all": "{{count}} isteğe bağlı modeli göster",
"env_dir": "Uygulama ortamı",
"env_dir_desc": "Python çalışma zamanı ve yapay zekâ kitaplıkları.",
+ "env_dir_desc_scoped": "Python çalışma ortamı, yapay zeka kitaplıkları, modeller, verileriniz ve geçici dosyalar.",
+ "storage_data": "Veriler",
+ "storage_models": "Modeller",
+ "storage_temp": "Geçici dosyalar",
"change": "Değiştir…",
"reset_default": "Varsayılana sıfırla",
"region_label": "İndirme bölgesi"
diff --git a/electron/src/renderer/src/i18n/locales/uk.json b/electron/src/renderer/src/i18n/locales/uk.json
index 38156c48a..2d6520efc 100644
--- a/electron/src/renderer/src/i18n/locales/uk.json
+++ b/electron/src/renderer/src/i18n/locales/uk.json
@@ -22,6 +22,9 @@
"preset32": "Оригінал",
"sizeUnknown": "Розмір буде показано після генерації."
},
+ "presetVoice": {
+ "label": "Вбудований голос"
+ },
"audioQuality": {
"check": "Перевірити аудіо",
"failed": "Аналіз аудіо недоступний.",
@@ -2290,6 +2293,10 @@
"lib_show_all": "Показати опційні моделі: {{count}}",
"env_dir": "Середовище застосунку",
"env_dir_desc": "Python та бібліотеки ШІ.",
+ "env_dir_desc_scoped": "Середовище Python, ШІ-бібліотеки, моделі, ваші дані та тимчасові файли.",
+ "storage_data": "Дані",
+ "storage_models": "Моделі",
+ "storage_temp": "Тимчасові файли",
"change": "Змінити…",
"reset_default": "Скинути до замовчування",
"region_label": "Регіон завантаження"
diff --git a/electron/src/renderer/src/i18n/locales/vi.json b/electron/src/renderer/src/i18n/locales/vi.json
index c4836bb46..67e7ee433 100644
--- a/electron/src/renderer/src/i18n/locales/vi.json
+++ b/electron/src/renderer/src/i18n/locales/vi.json
@@ -22,6 +22,9 @@
"preset32": "Nguyên bản",
"sizeUnknown": "Kích thước hiển thị sau khi tạo âm thanh."
},
+ "presetVoice": {
+ "label": "Giọng có sẵn"
+ },
"audioQuality": {
"check": "Kiểm tra âm thanh",
"failed": "Không thể phân tích âm thanh.",
@@ -2286,6 +2289,10 @@
"lib_show_all": "Hiện {{count}} mô hình tùy chọn",
"env_dir": "Môi trường ứng dụng",
"env_dir_desc": "Python runtime và các thư viện AI.",
+ "env_dir_desc_scoped": "Runtime Python, thư viện AI, mô hình, dữ liệu của bạn và tệp tạm.",
+ "storage_data": "Dữ liệu",
+ "storage_models": "Mô hình",
+ "storage_temp": "Tệp tạm",
"change": "Thay đổi…",
"reset_default": "Đặt lại về mặc định",
"region_label": "Khu vực tải xuống"
diff --git a/electron/src/renderer/src/i18n/locales/zh-CN.json b/electron/src/renderer/src/i18n/locales/zh-CN.json
index 3e13b66f8..e38af135e 100644
--- a/electron/src/renderer/src/i18n/locales/zh-CN.json
+++ b/electron/src/renderer/src/i18n/locales/zh-CN.json
@@ -22,6 +22,9 @@
"preset32": "原始",
"sizeUnknown": "生成后显示文件大小。"
},
+ "presetVoice": {
+ "label": "预设声音"
+ },
"audioQuality": {
"check": "检查音频",
"failed": "音频分析不可用。",
@@ -2286,6 +2289,10 @@
"lib_show_all": "显示 {{count}} 个可选模型",
"env_dir": "应用环境",
"env_dir_desc": "Python 运行时与 AI 库。",
+ "env_dir_desc_scoped": "Python 运行时、AI 库、模型、你的数据和临时文件。",
+ "storage_data": "数据",
+ "storage_models": "模型",
+ "storage_temp": "临时文件",
"change": "更改…",
"reset_default": "恢复默认",
"region_label": "下载区域"
diff --git a/electron/src/renderer/src/i18n/locales/zh-TW.json b/electron/src/renderer/src/i18n/locales/zh-TW.json
index 6d6927fc8..17c1c650a 100644
--- a/electron/src/renderer/src/i18n/locales/zh-TW.json
+++ b/electron/src/renderer/src/i18n/locales/zh-TW.json
@@ -22,6 +22,9 @@
"preset32": "原始",
"sizeUnknown": "生成後顯示檔案大小。"
},
+ "presetVoice": {
+ "label": "預設聲音"
+ },
"audioQuality": {
"check": "檢查音訊",
"failed": "音訊分析無法使用。",
@@ -2286,6 +2289,10 @@
"lib_show_all": "顯示 {{count}} 個可選模型",
"env_dir": "應用程式環境",
"env_dir_desc": "Python 執行環境與 AI 函式庫。",
+ "env_dir_desc_scoped": "Python 執行環境、AI 程式庫、模型、你的資料與暫存檔案。",
+ "storage_data": "資料",
+ "storage_models": "模型",
+ "storage_temp": "暫存檔案",
"change": "變更…",
"reset_default": "重設為預設值",
"region_label": "下載區域"
diff --git a/electron/src/renderer/src/lib/api/generate.test.ts b/electron/src/renderer/src/lib/api/generate.test.ts
index 1a96e8076..afa9db70b 100644
--- a/electron/src/renderer/src/lib/api/generate.test.ts
+++ b/electron/src/renderer/src/lib/api/generate.test.ts
@@ -85,6 +85,11 @@ describe('sanitizeInstruct', () => {
});
describe('toGenerateForm', () => {
+ it('sends the picked preset voice only when one is set (#2938)', () => {
+ expect(toGenerateForm(BASE_INPUT).has('preset_voice')).toBe(false);
+ expect(toGenerateForm({ ...BASE_INPUT, presetVoice: 'F3' }).get('preset_voice')).toBe('F3');
+ });
+
it('keeps existing defaults and sends explicit quality choices', () => {
const defaults = toGenerateForm(BASE_INPUT);
expect(defaults.get('wav_bits')).toBe('16');
diff --git a/electron/src/renderer/src/lib/api/generate.ts b/electron/src/renderer/src/lib/api/generate.ts
index f76afea23..3db4ca524 100644
--- a/electron/src/renderer/src/lib/api/generate.ts
+++ b/electron/src/renderer/src/lib/api/generate.ts
@@ -139,6 +139,7 @@ export function toGenerateForm(input: CloneGenerateInput): FormData {
form.append('num_step', String(input.steps));
form.append('wav_bits', String(input.wavBits ?? 16));
form.append('effect_preset', input.effectPreset ?? 'broadcast');
+ if (input.presetVoice) form.append('preset_voice', input.presetVoice);
form.append('guidance_scale', String(input.cfg));
form.append('speed', String(input.speed));
form.append('denoise', String(input.denoise));
diff --git a/electron/src/renderer/src/lib/api/types.ts b/electron/src/renderer/src/lib/api/types.ts
index 2e205e4c5..58d5944ba 100644
--- a/electron/src/renderer/src/lib/api/types.ts
+++ b/electron/src/renderer/src/lib/api/types.ts
@@ -70,6 +70,9 @@ export interface EngineBackend {
reason: string | null;
hint?: string | null;
supports_cloning?: boolean | null;
+ /** Built-in voices a request may pick (`preset_voice`); empty or absent when the engine has none (#2938). */
+ preset_voices?: string[];
+ default_voice?: string | null;
/** False: needs a reference clip, so Voice Design is unavailable. Null/absent: undeclared. */
supports_voice_design?: boolean | null;
/** "tags" = OmniVoice's closed design vocabulary; "freeform" = sent as written (#2389). */
@@ -144,6 +147,8 @@ export interface DesignRecipe {
/** Everything the clone form sends. Names are the UI names; `toGenerateForm`
* in generate.ts maps them to the multipart field names. */
export interface CloneGenerateInput {
+ /** Built-in voice id for engines that ship presets. */
+ presetVoice?: string;
wavBits?: 16 | 24 | 32;
effectPreset?: 'broadcast' | 'raw';
seed?: number;
diff --git a/electron/src/renderer/src/lib/store/clone-settings.ts b/electron/src/renderer/src/lib/store/clone-settings.ts
index 1c9f4ab7d..37999bafb 100644
--- a/electron/src/renderer/src/lib/store/clone-settings.ts
+++ b/electron/src/renderer/src/lib/store/clone-settings.ts
@@ -14,6 +14,8 @@ export interface CloneSettings {
steps: number;
wavBits: 16 | 24 | 32;
effectPreset: 'broadcast' | 'raw';
+ /** Built-in voice id for preset engines; '' = the engine's default. */
+ presetVoice: string;
cfg: number;
speed: number;
tShift: number;
@@ -37,6 +39,7 @@ export const DEFAULT_CLONE_SETTINGS: CloneSettings = {
steps: 16, // ~16 avoids ODE destabilisation in the flow-matcher.
wavBits: 16,
effectPreset: 'broadcast',
+ presetVoice: '',
cfg: 2.0,
speed: 1.0,
tShift: 0.1,
diff --git a/electron/src/renderer/src/lib/store/takes.test.ts b/electron/src/renderer/src/lib/store/takes.test.ts
index bb41c167f..83524155c 100644
--- a/electron/src/renderer/src/lib/store/takes.test.ts
+++ b/electron/src/renderer/src/lib/store/takes.test.ts
@@ -55,6 +55,7 @@ describe('take metadata', () => {
steps: 32,
wavBits: 24,
effectPreset: 'raw',
+ presetVoice: 'F3',
cfg: 3,
speed: 0.8,
tShift: 0.3,
diff --git a/mobile/contract/openapi.json b/mobile/contract/openapi.json
index 7ac42dd88..a48fddf00 100644
--- a/mobile/contract/openapi.json
+++ b/mobile/contract/openapi.json
@@ -1234,6 +1234,17 @@
],
"title": "Postprocess Output"
},
+ "preset_voice": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "title": "Preset Voice"
+ },
"profile_id": {
"anyOf": [
{
diff --git a/tests/test_preset_voices_2938.py b/tests/test_preset_voices_2938.py
new file mode 100644
index 000000000..ddf6f9d2e
--- /dev/null
+++ b/tests/test_preset_voices_2938.py
@@ -0,0 +1,92 @@
+"""#2938: engines with built-in preset voices expose them and /generate honours the pick."""
+import importlib
+import os
+
+import pytest
+import torch
+
+os.environ.setdefault("OMNIVOICE_MODEL", "test")
+os.environ.setdefault("OMNIVOICE_DISABLE_FILE_LOG", "1")
+
+
+def _tts():
+ return importlib.import_module("services.tts_backend")
+
+
+def test_catalogue_lists_supertonic3_presets():
+ entries = {e["id"]: e for e in _tts().list_backends()}
+ from engines.supertonic3 import constants
+
+ entry = entries["supertonic3"]
+ assert entry["preset_voices"] == constants.VOICE_PRESETS
+ assert entry["default_voice"] == constants.DEFAULT_VOICE
+
+
+def test_engines_without_presets_list_none():
+ entries = {e["id"]: e for e in _tts().list_backends()}
+ assert entries["omnivoice"]["preset_voices"] == []
+ assert entries["omnivoice"]["default_voice"] is None
+
+
+def _engine():
+ class _Fake(_tts().TTSBackend):
+ id = "fake-presets-2938"
+ display_name = "Preset engine (test)"
+ supports_voice_design = False
+ supports_cloning = False
+ applies_own_mastering = False
+ gpu_compat = ("cpu",)
+ PRESET_VOICES = ["A1", "B2"]
+ DEFAULT_VOICE = "A1"
+ calls: list = []
+
+ @property
+ def sample_rate(self) -> int:
+ return 24000
+
+ @property
+ def supported_languages(self) -> list[str]:
+ return ["multi"]
+
+ @classmethod
+ def is_available(cls):
+ return True, "ready"
+
+ def generate(self, text, **kw) -> torch.Tensor:
+ type(self).calls.append(kw)
+ return torch.zeros(1, 2400)
+
+ _Fake.calls = []
+ return _Fake
+
+
+def client():
+ from fastapi.testclient import TestClient
+ from main import app
+
+ return TestClient(app, client=("127.0.0.1", 50000))
+
+
+def test_generate_forwards_the_picked_preset(client, monkeypatch):
+ fake = _engine()
+ monkeypatch.setitem(_tts()._REGISTRY, fake.id, fake)
+ res = client.post("/generate", data={"text": "Hello", "engine": fake.id, "preset_voice": "B2"})
+ assert res.status_code == 200, res.text
+ assert fake.calls and fake.calls[0]["voice"] == "B2"
+
+
+def test_generate_without_a_pick_leaves_the_engine_default(client, monkeypatch):
+ fake = _engine()
+ monkeypatch.setitem(_tts()._REGISTRY, fake.id, fake)
+ assert client.post("/generate", data={"text": "Hello", "engine": fake.id}).status_code == 200
+ assert "voice" not in fake.calls[0]
+
+
+def test_generate_rejects_an_unknown_preset(client, monkeypatch):
+ fake = _engine()
+ monkeypatch.setitem(_tts()._REGISTRY, fake.id, fake)
+ res = client.post("/generate", data={"text": "Hello", "engine": fake.id, "preset_voice": "Z9"})
+ assert res.status_code == 422
+ assert "A1" in res.json()["detail"]
+ assert fake.calls == []