@@ -290,7 +290,6 @@ function resolveConfiguredTTSRoute(cfg) {
290290 model,
291291 baseUrl,
292292 apiKey : asString ( provider . apiKey ) || defaultLocalAPIKey ,
293- voice : asString ( provider . voice ) || "default" ,
294293 } ;
295294}
296295
@@ -338,14 +337,19 @@ function buildTTSRequest(route, params, referenceAudioValue, referenceText) {
338337 if ( ! allowedResponseFormats . has ( responseFormat ) ) {
339338 throw new Error ( `unsupported response format: ${ responseFormat } ` ) ;
340339 }
340+ const mode = asString ( record . mode ) ;
341+ const explicitVoice = readStringParam ( record , [ "voice" ] ) ;
342+ const wantsClone = mode === "voice_clone" || asOptionalBoolean ( record . xVectorOnlyMode ?? record . x_vector_only_mode , false ) ;
343+ if ( wantsClone && ! referenceAudioValue ) {
344+ throw new Error ( "voice cloning requires referenceAudioPath" ) ;
345+ }
341346
342347 const payload = {
343348 model : route . model ,
344349 text : readStringParam ( record , [ "text" , "input" ] ) ,
345- voice : readStringParam ( record , [ "voice" ] ) || route . voice || "default" ,
346350 response_format : responseFormat ,
347- use_default_reference : asOptionalBoolean ( record . useDefaultReference ?? record . use_default_reference , true ) ,
348351 } ;
352+ if ( explicitVoice ) payload . voice = explicitVoice ;
349353
350354 for ( const [ source , target ] of [
351355 [ "mode" , "mode" ] ,
@@ -439,10 +443,6 @@ export default function register(api) {
439443 type : "boolean" ,
440444 description : "Force x-vector-only voice cloning when true." ,
441445 } ,
442- useDefaultReference : {
443- type : "boolean" ,
444- description : "Allow the backend to use its configured default reference voice when no reference audio path is supplied." ,
445- } ,
446446 language : {
447447 type : "string" ,
448448 description : "Optional language hint for the backend." ,
0 commit comments