diff --git a/src/api/types.ts b/src/api/types.ts index ad9650d..dc25bcc 100644 --- a/src/api/types.ts +++ b/src/api/types.ts @@ -437,6 +437,7 @@ export interface SpeechCredential { deepgram_tts_uri: null | string; deepgram_stt_use_tls: number; speechmatics_stt_uri: null | string; + playht_tts_uri: null | string; } export interface Alert { diff --git a/src/containers/internal/views/speech-services/form.tsx b/src/containers/internal/views/speech-services/form.tsx index 81ddbcf..63af793 100644 --- a/src/containers/internal/views/speech-services/form.tsx +++ b/src/containers/internal/views/speech-services/form.tsx @@ -192,7 +192,10 @@ export const SpeechServiceForm = ({ credential }: SpeechServiceFormProps) => { AWS_CREDENTIAL_ACCESS_KEY, ); const [roleArn, setRoleArn] = useState(""); - + const [playhtTtsUri, setPlayhtTtsUri] = useState(""); + const [tmpPlayhtTtsUri, setTmpPlayhtTtsUri] = useState(""); + const [initialPlayhtOnpremCheck, setInitialPlayhtOnpremCheck] = + useState(false); const handleFile = (file: File) => { const handleError = () => { setGoogleServiceKey(null); @@ -440,6 +443,9 @@ export const SpeechServiceForm = ({ credential }: SpeechServiceFormProps) => { ...(vendor === VENDOR_VERBIO && { engine_version: engineVersion, }), + ...(vendor === VENDOR_PLAYHT && { + playht_tts_uri: playhtTtsUri || null, + }), }; if (credential && credential.data) { @@ -739,6 +745,9 @@ export const SpeechServiceForm = ({ credential }: SpeechServiceFormProps) => { if (credential.data.model_id && vendor === VENDOR_OPENAI) { setSttModelId(credential.data.model_id); } + if (credential?.data?.playht_tts_uri) { + setPlayhtTtsUri(credential.data.playht_tts_uri); + } } if (credential?.data?.options) { setOptions(credential.data.options); @@ -801,6 +810,7 @@ export const SpeechServiceForm = ({ credential }: SpeechServiceFormProps) => { ); setSpeechmaticsEndpoint(credential.data.speechmatics_stt_uri); } + setInitialPlayhtOnpremCheck(hasValue(credential?.data?.playht_tts_uri)); }, [credential]); const updateCustomVoices = ( @@ -1557,25 +1567,120 @@ export const SpeechServiceForm = ({ credential }: SpeechServiceFormProps) => { vendor === VENDOR_CARTESIA || vendor === VENDOR_OPENAI || vendor === VENDOR_SPEECHMATICS) && ( -
+ <> {vendor === VENDOR_PLAYHT && ( - <> - - { - setUserId(e.target.value); +
+ + + +
)}
+ )} {(vendor == VENDOR_ELEVENLABS || vendor == VENDOR_WHISPER ||