vidspotai-shared 1.0.42 → 1.0.47
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/globals/ttsModels/providers/elevenlabs.js +2 -2
- package/lib/globals/ttsModels/voices.d.ts +4 -3
- package/lib/globals/ttsModels/voices.d.ts.map +1 -1
- package/lib/globals/ttsModels/voices.js +12 -5
- package/lib/services/aiGen/providers/minimax/minimax.service.js +1 -1
- package/lib/services/tts/providers/elevenlabs.service.d.ts.map +1 -1
- package/lib/services/tts/providers/elevenlabs.service.js +24 -0
- package/package.json +1 -1
|
@@ -3,11 +3,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.elevenlabsConfig = void 0;
|
|
4
4
|
exports.elevenlabsConfig = {
|
|
5
5
|
name: "ElevenLabs",
|
|
6
|
-
/**
|
|
6
|
+
/** eleven_multilingual_v3 pay-as-you-go rate */
|
|
7
7
|
costPer1KChars: 0.3,
|
|
8
8
|
/** Sarah — neutral, clear default voice */
|
|
9
9
|
defaultVoiceId: "EXAVITQu4vr4xnSDxMaL",
|
|
10
|
-
modelId: "
|
|
10
|
+
modelId: "eleven_multilingual_v3",
|
|
11
11
|
/** ~150 words/min = 2.5 words/sec */
|
|
12
12
|
wordsPerSecond: 2.5,
|
|
13
13
|
/** ElevenLabs API limit per single TTS request */
|
|
@@ -7,15 +7,16 @@ export interface ITtsVoice {
|
|
|
7
7
|
previewUrl: string;
|
|
8
8
|
}
|
|
9
9
|
/**
|
|
10
|
-
* Curated list of ElevenLabs voices compatible with
|
|
10
|
+
* Curated list of ElevenLabs voices compatible with eleven_multilingual_v3.
|
|
11
11
|
* Any voice can speak any supported language via the language_code parameter.
|
|
12
12
|
*/
|
|
13
13
|
export declare const ELEVENLABS_VOICES: ITtsVoice[];
|
|
14
14
|
/** Default voice ID — Sarah (female, American) */
|
|
15
15
|
export declare const DEFAULT_ELEVENLABS_VOICE_ID = "EXAVITQu4vr4xnSDxMaL";
|
|
16
16
|
/**
|
|
17
|
-
* Maps frontend language keys → ElevenLabs language_code
|
|
18
|
-
*
|
|
17
|
+
* Maps frontend language keys → ElevenLabs language_code values supported by eleven_multilingual_v3.
|
|
18
|
+
* Omitting a language lets the model auto-detect it (safe fallback).
|
|
19
|
+
* Reference: https://help.elevenlabs.io/hc/en-us/articles/13313366263441
|
|
19
20
|
*/
|
|
20
21
|
export declare const LANG_TO_ELEVENLABS_CODE: Record<string, string>;
|
|
21
22
|
//# sourceMappingURL=voices.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"voices.d.ts","sourceRoot":"","sources":["../../../src/globals/ttsModels/voices.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,SAAS;IACxB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,GAAG,QAAQ,CAAC;IAC1B,MAAM,EAAE,MAAM,CAAC;IACf,8CAA8C;IAC9C,UAAU,EAAE,MAAM,CAAC;CACpB;AAED;;;GAGG;AACH,eAAO,MAAM,iBAAiB,EAAE,SAAS,EAuFxC,CAAC;AAEF,kDAAkD;AAClD,eAAO,MAAM,2BAA2B,yBAAyB,CAAC;AAElE
|
|
1
|
+
{"version":3,"file":"voices.d.ts","sourceRoot":"","sources":["../../../src/globals/ttsModels/voices.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,SAAS;IACxB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,GAAG,QAAQ,CAAC;IAC1B,MAAM,EAAE,MAAM,CAAC;IACf,8CAA8C;IAC9C,UAAU,EAAE,MAAM,CAAC;CACpB;AAED;;;GAGG;AACH,eAAO,MAAM,iBAAiB,EAAE,SAAS,EAuFxC,CAAC;AAEF,kDAAkD;AAClD,eAAO,MAAM,2BAA2B,yBAAyB,CAAC;AAElE;;;;GAIG;AACH,eAAO,MAAM,uBAAuB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAuC1D,CAAC"}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.LANG_TO_ELEVENLABS_CODE = exports.DEFAULT_ELEVENLABS_VOICE_ID = exports.ELEVENLABS_VOICES = void 0;
|
|
4
4
|
/**
|
|
5
|
-
* Curated list of ElevenLabs voices compatible with
|
|
5
|
+
* Curated list of ElevenLabs voices compatible with eleven_multilingual_v3.
|
|
6
6
|
* Any voice can speak any supported language via the language_code parameter.
|
|
7
7
|
*/
|
|
8
8
|
exports.ELEVENLABS_VOICES = [
|
|
@@ -96,25 +96,30 @@ exports.ELEVENLABS_VOICES = [
|
|
|
96
96
|
/** Default voice ID — Sarah (female, American) */
|
|
97
97
|
exports.DEFAULT_ELEVENLABS_VOICE_ID = "EXAVITQu4vr4xnSDxMaL";
|
|
98
98
|
/**
|
|
99
|
-
* Maps frontend language keys → ElevenLabs language_code
|
|
100
|
-
*
|
|
99
|
+
* Maps frontend language keys → ElevenLabs language_code values supported by eleven_multilingual_v3.
|
|
100
|
+
* Omitting a language lets the model auto-detect it (safe fallback).
|
|
101
|
+
* Reference: https://help.elevenlabs.io/hc/en-us/articles/13313366263441
|
|
101
102
|
*/
|
|
102
103
|
exports.LANG_TO_ELEVENLABS_CODE = {
|
|
103
104
|
en: "en",
|
|
104
105
|
ar: "ar",
|
|
105
106
|
bg: "bg",
|
|
106
|
-
ca
|
|
107
|
+
// ca (Catalan) is not in v3's supported language_code list — omitted; model auto-detects
|
|
107
108
|
"zh-cn": "zh",
|
|
109
|
+
zh: "zh",
|
|
108
110
|
hr: "hr",
|
|
109
111
|
cs: "cs",
|
|
110
112
|
da: "da",
|
|
111
113
|
nl: "nl",
|
|
112
114
|
tl: "fil",
|
|
115
|
+
fil: "fil",
|
|
113
116
|
fi: "fi",
|
|
114
117
|
fr: "fr",
|
|
115
118
|
de: "de",
|
|
116
119
|
el: "el",
|
|
117
|
-
iw: "he",
|
|
120
|
+
iw: "he", // legacy Google code for Hebrew
|
|
121
|
+
he: "he",
|
|
122
|
+
hi: "hi", // Hindi — added in v3
|
|
118
123
|
hu: "hu",
|
|
119
124
|
id: "id",
|
|
120
125
|
it: "it",
|
|
@@ -125,9 +130,11 @@ exports.LANG_TO_ELEVENLABS_CODE = {
|
|
|
125
130
|
pl: "pl",
|
|
126
131
|
pt: "pt",
|
|
127
132
|
ro: "ro",
|
|
133
|
+
ru: "ru", // Russian — added in v3
|
|
128
134
|
sk: "sk",
|
|
129
135
|
es: "es",
|
|
130
136
|
sv: "sv",
|
|
137
|
+
ta: "ta", // Tamil — added in v3
|
|
131
138
|
th: "th",
|
|
132
139
|
tr: "tr",
|
|
133
140
|
uk: "uk",
|
|
@@ -77,7 +77,7 @@ class MinimaxService extends baseAiGenProvider_service_1.BaseAiGenProviderServic
|
|
|
77
77
|
duration: params.duration || 6,
|
|
78
78
|
};
|
|
79
79
|
const response = await this.request("/v1/video_generation", "POST", requestBody);
|
|
80
|
-
|
|
80
|
+
logger_1.logger.info("Minimax video generation task response", { taskId: response.task_id });
|
|
81
81
|
const taskId = response.task_id;
|
|
82
82
|
return { task: taskId, status: types_1.EVideoSceneStatus.TRIGGERED };
|
|
83
83
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"elevenlabs.service.d.ts","sourceRoot":"","sources":["../../../../src/services/tts/providers/elevenlabs.service.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,sBAAsB,EAAE,eAAe,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAEzF,qBAAa,iBAAkB,SAAQ,sBAAsB;IAC3D,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAkC;IAE1D,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAS;;IAW1B,QAAQ,CAAC,MAAM,EAAE,SAAS,GAAG,OAAO,CAAC,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"elevenlabs.service.d.ts","sourceRoot":"","sources":["../../../../src/services/tts/providers/elevenlabs.service.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,sBAAsB,EAAE,eAAe,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAEzF,qBAAa,iBAAkB,SAAQ,sBAAsB;IAC3D,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAkC;IAE1D,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAS;;IAW1B,QAAQ,CAAC,MAAM,EAAE,SAAS,GAAG,OAAO,CAAC,SAAS,CAAC;IAuFrD,SAAS,IAAI,eAAe,EAAE;IAI9B,eAAe,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS;CAGpD"}
|
|
@@ -61,6 +61,30 @@ class ElevenLabsService extends types_1.BaseTtsProviderService {
|
|
|
61
61
|
catch {
|
|
62
62
|
detail = Buffer.from(err.response.data).toString("utf8");
|
|
63
63
|
}
|
|
64
|
+
// If the rejection is about an unsupported language_code, retry without it —
|
|
65
|
+
// the model will auto-detect the language instead of failing the whole job.
|
|
66
|
+
if (err.response.status === 400 &&
|
|
67
|
+
languageCode &&
|
|
68
|
+
(detail.includes("language_code") || detail.includes("does not support"))) {
|
|
69
|
+
const response = await axios_1.default.post(`${this.baseUrl}/text-to-speech/${voiceId}`, {
|
|
70
|
+
text: params.text,
|
|
71
|
+
model_id: elevenlabs_1.elevenlabsConfig.modelId,
|
|
72
|
+
voice_settings: { stability: 0.5, similarity_boost: 0.75 },
|
|
73
|
+
}, {
|
|
74
|
+
headers: {
|
|
75
|
+
"xi-api-key": this.apiKey,
|
|
76
|
+
"Content-Type": "application/json",
|
|
77
|
+
Accept: "audio/mpeg",
|
|
78
|
+
},
|
|
79
|
+
responseType: "arraybuffer",
|
|
80
|
+
timeout: 60000,
|
|
81
|
+
});
|
|
82
|
+
return {
|
|
83
|
+
audioBuffer: Buffer.from(response.data),
|
|
84
|
+
mimeType: "audio/mpeg",
|
|
85
|
+
extension: "mp3",
|
|
86
|
+
};
|
|
87
|
+
}
|
|
64
88
|
throw new Error(`ElevenLabs TTS ${err.response.status}: ${detail} [voiceId=${voiceId}, languageCode=${languageCode ?? "none"}, textLen=${params.text?.length ?? 0}]`);
|
|
65
89
|
}
|
|
66
90
|
throw err;
|