@@ -473,10 +473,11 @@ export const useSpeechStore = defineStore('speech', () => {
473473
474474 function resolveVoicePackSpeechInput ( options : VoicePackSpeechInputOptions ) : VoicePackSpeechInput {
475475 const providerConfig = { ...options . providerConfig }
476+ const canUseSSML = options . supportsSSML === true
476477
477478 if ( ! options . params ) {
478479 return {
479- input : options . forceSSML
480+ input : options . forceSSML === true && canUseSSML
480481 ? generateSSML ( options . text , options . voice , providerConfig )
481482 : options . text ,
482483 providerConfig,
@@ -493,6 +494,8 @@ export const useSpeechStore = defineStore('speech', () => {
493494 if ( speed != null )
494495 providerConfig . speed = speed
495496
497+ const shouldUseSSML = canUseSSML && ( options . forceSSML === true || ( needsProsody && ! options . supportsAdapterProsody ) )
498+
496499 if ( options . voicePack ) {
497500 providerConfig . extraBody = {
498501 ...( providerConfig . extraBody as Record < string , unknown > | undefined ) ,
@@ -511,11 +514,11 @@ export const useSpeechStore = defineStore('speech', () => {
511514 voice_pack : { pitch, volume } ,
512515 }
513516 }
514- else if ( needsProsody && ! options . forceSSML && ! options . supportsSSML ) {
517+ else if ( needsProsody && ! options . supportsAdapterProsody && ! shouldUseSSML ) {
515518 throw new Error ( 'Voice Pack pitch and volume parameters require an SSML-capable speech provider.' )
516519 }
517520
518- if ( ! options . forceSSML && ( ! needsProsody || options . supportsAdapterProsody ) ) {
521+ if ( ! shouldUseSSML && ( ! needsProsody || options . supportsAdapterProsody ) ) {
519522 return {
520523 input : options . text ,
521524 providerConfig,
0 commit comments