[GH-ISSUE #1592] [Issue] feat: make TTS voice-lookup path configurable per provider #824

Closed
opened 2026-10-21 05:21:32 +07:00 by bsakaguchi · 2 comments
Owner

Originally created by @Gunterlie on GitHub (May 29, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/1592

Originally assigned to: @cha1latte on GitHub.

feat: make TTS voice-lookup path configurable per provider

Summary

Marinara hardcodes /audio/voices as the path for OpenAI-compatible voice discovery. Servers that implement an OpenAI-style TTS API but expose their voice list under a different path (e.g. /v1/voices, /voices, or a completely custom route) cannot be used for voice lookup without forking the binary. Adding a single voicesPath config field — defaulting to /audio/voices — unblocks every such server at zero cost to users who never change the default.

OpenAI's official API does not define a voice-listing endpoint at all. Their TTS voices (alloy, echo, fable, onyx, nova, shimmer) are documented as a fixed enum — there is no published GET /audio/voices route in the OpenAI spec. The path /audio/voices is a de-facto convention adopted by OpenAI-compatible servers (LocalAI and others), not an OpenAI standard. Because there is no standard, implementations vary — making the path hardcoded is the wrong default.

Expected behavior

A user running a custom or self-hosted OpenAI-compatible TTS server can enter the path their server uses for voice listing (e.g. /voices) in the TTS settings. Marinara uses that path instead of the hardcoded one. Users who leave the field blank get the current behavior unchanged.

Actual behavior

The voices path is hardcoded in openai_voices_url():

// src-tauri/src/commands/storage/integrations/tts.rs, line 489
fn openai_voices_url(base: &str, model: Option<&str>) -> String {
    let raw_url = format!("{base}/audio/voices");  // ← not configurable
    ...
}

Any server that exposes its voice catalog under a different path returns a 404 or an unexpected response. Marinara falls back to a static hardcoded list and the user sees no provider voices — with no indication of why.

Steps to reproduce

  1. Configure a custom OpenAI-compatible TTS server whose voice endpoint is GET /v1/voices (no /audio/ segment)
  2. Enter its base URL in TTS settings
  3. Open the voice picker — only the built-in fallback list appears, not the server's voices
  4. Server logs show a 404 for GET /v1/audio/voices

Environment

  • Marinara Engine version: Refactor branch
  • Affected providers: all OpenAI-compatible sources (source: "openai", NanoGPT, and any custom baseUrl)
  • Not affected: ElevenLabs (uses its own dedicated path), PocketTTS (no live lookup)

Proposed fix

Part A — Add voicesPath to the TTS config schema

New optional field, validated the same way as baseUrl (trimmed, leading slash normalized). Empty string = use the default.

Part B — Read voicesPath in openai_voices_url()

// src-tauri/src/commands/storage/integrations/tts.rs
fn openai_voices_url(base: &str, model: Option<&str>, voices_path: &str) -> String {
    let path = voices_path.trim().trim_start_matches('/');
    let path = if path.is_empty() { "audio/voices" } else { path };
    let raw_url = format!("{base}/{path}");
    let Ok(mut url) = reqwest::Url::parse(&raw_url) else {
        return raw_url;
    };
    if let Some(model) = model.map(str::trim).filter(|v| !v.is_empty()) {
        url.query_pairs_mut().append_pair("model", model);
    }
    url.to_string()
}

Part C — Expose voicesPath in TTSConfigCard

Add a text input below the existing baseUrl field. Placeholder: /audio/voices. Only shown when source is "openai" or a custom provider (hide for ElevenLabs and PocketTTS, which have fixed paths).

Part D — Persist via tts_config mutation

voicesPath gets written and read through the existing "app-settings" / "tts" store — no new storage key required.

Scope

  • One new config key (voicesPath)
  • One changed function signature (openai_voices_url gains a voices_path: &str parameter)
  • One new UI input in TTSConfigCard.tsx
  • No changes to ElevenLabs, PocketTTS

Template check

  • I DID NOT read this template and provide the requested details.
Originally created by @Gunterlie on GitHub (May 29, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/1592 Originally assigned to: @cha1latte on GitHub. # feat: make TTS voice-lookup path configurable per provider ## Summary Marinara hardcodes `/audio/voices` as the path for OpenAI-compatible voice discovery. Servers that implement an OpenAI-style TTS API but expose their voice list under a different path (e.g. `/v1/voices`, `/voices`, or a completely custom route) cannot be used for voice lookup without forking the binary. Adding a single `voicesPath` config field — defaulting to `/audio/voices` — unblocks every such server at zero cost to users who never change the default. **OpenAI's official API does not define a voice-listing endpoint at all. Their TTS voices (alloy, echo, fable, onyx, nova, shimmer) are documented as a fixed enum — there is no published `GET /audio/voices` route in the OpenAI spec. The path `/audio/voices` is a de-facto convention adopted by OpenAI-compatible servers (LocalAI and others), not an OpenAI standard. Because there is no standard, implementations vary — making the path hardcoded is the wrong default.** ## Expected behavior A user running a custom or self-hosted OpenAI-compatible TTS server can enter the path their server uses for voice listing (e.g. `/voices`) in the TTS settings. Marinara uses that path instead of the hardcoded one. Users who leave the field blank get the current behavior unchanged. ## Actual behavior The voices path is hardcoded in `openai_voices_url()`: ```rust // src-tauri/src/commands/storage/integrations/tts.rs, line 489 fn openai_voices_url(base: &str, model: Option<&str>) -> String { let raw_url = format!("{base}/audio/voices"); // ← not configurable ... } ``` Any server that exposes its voice catalog under a different path returns a 404 or an unexpected response. Marinara falls back to a static hardcoded list and the user sees no provider voices — with no indication of why. ## Steps to reproduce 1. Configure a custom OpenAI-compatible TTS server whose voice endpoint is `GET /v1/voices` (no `/audio/` segment) 2. Enter its base URL in TTS settings 3. Open the voice picker — only the built-in fallback list appears, not the server's voices 4. Server logs show a 404 for `GET /v1/audio/voices` ## Environment - Marinara Engine version: Refactor branch - Affected providers: all OpenAI-compatible sources (`source: "openai"`, NanoGPT, and any custom `baseUrl`) - Not affected: ElevenLabs (uses its own dedicated path), PocketTTS (no live lookup) ## Proposed fix **Part A — Add `voicesPath` to the TTS config schema** New optional field, validated the same way as `baseUrl` (trimmed, leading slash normalized). Empty string = use the default. **Part B — Read `voicesPath` in `openai_voices_url()`** ```rust // src-tauri/src/commands/storage/integrations/tts.rs fn openai_voices_url(base: &str, model: Option<&str>, voices_path: &str) -> String { let path = voices_path.trim().trim_start_matches('/'); let path = if path.is_empty() { "audio/voices" } else { path }; let raw_url = format!("{base}/{path}"); let Ok(mut url) = reqwest::Url::parse(&raw_url) else { return raw_url; }; if let Some(model) = model.map(str::trim).filter(|v| !v.is_empty()) { url.query_pairs_mut().append_pair("model", model); } url.to_string() } ``` **Part C — Expose `voicesPath` in `TTSConfigCard`** Add a text input below the existing `baseUrl` field. Placeholder: `/audio/voices`. Only shown when `source` is `"openai"` or a custom provider (hide for ElevenLabs and PocketTTS, which have fixed paths). **Part D — Persist via `tts_config` mutation** `voicesPath` gets written and read through the existing `"app-settings"` / `"tts"` store — no new storage key required. ## Scope - One new config key (`voicesPath`) - One changed function signature (`openai_voices_url` gains a `voices_path: &str` parameter) - One new UI input in `TTSConfigCard.tsx` - No changes to ElevenLabs, PocketTTS ## Template check - [ ] I DID NOT read this template and provide the requested details.
Author
Owner

@cha1latte commented on GitHub (May 29, 2026):

Triage note: labeling this as normal-scope because it adds a provider-specific voice lookup path while preserving /audio/voices as the default.

A good first slice is a single optional config field plus voice-discovery validation.

<!-- gh-comment-id:4578275016 --> @cha1latte commented on GitHub (May 29, 2026): Triage note: labeling this as `normal-scope` because it adds a provider-specific voice lookup path while preserving `/audio/voices` as the default. A good first slice is a single optional config field plus voice-discovery validation.
Author
Owner

@cha1latte commented on GitHub (May 31, 2026):

closed in #1744

<!-- gh-comment-id:4587976516 --> @cha1latte commented on GitHub (May 31, 2026): closed in #1744
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Pasta-Devs/Marinara-Engine#824
No description provided.