support mod cartesia transcribe (#463)

This commit is contained in:
Hoan Luu Huu
2025-06-18 01:53:22 +07:00
committed by GitHub
parent fcff3d4b32
commit e2fc0216e1
3 changed files with 54 additions and 7 deletions
+18 -2
View File
@@ -49,6 +49,7 @@ const SttOpenaiLanguagesVoices = require('./speech-data/stt-openai');
const SttModelOpenai = require('./speech-data/stt-model-openai');
const sttModelDeepgram = require('./speech-data/stt-model-deepgram');
const sttModelCartesia = require('./speech-data/stt-model-cartesia');
function capitalizeFirst(str) {
if (!str) return str;
@@ -680,6 +681,7 @@ function decryptCredential(obj, credential, logger, isObscureKey = true) {
const o = JSON.parse(decrypt(credential));
obj.api_key = isObscureKey ? obscureKey(o.api_key) : o.api_key;
obj.model_id = o.model_id;
obj.stt_model_id = o.stt_model_id;
obj.options = o.options;
} else if ('rimelabs' === obj.vendor) {
const o = JSON.parse(decrypt(credential));
@@ -1403,9 +1405,23 @@ async function getLanguagesVoicesForCartesia(credential) {
return acc;
}, []);
return tranform(ttsVoices, undefined, TtsModelCartesia);
return tranform(
ttsVoices,
ttsVoices.map((voice) => ({
name: voice.name,
value: voice.value,
})),
TtsModelCartesia,
sttModelCartesia);
}
return tranform(ttsCartesia, undefined, TtsModelCartesia);
return tranform(
ttsCartesia,
ttsCartesia.map((voice) => ({
name: voice.name,
value: voice.value,
})),
TtsModelCartesia,
sttModelCartesia);
}
module.exports = {