@node-webrtc-rust/voice-catalog 0.9.16
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/catalog/azure-tts-voices.json +768 -0
- package/catalog/vendors.json +177 -0
- package/dist/cjs/catalog/azure-tts-voices.json +768 -0
- package/dist/cjs/catalog/vendors.json +177 -0
- package/dist/cjs/src/index.d.ts +56 -0
- package/dist/cjs/src/index.d.ts.map +1 -0
- package/dist/cjs/src/index.js +115 -0
- package/dist/cjs/src/index.js.map +1 -0
- package/dist/esm/catalog/azure-tts-voices.json +768 -0
- package/dist/esm/catalog/vendors.json +177 -0
- package/dist/esm/package.json +1 -0
- package/dist/esm/src/index.d.ts +56 -0
- package/dist/esm/src/index.d.ts.map +1 -0
- package/dist/esm/src/index.js +100 -0
- package/dist/esm/src/index.js.map +1 -0
- package/package.json +53 -0
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
{
|
|
2
|
+
"vendors": [
|
|
3
|
+
{
|
|
4
|
+
"id": "openai",
|
|
5
|
+
"label": "OpenAI",
|
|
6
|
+
"stt": true,
|
|
7
|
+
"tts": true,
|
|
8
|
+
"defaultSttModel": "whisper-1",
|
|
9
|
+
"defaultTtsModel": "tts-1",
|
|
10
|
+
"sttModels": [
|
|
11
|
+
"whisper-1",
|
|
12
|
+
"gpt-4o-mini-transcribe",
|
|
13
|
+
"gpt-4o-transcribe",
|
|
14
|
+
"gpt-4o-transcribe-diarize",
|
|
15
|
+
"gpt-transcribe",
|
|
16
|
+
"gpt-live-transcribe"
|
|
17
|
+
],
|
|
18
|
+
"ttsModels": ["tts-1", "tts-1-hd", "gpt-4o-mini-tts", "gpt-4o-mini-tts-2025-12-15"],
|
|
19
|
+
"ttsVoices": [],
|
|
20
|
+
"home": "https://platform.openai.com/docs",
|
|
21
|
+
"sttDocs": "https://platform.openai.com/docs/guides/speech-to-text",
|
|
22
|
+
"ttsDocs": "https://platform.openai.com/docs/guides/text-to-speech",
|
|
23
|
+
"modelsDocs": "https://platform.openai.com/docs/models"
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
"id": "deepgram",
|
|
27
|
+
"label": "Deepgram",
|
|
28
|
+
"stt": true,
|
|
29
|
+
"tts": true,
|
|
30
|
+
"defaultSttModel": "nova-2",
|
|
31
|
+
"defaultTtsModel": "aura-asteria-en",
|
|
32
|
+
"sttModels": ["nova-2", "nova-3"],
|
|
33
|
+
"ttsModels": ["aura-asteria-en"],
|
|
34
|
+
"ttsVoices": [],
|
|
35
|
+
"home": "https://developers.deepgram.com/",
|
|
36
|
+
"sttDocs": "https://developers.deepgram.com/docs/live-streaming-audio",
|
|
37
|
+
"ttsDocs": "https://developers.deepgram.com/reference/text-to-speech/speak",
|
|
38
|
+
"modelsDocs": "https://developers.deepgram.com/docs/models"
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
"id": "elevenlabs",
|
|
42
|
+
"label": "ElevenLabs",
|
|
43
|
+
"stt": true,
|
|
44
|
+
"tts": true,
|
|
45
|
+
"defaultSttModel": "scribe_v2_realtime",
|
|
46
|
+
"defaultTtsModel": "eleven_multilingual_v2",
|
|
47
|
+
"sttModels": ["scribe_v2_realtime"],
|
|
48
|
+
"ttsModels": ["eleven_multilingual_v2", "eleven_v3", "eleven_flash_v2_5"],
|
|
49
|
+
"ttsVoices": [],
|
|
50
|
+
"home": "https://elevenlabs.io/docs",
|
|
51
|
+
"sttDocs": "https://elevenlabs.io/docs/api-reference/speech-to-text/v-1-speech-to-text-realtime",
|
|
52
|
+
"ttsDocs": "https://elevenlabs.io/docs/api-reference/text-to-speech/stream",
|
|
53
|
+
"modelsDocs": "https://elevenlabs.io/docs/voices"
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
"id": "cartesia",
|
|
57
|
+
"label": "Cartesia",
|
|
58
|
+
"stt": false,
|
|
59
|
+
"tts": true,
|
|
60
|
+
"defaultTtsModel": "sonic-3",
|
|
61
|
+
"sttModels": [],
|
|
62
|
+
"ttsModels": ["sonic-3.6", "sonic-3.5", "sonic-3", "sonic-latest"],
|
|
63
|
+
"ttsVoices": [],
|
|
64
|
+
"home": "https://docs.cartesia.ai/",
|
|
65
|
+
"ttsDocs": "https://docs.cartesia.ai/api-reference/tts/websocket",
|
|
66
|
+
"modelsDocs": "https://docs.cartesia.ai/models"
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
"id": "assemblyai",
|
|
70
|
+
"label": "AssemblyAI",
|
|
71
|
+
"stt": true,
|
|
72
|
+
"tts": false,
|
|
73
|
+
"defaultSttModel": "universal-streaming-english",
|
|
74
|
+
"sttModels": ["universal-3-6-pro", "universal-streaming-english"],
|
|
75
|
+
"ttsModels": [],
|
|
76
|
+
"ttsVoices": [],
|
|
77
|
+
"home": "https://www.assemblyai.com/docs",
|
|
78
|
+
"sttDocs": "https://www.assemblyai.com/docs/speech-to-text/streaming",
|
|
79
|
+
"modelsDocs": "https://www.assemblyai.com/docs/speech-to-text/pre-recorded-audio/select-the-speech-model"
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
"id": "google",
|
|
83
|
+
"label": "Google Cloud",
|
|
84
|
+
"stt": true,
|
|
85
|
+
"tts": true,
|
|
86
|
+
"defaultSttModel": "latest_long",
|
|
87
|
+
"defaultTtsVoice": "en-US-Neural2-A",
|
|
88
|
+
"sttModels": ["chirp_3", "chirp_2", "telephony", "latest_long"],
|
|
89
|
+
"ttsModels": [],
|
|
90
|
+
"ttsVoices": [],
|
|
91
|
+
"home": "https://cloud.google.com/speech-to-text",
|
|
92
|
+
"sttDocs": "https://docs.cloud.google.com/speech-to-text/docs/models/chirp-3",
|
|
93
|
+
"ttsDocs": "https://docs.cloud.google.com/text-to-speech/docs/create-audio-text-streaming",
|
|
94
|
+
"modelsDocs": "https://cloud.google.com/text-to-speech/docs/voices"
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
"id": "groq",
|
|
98
|
+
"label": "Groq",
|
|
99
|
+
"stt": true,
|
|
100
|
+
"tts": true,
|
|
101
|
+
"defaultSttModel": "whisper-large-v3-turbo",
|
|
102
|
+
"defaultTtsModel": "canopylabs/orpheus-v1-english",
|
|
103
|
+
"sttModels": ["whisper-large-v3-turbo", "whisper-large-v3"],
|
|
104
|
+
"ttsModels": ["canopylabs/orpheus-v1-english", "canopylabs/orpheus-arabic-saudi"],
|
|
105
|
+
"ttsVoices": [],
|
|
106
|
+
"home": "https://console.groq.com/docs",
|
|
107
|
+
"sttDocs": "https://console.groq.com/docs/speech-to-text",
|
|
108
|
+
"ttsDocs": "https://console.groq.com/docs/text-to-speech"
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
"id": "azure",
|
|
112
|
+
"label": "Azure AI Speech",
|
|
113
|
+
"stt": true,
|
|
114
|
+
"tts": true,
|
|
115
|
+
"defaultSttModel": "conversation",
|
|
116
|
+
"defaultTtsVoice": "en-US-JennyNeural",
|
|
117
|
+
"sttModels": ["conversation"],
|
|
118
|
+
"ttsModels": [],
|
|
119
|
+
"ttsVoices": [],
|
|
120
|
+
"ttsVoiceListFile": "azure-tts-voices.json",
|
|
121
|
+
"snapshotDate": "2026-09-28",
|
|
122
|
+
"home": "https://learn.microsoft.com/en-us/azure/ai-services/speech-service/",
|
|
123
|
+
"sttDocs": "https://learn.microsoft.com/en-us/azure/ai-services/speech-service/rest-speech-to-text-short",
|
|
124
|
+
"ttsDocs": "https://learn.microsoft.com/en-us/azure/ai-services/speech-service/rest-text-to-speech"
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
"id": "aws",
|
|
128
|
+
"label": "AWS (Transcribe + Polly)",
|
|
129
|
+
"stt": true,
|
|
130
|
+
"tts": true,
|
|
131
|
+
"defaultSttModel": "en-US",
|
|
132
|
+
"defaultTtsVoice": "Joanna",
|
|
133
|
+
"sttModels": [
|
|
134
|
+
"en-US",
|
|
135
|
+
"es-US",
|
|
136
|
+
"fr-FR",
|
|
137
|
+
"de-DE",
|
|
138
|
+
"pt-BR",
|
|
139
|
+
"ja-JP",
|
|
140
|
+
"ko-KR",
|
|
141
|
+
"zh-CN",
|
|
142
|
+
"it-IT",
|
|
143
|
+
"hi-IN"
|
|
144
|
+
],
|
|
145
|
+
"ttsModels": [],
|
|
146
|
+
"ttsVoices": ["Joanna", "Matthew", "Amy", "Brian", "Ruth", "Stephen"],
|
|
147
|
+
"home": "https://docs.aws.amazon.com/transcribe/",
|
|
148
|
+
"sttDocs": "https://docs.aws.amazon.com/transcribe/latest/dg/streaming-setting-up.html",
|
|
149
|
+
"ttsDocs": "https://docs.aws.amazon.com/polly/latest/dg/API_SynthesizeSpeech.html"
|
|
150
|
+
},
|
|
151
|
+
{
|
|
152
|
+
"id": "local-sherpa",
|
|
153
|
+
"label": "Sherpa-ONNX (local)",
|
|
154
|
+
"stt": true,
|
|
155
|
+
"tts": true,
|
|
156
|
+
"defaultSttModel": "sherpa-onnx-streaming-zipformer-en-kroko-2025-08-06",
|
|
157
|
+
"defaultTtsModel": "vits-piper-en_US-amy-low",
|
|
158
|
+
"sttModels": [],
|
|
159
|
+
"ttsModels": [],
|
|
160
|
+
"ttsVoices": [],
|
|
161
|
+
"home": "https://github.com/k2-fsa/sherpa-onnx",
|
|
162
|
+
"sttDocs": "https://k2-fsa.github.io/sherpa/onnx/",
|
|
163
|
+
"ttsDocs": "https://k2-fsa.github.io/sherpa/onnx/tts/index.html",
|
|
164
|
+
"modelsDocs": "https://github.com/k2-fsa/sherpa-onnx/releases/tag/asr-models"
|
|
165
|
+
},
|
|
166
|
+
{
|
|
167
|
+
"id": "mock",
|
|
168
|
+
"label": "Mock (CI / local)",
|
|
169
|
+
"stt": true,
|
|
170
|
+
"tts": true,
|
|
171
|
+
"sttModels": [],
|
|
172
|
+
"ttsModels": [],
|
|
173
|
+
"ttsVoices": [],
|
|
174
|
+
"home": "https://github.com/akirilyuk/node-webrtc-rust/tree/main/crates/vendor-mock"
|
|
175
|
+
}
|
|
176
|
+
]
|
|
177
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/** SDK `stt.provider` / `tts.provider` id (matches VoiceAgent vendor ids). */
|
|
2
|
+
export type VoiceVendorId = 'openai' | 'deepgram' | 'elevenlabs' | 'cartesia' | 'assemblyai' | 'google' | 'groq' | 'azure' | 'aws' | 'local-sherpa' | 'mock';
|
|
3
|
+
export interface VoiceVendorEntry {
|
|
4
|
+
id: VoiceVendorId;
|
|
5
|
+
label: string;
|
|
6
|
+
stt: boolean;
|
|
7
|
+
tts: boolean;
|
|
8
|
+
defaultSttModel?: string;
|
|
9
|
+
defaultTtsModel?: string;
|
|
10
|
+
defaultTtsVoice?: string;
|
|
11
|
+
sttModels: string[];
|
|
12
|
+
ttsModels: string[];
|
|
13
|
+
ttsVoices: string[];
|
|
14
|
+
/** Relative to `catalog/` — load via {@link azureTtsVoices}. */
|
|
15
|
+
ttsVoiceListFile?: string;
|
|
16
|
+
home: string;
|
|
17
|
+
sttDocs?: string;
|
|
18
|
+
ttsDocs?: string;
|
|
19
|
+
modelsDocs?: string;
|
|
20
|
+
snapshotDate?: string;
|
|
21
|
+
}
|
|
22
|
+
export interface AzureTtsVoicesCatalog {
|
|
23
|
+
snapshotDate: string;
|
|
24
|
+
source: string;
|
|
25
|
+
voicesListDoc: string;
|
|
26
|
+
voices: string[];
|
|
27
|
+
}
|
|
28
|
+
export interface VendorsCatalogFile {
|
|
29
|
+
vendors: VoiceVendorEntry[];
|
|
30
|
+
}
|
|
31
|
+
export declare const vendorsCatalogJson: VendorsCatalogFile;
|
|
32
|
+
export declare const azureTtsVoicesJson: AzureTtsVoicesCatalog;
|
|
33
|
+
/** All vendors from `catalog/vendors.json`. */
|
|
34
|
+
export declare const VOICE_VENDORS: readonly VoiceVendorEntry[];
|
|
35
|
+
/** Azure TTS ShortNames snapshot (`catalog/azure-tts-voices.json`). */
|
|
36
|
+
export declare const azureTtsVoices: readonly string[];
|
|
37
|
+
export declare function getVendor(id: string): VoiceVendorEntry | undefined;
|
|
38
|
+
export declare function allVendorIds(): VoiceVendorId[];
|
|
39
|
+
/** STT-capable providers for customer configuration (excludes `mock`). */
|
|
40
|
+
export declare function customerSttProviderIds(): VoiceVendorId[];
|
|
41
|
+
/** TTS-capable providers for customer configuration (excludes `mock`). */
|
|
42
|
+
export declare function customerTtsProviderIds(): VoiceVendorId[];
|
|
43
|
+
export declare function sttModelAllowlist(vendorId: string): readonly string[];
|
|
44
|
+
export declare function ttsModelAllowlist(vendorId: string): readonly string[];
|
|
45
|
+
export declare function ttsVoiceAllowlist(vendorId: string): readonly string[];
|
|
46
|
+
export type VoiceCatalogValidationKind = 'sttModel' | 'ttsModel' | 'ttsVoice';
|
|
47
|
+
export interface VoiceCatalogValidationError {
|
|
48
|
+
kind: VoiceCatalogValidationKind;
|
|
49
|
+
vendorId: string;
|
|
50
|
+
value: string;
|
|
51
|
+
message: string;
|
|
52
|
+
}
|
|
53
|
+
/** Returns `null` when the model/voice is in the published allowlist for that vendor. */
|
|
54
|
+
export declare function validateVoiceCatalogChoice(vendorId: string, kind: VoiceCatalogValidationKind, value: string): VoiceCatalogValidationError | null;
|
|
55
|
+
export { vendorsCatalogJson as loadVendorsCatalog, azureTtsVoicesJson as loadAzureTtsVoicesCatalog };
|
|
56
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAGA,8EAA8E;AAC9E,MAAM,MAAM,aAAa,GACrB,QAAQ,GACR,UAAU,GACV,YAAY,GACZ,UAAU,GACV,YAAY,GACZ,QAAQ,GACR,MAAM,GACN,OAAO,GACP,KAAK,GACL,cAAc,GACd,MAAM,CAAA;AAEV,MAAM,WAAW,gBAAgB;IAC/B,EAAE,EAAE,aAAa,CAAA;IACjB,KAAK,EAAE,MAAM,CAAA;IACb,GAAG,EAAE,OAAO,CAAA;IACZ,GAAG,EAAE,OAAO,CAAA;IACZ,eAAe,CAAC,EAAE,M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B,CAAC,QAAQ,EAAE,MAAM,GAAG,SAAS,MAAM,EAAE,CAGrE;AAED,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,MAAM,GAAG,SAAS,MAAM,EAAE,CAMrE;AAED,MAAM,MAAM,0BAA0B,GAAG,UAAU,GAAG,UAAU,GAAG,UAAU,CAAA;AAE7E,MAAM,WAAW,2BAA2B;IAC1C,IAAI,EAAE,0BAA0B,CAAA;IAChC,QAAQ,EAAE,MAAM,CAAA;IAChB,KAAK,EAAE,MAAM,CAAA;IACb,OAAO,EAAE,MAAM,CAAA;CAChB;AAED,yFAAyF;AACzF,wBAAgB,0BAA0B,CACxC,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,0BAA0B,EAChC,KAAK,EAAE,MAAM,GACZ,2BAA2B,GAAG,IAAI,CA+DpC;AAED,OAAO,EAAE,kBAAkB,IAAI,kBAAkB,EAAE,kBAAkB,IAAI,yBAAyB,EAAE,CAAA"}
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.loadAzureTtsVoicesCatalog = exports.loadVendorsCatalog = exports.azureTtsVoices = exports.VOICE_VENDORS = exports.azureTtsVoicesJson = exports.vendorsCatalogJson = void 0;
|
|
7
|
+
exports.getVendor = getVendor;
|
|
8
|
+
exports.allVendorIds = allVendorIds;
|
|
9
|
+
exports.customerSttProviderIds = customerSttProviderIds;
|
|
10
|
+
exports.customerTtsProviderIds = customerTtsProviderIds;
|
|
11
|
+
exports.sttModelAllowlist = sttModelAllowlist;
|
|
12
|
+
exports.ttsModelAllowlist = ttsModelAllowlist;
|
|
13
|
+
exports.ttsVoiceAllowlist = ttsVoiceAllowlist;
|
|
14
|
+
exports.validateVoiceCatalogChoice = validateVoiceCatalogChoice;
|
|
15
|
+
const vendors_json_1 = __importDefault(require("../catalog/vendors.json"));
|
|
16
|
+
const azure_tts_voices_json_1 = __importDefault(require("../catalog/azure-tts-voices.json"));
|
|
17
|
+
exports.vendorsCatalogJson = vendors_json_1.default;
|
|
18
|
+
exports.loadVendorsCatalog = exports.vendorsCatalogJson;
|
|
19
|
+
exports.azureTtsVoicesJson = azure_tts_voices_json_1.default;
|
|
20
|
+
exports.loadAzureTtsVoicesCatalog = exports.azureTtsVoicesJson;
|
|
21
|
+
/** All vendors from `catalog/vendors.json`. */
|
|
22
|
+
exports.VOICE_VENDORS = exports.vendorsCatalogJson.vendors;
|
|
23
|
+
/** Azure TTS ShortNames snapshot (`catalog/azure-tts-voices.json`). */
|
|
24
|
+
exports.azureTtsVoices = exports.azureTtsVoicesJson.voices;
|
|
25
|
+
function getVendor(id) {
|
|
26
|
+
return exports.VOICE_VENDORS.find((entry) => entry.id === id);
|
|
27
|
+
}
|
|
28
|
+
function allVendorIds() {
|
|
29
|
+
return exports.VOICE_VENDORS.map((entry) => entry.id);
|
|
30
|
+
}
|
|
31
|
+
/** STT-capable providers for customer configuration (excludes `mock`). */
|
|
32
|
+
function customerSttProviderIds() {
|
|
33
|
+
return exports.VOICE_VENDORS.filter((entry) => entry.stt && entry.id !== 'mock').map((entry) => entry.id);
|
|
34
|
+
}
|
|
35
|
+
/** TTS-capable providers for customer configuration (excludes `mock`). */
|
|
36
|
+
function customerTtsProviderIds() {
|
|
37
|
+
return exports.VOICE_VENDORS.filter((entry) => entry.tts && entry.id !== 'mock').map((entry) => entry.id);
|
|
38
|
+
}
|
|
39
|
+
function sttModelAllowlist(vendorId) {
|
|
40
|
+
const vendor = getVendor(vendorId);
|
|
41
|
+
return vendor?.sttModels ?? [];
|
|
42
|
+
}
|
|
43
|
+
function ttsModelAllowlist(vendorId) {
|
|
44
|
+
const vendor = getVendor(vendorId);
|
|
45
|
+
return vendor?.ttsModels ?? [];
|
|
46
|
+
}
|
|
47
|
+
function ttsVoiceAllowlist(vendorId) {
|
|
48
|
+
if (vendorId === 'azure') {
|
|
49
|
+
return exports.azureTtsVoices;
|
|
50
|
+
}
|
|
51
|
+
const vendor = getVendor(vendorId);
|
|
52
|
+
return vendor?.ttsVoices ?? [];
|
|
53
|
+
}
|
|
54
|
+
/** Returns `null` when the model/voice is in the published allowlist for that vendor. */
|
|
55
|
+
function validateVoiceCatalogChoice(vendorId, kind, value) {
|
|
56
|
+
const vendor = getVendor(vendorId);
|
|
57
|
+
if (!vendor) {
|
|
58
|
+
return {
|
|
59
|
+
kind,
|
|
60
|
+
vendorId,
|
|
61
|
+
value,
|
|
62
|
+
message: `unknown vendor id \`${vendorId}\``,
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
let allowlist;
|
|
66
|
+
switch (kind) {
|
|
67
|
+
case 'sttModel':
|
|
68
|
+
if (!vendor.stt) {
|
|
69
|
+
return {
|
|
70
|
+
kind,
|
|
71
|
+
vendorId,
|
|
72
|
+
value,
|
|
73
|
+
message: `vendor \`${vendorId}\` does not support STT`,
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
allowlist = sttModelAllowlist(vendorId);
|
|
77
|
+
break;
|
|
78
|
+
case 'ttsModel':
|
|
79
|
+
if (!vendor.tts) {
|
|
80
|
+
return {
|
|
81
|
+
kind,
|
|
82
|
+
vendorId,
|
|
83
|
+
value,
|
|
84
|
+
message: `vendor \`${vendorId}\` does not support TTS`,
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
allowlist = ttsModelAllowlist(vendorId);
|
|
88
|
+
break;
|
|
89
|
+
case 'ttsVoice':
|
|
90
|
+
if (!vendor.tts) {
|
|
91
|
+
return {
|
|
92
|
+
kind,
|
|
93
|
+
vendorId,
|
|
94
|
+
value,
|
|
95
|
+
message: `vendor \`${vendorId}\` does not support TTS`,
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
allowlist = ttsVoiceAllowlist(vendorId);
|
|
99
|
+
break;
|
|
100
|
+
}
|
|
101
|
+
if (allowlist.length === 0) {
|
|
102
|
+
// local-sherpa / google TTS voices / deepgram TTS models: no hardcoded zoo in catalog
|
|
103
|
+
return null;
|
|
104
|
+
}
|
|
105
|
+
if (!allowlist.includes(value)) {
|
|
106
|
+
return {
|
|
107
|
+
kind,
|
|
108
|
+
vendorId,
|
|
109
|
+
value,
|
|
110
|
+
message: `unsupported ${kind} \`${value}\` for vendor \`${vendorId}\``,
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
return null;
|
|
114
|
+
}
|
|
115
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":";;;;;;AA0DA,8BAEC;AAED,oCAEC;AAGD,wDAEC;AAGD,wDAEC;AAED,8CAGC;AAED,8CAGC;AAED,8CAMC;AAYD,gEAmEC;AA3KD,2EAAoD;AACpD,6FAAoE;AA+CvD,QAAA,kBAAkB,GAAuB,sBAAoC,CAAA;AA6H3D,6BA7HlB,0BAAkB,CA6HkB;AA5HpC,QAAA,kBAAkB,GAC7B,+BAA8C,CAAA;AA2HyB,oCA5H5D,0BAAkB,CA4HmE;AAzHlG,+CAA+C;AAClC,QAAA,aAAa,GAAgC,0BAAkB,CAAC,OAAO,CAAA;AAEpF,uEAAuE;AAC1D,QAAA,cAAc,GAAsB,0BAAkB,CAAC,MAAM,CAAA;AAE1E,SAAgB,SAAS,CAAC,EAAU;IAClC,OAAO,qBAAa,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,EAAE,KAAK,EAAE,CAAC,CAAA;AACvD,CAAC;AAED,SAAgB,YAAY;IAC1B,OAAO,qBAAa,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,EAAE,CAAC,CAAA;AAC/C,CAAC;AAED,0EAA0E;AAC1E,SAAgB,sBAAsB;IACpC,OAAO,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