support google gemini tts (#534)

* support google gemini tts

* wip

* wip

* wip

* wip

* wip

* support speech utils
This commit is contained in:
Hoan Luu Huu
2026-01-22 20:24:05 +07:00
committed by GitHub
parent 8181d56a48
commit 27addfa543
5 changed files with 706 additions and 24 deletions
+5 -3
View File
@@ -779,6 +779,7 @@ function decryptCredential(obj, credential, logger, isObscureKey = true) {
o.private_key.slice(key_header.length, o.private_key.length)}`
};
obj.service_key = JSON.stringify(obscured);
obj.model_id = o.model_id || null;
}
else if ('aws' === obj.vendor) {
const o = JSON.parse(decrypt(credential));
@@ -1524,11 +1525,11 @@ function parseGooglelanguagesVoices(data) {
return data.reduce((acc, voice) => {
const languageCode = voice.languageCodes[0];
const existingLanguage = acc.find((lang) => lang.value === languageCode);
if (existingLanguage) {
existingLanguage.voices.push({
value: voice.name,
name: `${voice.name.substring(languageCode.length + 1, voice.name.length)} (${voice.ssmlGender})`
name: `${voice.name.startsWith(languageCode) ?
voice.name.substring(languageCode.length + 1, voice.name.length) : voice.name} (${voice.ssmlGender})`
});
} else {
acc.push({
@@ -1536,7 +1537,8 @@ function parseGooglelanguagesVoices(data) {
name: SttGoogleLanguagesVoices.find((lang) => lang.value === languageCode)?.name || languageCode,
voices: [{
value: voice.name,
name: `${voice.name.substring(languageCode.length + 1, voice.name.length)} (${voice.ssmlGender})`
name: `${voice.name.startsWith(languageCode) ?
voice.name.substring(languageCode.length + 1, voice.name.length) : voice.name} (${voice.ssmlGender})`
}]
});
}