@loonylabs/tts-middleware 0.2.0 → 0.4.0

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.
Files changed (32) hide show
  1. package/README.md +295 -200
  2. package/dist/middleware/services/tts/index.d.ts +4 -3
  3. package/dist/middleware/services/tts/index.d.ts.map +1 -1
  4. package/dist/middleware/services/tts/index.js +3 -1
  5. package/dist/middleware/services/tts/index.js.map +1 -1
  6. package/dist/middleware/services/tts/providers/edenai-provider.d.ts.map +1 -1
  7. package/dist/middleware/services/tts/providers/edenai-provider.js +9 -9
  8. package/dist/middleware/services/tts/providers/edenai-provider.js.map +1 -1
  9. package/dist/middleware/services/tts/providers/google-cloud-tts-provider.d.ts +139 -0
  10. package/dist/middleware/services/tts/providers/google-cloud-tts-provider.d.ts.map +1 -0
  11. package/dist/middleware/services/tts/providers/google-cloud-tts-provider.js +333 -0
  12. package/dist/middleware/services/tts/providers/google-cloud-tts-provider.js.map +1 -0
  13. package/dist/middleware/services/tts/providers/index.d.ts +2 -0
  14. package/dist/middleware/services/tts/providers/index.d.ts.map +1 -1
  15. package/dist/middleware/services/tts/providers/index.js +3 -2
  16. package/dist/middleware/services/tts/providers/index.js.map +1 -1
  17. package/dist/middleware/services/tts/tts.service.d.ts.map +1 -1
  18. package/dist/middleware/services/tts/tts.service.js +12 -0
  19. package/dist/middleware/services/tts/tts.service.js.map +1 -1
  20. package/dist/middleware/services/tts/types/index.d.ts +4 -2
  21. package/dist/middleware/services/tts/types/index.d.ts.map +1 -1
  22. package/dist/middleware/services/tts/types/index.js +2 -1
  23. package/dist/middleware/services/tts/types/index.js.map +1 -1
  24. package/dist/middleware/services/tts/types/provider-options.types.d.ts +50 -11
  25. package/dist/middleware/services/tts/types/provider-options.types.d.ts.map +1 -1
  26. package/dist/middleware/services/tts/types/provider-options.types.js +9 -4
  27. package/dist/middleware/services/tts/types/provider-options.types.js.map +1 -1
  28. package/dist/middleware/shared/config/tts.config.d.ts +40 -0
  29. package/dist/middleware/shared/config/tts.config.d.ts.map +1 -1
  30. package/dist/middleware/shared/config/tts.config.js +30 -4
  31. package/dist/middleware/shared/config/tts.config.js.map +1 -1
  32. package/package.json +103 -102
package/README.md CHANGED
@@ -1,201 +1,296 @@
1
- # @loonylabs/tts-middleware
2
-
3
- [![npm version](https://img.shields.io/npm/v/@loonylabs/tts-middleware.svg)](https://www.npmjs.com/package/@loonylabs/tts-middleware)
4
- [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
5
- [![Build Status](https://img.shields.io/badge/build-passing-brightgreen)]()
6
- [![Coverage](https://img.shields.io/badge/coverage-94%25-brightgreen)]()
7
-
8
- **Provider-agnostic Text-to-Speech (TTS) middleware infrastructure.**
9
-
10
- Build voice-enabled applications that switch seamlessly between Azure, EdenAI, OpenAI, ElevenLabs, and more without changing your application logic. Includes standardized error handling, accurate character counting for billing, and uniform audio output.
11
-
12
- ---
13
-
14
- ## ✨ Key Features
15
-
16
- - **🔌 Provider Agnostic:** Unified API for all TTS providers. Switch providers by changing one config parameter.
17
- - **☁️ Multi-Provider Support:**
18
- - **Azure Speech Services:** Full support for Neural voices, emotions, and speaking styles.
19
- - **EdenAI:** Access to 6+ providers (Google, OpenAI, Amazon, IBM, etc.) via a single aggregator API.
20
- - **Ready for:** OpenAI, ElevenLabs, Google, Deepgram (interfaces prepared).
21
- - **📝 SSML Abstraction:** Auto-generates provider-specific SSML markup (e.g., for Azure prosody/styles) from simple JSON options.
22
- - **💰 Character Counting:** Precise character counting logic for billing estimation.
23
- - **🛡️ Robust Error Handling:** Standardized error types (`InvalidConfigError`, `QuotaExceededError`, `NetworkError`) across all providers.
24
- - **📐 TypeScript First:** Fully typed request/response objects and provider options.
25
- - **🇪🇺 GDPR/DSGVO Ready:** Configurable region support (e.g., Azure Germany/Europe regions).
26
-
27
- ---
28
-
29
- ## 📦 Installation
30
-
31
- ```bash
32
- npm install @loonylabs/tts-middleware
33
- ```
34
-
35
- ## 🚀 Quick Start
36
-
37
- ### 1. Configure Environment
38
-
39
- Create a `.env` file in your project root:
40
-
41
- ```env
42
- # Default Provider
43
- TTS_DEFAULT_PROVIDER=azure
44
-
45
- # Azure Speech Services
46
- AZURE_SPEECH_KEY=your_azure_key
47
- AZURE_SPEECH_REGION=germanywestcentral
48
-
49
- # EdenAI (Optional)
50
- EDENAI_API_KEY=your_edenai_key
51
- ```
52
-
53
- ### 2. Basic Usage
54
-
55
- ```typescript
56
- import { ttsService, TTSProvider } from '@loonylabs/tts-middleware';
57
- import fs from 'fs';
58
-
59
- async function generateSpeech() {
60
- try {
61
- // Synthesize speech
62
- const response = await ttsService.synthesize({
63
- text: "Hello! This is a test of the LoonyLabs TTS middleware.",
64
- voice: { id: "en-US-JennyNeural" }, // Provider-specific voice ID
65
- audio: {
66
- format: "mp3",
67
- speed: 1.0
68
- }
69
- });
70
-
71
- // Save to file
72
- fs.writeFileSync('output.mp3', response.audio);
73
-
74
- console.log(`Generated audio: ${response.metadata.duration}ms`);
75
- console.log(`Billed characters: ${response.billing.characters}`);
76
-
77
- } catch (error) {
78
- console.error("Synthesis failed:", error);
79
- }
80
- }
81
-
82
- generateSpeech();
83
- ```
84
-
85
- ---
86
-
87
- ## 🛠️ Advanced Usage
88
-
89
- ### Using Provider-Specific Features (e.g., Azure Emotions)
90
-
91
- ```typescript
92
- const response = await ttsService.synthesize({
93
- text: "I am so excited to tell you this!",
94
- provider: TTSProvider.AZURE,
95
- voice: { id: "en-US-JennyNeural" },
96
- providerOptions: {
97
- emotion: "cheerful", // Azure-specific
98
- style: "chat", // Azure-specific
99
- styleDegree: 1.5
100
- }
101
- });
102
- ```
103
-
104
- ### Switching Providers Dynamically
105
-
106
- ```typescript
107
- // Use EdenAI to access Google's TTS engine
108
- const response = await ttsService.synthesize({
109
- text: "Hello from Google via EdenAI",
110
- provider: TTSProvider.EDENAI,
111
- voice: { id: "en-US" },
112
- providerOptions: {
113
- provider: "google" // Select underlying provider
114
- }
115
- });
116
- ```
117
-
118
- ---
119
-
120
- ## 🏗️ Architecture
121
-
122
- The middleware uses a singleton orchestrator pattern to manage provider instances.
123
-
124
- ```mermaid
125
- graph TD
126
- App[Your Application] -->|synthesize()| Service[TTSService]
127
- Service -->|getProvider()| Registry{Provider Registry}
128
-
129
- Registry -->|Select| Azure[AzureProvider]
130
- Registry -->|Select| Eden[EdenAIProvider]
131
-
132
- Azure -->|SSML/SDK| AzureAPI[Azure Speech API]
133
- Eden -->|REST| EdenAPI[EdenAI API]
134
-
135
- EdenAPI -.-> Google[Google TTS]
136
- EdenAPI -.-> OpenAI[OpenAI TTS]
137
- EdenAPI -.-> Amazon[Amazon Polly]
138
- ```
139
-
140
- ---
141
-
142
- ## 🧩 Supported Providers
143
-
144
- | Provider | Status | Key Features |
145
- |----------|--------|--------------|
146
- | **Azure** | ✅ Stable | Neural Voices, Emotions, Styles, SSML, Visemes (planned) |
147
- | **EdenAI** | Stable | Aggregator for Google, OpenAI, Amazon, IBM, Microsoft |
148
- | **OpenAI** | 🔮 Planned | HD Audio, Simple API |
149
- | **ElevenLabs** | 🔮 Planned | Voice Cloning, High Expressivity |
150
- | **Google** | 🔮 Planned | WaveNet Voices, Pitch/Volume control |
151
-
152
- ---
153
-
154
- ## 🔧 Logging Configuration
155
-
156
- The middleware includes a pluggable logger interface. By default, it uses `console`, but you can replace it with any logger (Winston, Pino, etc.).
157
-
158
- ```typescript
159
- import { setLogger, silentLogger, setLogLevel } from '@loonylabs/tts-middleware';
160
-
161
- // Disable all logging (useful for tests)
162
- setLogger(silentLogger);
163
-
164
- // Set minimum log level (debug, info, warn, error)
165
- setLogLevel('warn'); // Only show warnings and errors
166
-
167
- // Use custom logger (e.g., Winston)
168
- setLogger({
169
- info: (msg, meta) => winston.info(msg, meta),
170
- warn: (msg, meta) => winston.warn(msg, meta),
171
- error: (msg, meta) => winston.error(msg, meta),
172
- debug: (msg, meta) => winston.debug(msg, meta),
173
- });
174
- ```
175
-
176
- ---
177
-
178
- ## 🧪 Testing
179
-
180
- The project maintains high code coverage (>94%) using Jest.
181
-
182
- ```bash
183
- # Run unit & integration tests
184
- npm test
185
-
186
- # Run manual verification script (requires .env)
187
- npx ts-node scripts/manual-test-edenai.ts
188
- ```
189
-
190
- ## 🤝 Contributing
191
-
192
- See [CONTRIBUTING.md](CONTRIBUTING.md) for detailed guidelines.
193
-
194
- Contributions are welcome! Please ensure:
195
- 1. **Tests:** Add tests for new features.
196
- 2. **Linting:** Run `npm run lint` before committing.
197
- 3. **Conventions:** Follow the existing project structure.
198
-
199
- ## 📄 License
200
-
1
+ # @loonylabs/tts-middleware
2
+
3
+ [![npm version](https://img.shields.io/npm/v/@loonylabs/tts-middleware.svg)](https://www.npmjs.com/package/@loonylabs/tts-middleware)
4
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
5
+ [![Build Status](https://img.shields.io/badge/build-passing-brightgreen)]()
6
+ [![Coverage](https://img.shields.io/badge/coverage-94%25-brightgreen)]()
7
+
8
+ **Provider-agnostic Text-to-Speech (TTS) middleware infrastructure.**
9
+
10
+ Build voice-enabled applications that switch seamlessly between Azure, EdenAI, OpenAI, ElevenLabs, and more without changing your application logic. Includes standardized error handling, accurate character counting for billing, and uniform audio output.
11
+
12
+ ---
13
+
14
+ ## ✨ Key Features
15
+
16
+ - **🔌 Provider Agnostic:** Unified API for all TTS providers. Switch providers by changing one config parameter.
17
+ - **☁️ Multi-Provider Support:**
18
+ - **Azure Speech Services:** Full support for Neural voices, emotions, and speaking styles.
19
+ - **Google Cloud TTS:** Neural2, WaveNet, Studio, Chirp3-HD voices with EU regional endpoints.
20
+ - **EdenAI:** Access to 6+ providers (OpenAI, Amazon, IBM, etc.) via a single aggregator API.
21
+ - **Ready for:** OpenAI, ElevenLabs, Deepgram (interfaces prepared).
22
+ - **📝 SSML Abstraction:** Auto-generates provider-specific SSML markup (e.g., for Azure prosody/styles) from simple JSON options.
23
+ - **💰 Character Counting:** Precise character counting logic for billing estimation.
24
+ - **🛡️ Robust Error Handling:** Standardized error types (`InvalidConfigError`, `QuotaExceededError`, `NetworkError`) across all providers.
25
+ - **📐 TypeScript First:** Fully typed request/response objects and provider options.
26
+ - **🇪🇺 GDPR/DSGVO Ready:** Configurable region support (e.g., Azure Germany/Europe regions).
27
+
28
+ ---
29
+
30
+ ## 📦 Installation
31
+
32
+ ```bash
33
+ npm install @loonylabs/tts-middleware
34
+ ```
35
+
36
+ ## 🚀 Quick Start
37
+
38
+ ### 1. Configure Environment
39
+
40
+ Create a `.env` file in your project root:
41
+
42
+ ```env
43
+ # Default Provider
44
+ TTS_DEFAULT_PROVIDER=azure
45
+
46
+ # Azure Speech Services
47
+ AZURE_SPEECH_KEY=your_azure_key
48
+ AZURE_SPEECH_REGION=germanywestcentral
49
+
50
+ # Google Cloud TTS (GDPR/DSGVO-compliant with EU endpoints)
51
+ GOOGLE_APPLICATION_CREDENTIALS=./path/to/service-account.json
52
+ GOOGLE_CLOUD_PROJECT=your-project-id
53
+ GOOGLE_TTS_REGION=eu # Options: eu, europe-west3 (Frankfurt), europe-west1, etc.
54
+
55
+ # EdenAI (Optional - no DPA available)
56
+ EDENAI_API_KEY=your_edenai_key
57
+ ```
58
+
59
+ ### 2. Basic Usage
60
+
61
+ ```typescript
62
+ import { ttsService, TTSProvider } from '@loonylabs/tts-middleware';
63
+ import fs from 'fs';
64
+
65
+ async function generateSpeech() {
66
+ try {
67
+ // Synthesize speech
68
+ const response = await ttsService.synthesize({
69
+ text: "Hello! This is a test of the LoonyLabs TTS middleware.",
70
+ voice: { id: "en-US-JennyNeural" }, // Provider-specific voice ID
71
+ audio: {
72
+ format: "mp3",
73
+ speed: 1.0
74
+ }
75
+ });
76
+
77
+ // Save to file
78
+ fs.writeFileSync('output.mp3', response.audio);
79
+
80
+ console.log(`Generated audio: ${response.metadata.duration}ms`);
81
+ console.log(`Billed characters: ${response.billing.characters}`);
82
+
83
+ } catch (error) {
84
+ console.error("Synthesis failed:", error);
85
+ }
86
+ }
87
+
88
+ generateSpeech();
89
+ ```
90
+
91
+ ---
92
+
93
+ ## 🛠️ Advanced Usage
94
+
95
+ ### Using Provider-Specific Features (e.g., Azure Emotions)
96
+
97
+ ```typescript
98
+ const response = await ttsService.synthesize({
99
+ text: "I am so excited to tell you this!",
100
+ provider: TTSProvider.AZURE,
101
+ voice: { id: "en-US-JennyNeural" },
102
+ providerOptions: {
103
+ emotion: "cheerful", // Azure-specific
104
+ style: "chat", // Azure-specific
105
+ styleDegree: 1.5
106
+ }
107
+ });
108
+ ```
109
+
110
+ ### Switching Providers Dynamically
111
+
112
+ ```typescript
113
+ // Use EdenAI to access Google's TTS engine
114
+ const response = await ttsService.synthesize({
115
+ text: "Hello from Google via EdenAI",
116
+ provider: TTSProvider.EDENAI,
117
+ voice: { id: "en-US" },
118
+ providerOptions: {
119
+ provider: "google" // Select underlying provider
120
+ }
121
+ });
122
+ ```
123
+
124
+ ### Using OpenAI Voices via EdenAI
125
+
126
+ Access OpenAI's TTS voices (alloy, echo, fable, onyx, nova, shimmer) through EdenAI with specific voice selection:
127
+
128
+ ```typescript
129
+ // German with OpenAI "nova" voice (female)
130
+ const response = await ttsService.synthesize({
131
+ text: "Hallo Welt! Das ist ein Test.",
132
+ provider: TTSProvider.EDENAI,
133
+ voice: { id: "de" }, // Language code
134
+ providerOptions: {
135
+ provider: "openai",
136
+ settings: { openai: "de_nova" } // Voice: {lang}_{voice}
137
+ }
138
+ });
139
+
140
+ // English with OpenAI "onyx" voice (male, deep)
141
+ const response = await ttsService.synthesize({
142
+ text: "Hello World! This is a test.",
143
+ provider: TTSProvider.EDENAI,
144
+ voice: { id: "en" },
145
+ providerOptions: {
146
+ provider: "openai",
147
+ settings: { openai: "en_onyx" }
148
+ }
149
+ });
150
+ ```
151
+
152
+ **Available OpenAI Voices:**
153
+ | Voice | Character |
154
+ |-------|-----------|
155
+ | `alloy` | Neutral |
156
+ | `echo` | Male |
157
+ | `fable` | Expressive |
158
+ | `onyx` | Male, deep |
159
+ | `nova` | Female |
160
+ | `shimmer` | Female, warm |
161
+
162
+ Format: `{language}_{voice}` (e.g., `de_nova`, `en_alloy`, `fr_shimmer`)
163
+
164
+ ### Using Google Cloud TTS (GDPR/DSGVO-Compliant)
165
+
166
+ Google Cloud TTS with EU regional endpoints for data residency compliance:
167
+
168
+ ```typescript
169
+ // Basic usage with EU endpoint (default)
170
+ const response = await ttsService.synthesize({
171
+ text: "Guten Tag, wie geht es Ihnen?",
172
+ provider: TTSProvider.GOOGLE,
173
+ voice: { id: "de-DE-Neural2-G" }, // G=Female, H=Male
174
+ audio: { format: "mp3" }
175
+ });
176
+
177
+ // With Frankfurt endpoint for maximum DSGVO compliance
178
+ const response = await ttsService.synthesize({
179
+ text: "Hallo Welt!",
180
+ provider: TTSProvider.GOOGLE,
181
+ voice: { id: "de-DE-Studio-C" }, // Premium Studio voice
182
+ audio: { format: "mp3", speed: 1.0, pitch: 0.0 },
183
+ providerOptions: {
184
+ region: "europe-west3", // Frankfurt
185
+ effectsProfileId: ["headphone-class-device"] // Audio optimization
186
+ }
187
+ });
188
+ ```
189
+
190
+ **Available German Voices:**
191
+
192
+ | Type | Female | Male | Quality |
193
+ |------|--------|------|---------|
194
+ | Neural2 | `de-DE-Neural2-G` | `de-DE-Neural2-H` | Best value |
195
+ | WaveNet | `de-DE-Wavenet-G` | `de-DE-Wavenet-H` | Good |
196
+ | Studio | `de-DE-Studio-C` | `de-DE-Studio-B` | Premium |
197
+ | Chirp3-HD | `de-DE-Chirp3-HD-Aoede`, `Kore`, ... | `de-DE-Chirp3-HD-Fenrir`, `Puck`, ... | Newest |
198
+
199
+ > **Note:** German Neural2/WaveNet only have G and H variants (no A-F). Use `scripts/list-google-voices.ts` to query all available voices.
200
+
201
+ ---
202
+
203
+ ## 🏗️ Architecture
204
+
205
+ The middleware uses a singleton orchestrator pattern to manage provider instances.
206
+
207
+ ```mermaid
208
+ graph TD
209
+ App[Your Application] -->|synthesize()| Service[TTSService]
210
+ Service -->|getProvider()| Registry{Provider Registry}
211
+
212
+ Registry -->|Select| Azure[AzureProvider]
213
+ Registry -->|Select| GCloud[GoogleCloudTTSProvider]
214
+ Registry -->|Select| Eden[EdenAIProvider]
215
+
216
+ Azure -->|SSML/SDK| AzureAPI[Azure Speech API]
217
+ GCloud -->|gRPC/SDK| GoogleAPI[Google Cloud TTS API]
218
+ Eden -->|REST| EdenAPI[EdenAI API]
219
+
220
+ GoogleAPI -->|EU Endpoint| EU[eu-texttospeech.googleapis.com]
221
+ EdenAPI -.-> OpenAI[OpenAI TTS]
222
+ EdenAPI -.-> Amazon[Amazon Polly]
223
+ ```
224
+
225
+ ---
226
+
227
+ ## 🧩 Supported Providers
228
+
229
+ | Provider | Status | GDPR/DSGVO | Key Features |
230
+ |----------|--------|------------|--------------|
231
+ | **Azure** | ✅ Stable | ✅ EU Regions | Neural Voices, Emotions, Styles, SSML |
232
+ | **Google Cloud** | ✅ Stable | ✅ EU Endpoints | Neural2, WaveNet, Studio, Chirp3-HD, Effects Profiles |
233
+ | **EdenAI** | ✅ Stable | ⚠️ No DPA | Aggregator for Google, OpenAI, Amazon, IBM |
234
+ | **OpenAI** | 🔮 Planned | ❌ | HD Audio, Simple API |
235
+ | **ElevenLabs** | 🔮 Planned | ❌ | Voice Cloning, High Expressivity |
236
+
237
+ ---
238
+
239
+ ## 🔧 Logging Configuration
240
+
241
+ The middleware includes a pluggable logger interface. By default, it uses `console`, but you can replace it with any logger (Winston, Pino, etc.).
242
+
243
+ ```typescript
244
+ import { setLogger, silentLogger, setLogLevel } from '@loonylabs/tts-middleware';
245
+
246
+ // Disable all logging (useful for tests)
247
+ setLogger(silentLogger);
248
+
249
+ // Set minimum log level (debug, info, warn, error)
250
+ setLogLevel('warn'); // Only show warnings and errors
251
+
252
+ // Use custom logger (e.g., Winston)
253
+ setLogger({
254
+ info: (msg, meta) => winston.info(msg, meta),
255
+ warn: (msg, meta) => winston.warn(msg, meta),
256
+ error: (msg, meta) => winston.error(msg, meta),
257
+ debug: (msg, meta) => winston.debug(msg, meta),
258
+ });
259
+ ```
260
+
261
+ ---
262
+
263
+ ## 🧪 Testing
264
+
265
+ The project maintains high code coverage (>90%) with 434+ tests using Jest.
266
+
267
+ ```bash
268
+ # Run all tests
269
+ npm test
270
+
271
+ # Run specific provider tests
272
+ npm test -- --testPathPattern="google"
273
+ npm test -- --testPathPattern="azure"
274
+ npm test -- --testPathPattern="edenai"
275
+
276
+ # Manual verification scripts (require .env)
277
+ npx ts-node scripts/manual-test-google-cloud-tts.ts de neural2
278
+ npx ts-node scripts/manual-test-edenai.ts
279
+
280
+ # List available Google Cloud voices
281
+ npx ts-node scripts/list-google-voices.ts de-DE
282
+ npx ts-node scripts/list-google-voices.ts en-US
283
+ ```
284
+
285
+ ## 🤝 Contributing
286
+
287
+ See [CONTRIBUTING.md](CONTRIBUTING.md) for detailed guidelines.
288
+
289
+ Contributions are welcome! Please ensure:
290
+ 1. **Tests:** Add tests for new features.
291
+ 2. **Linting:** Run `npm run lint` before committing.
292
+ 3. **Conventions:** Follow the existing project structure.
293
+
294
+ ## 📄 License
295
+
201
296
  [MIT](LICENSE) © 2026 LoonyLabs Team
@@ -20,9 +20,10 @@
20
20
  */
21
21
  export { TTSService, ttsService } from './tts.service';
22
22
  export { TTSProvider, TTSErrorCode, AudioFormat, } from './types';
23
- export type { AudioOptions, VoiceConfig, TTSSynthesizeRequest, TTSResponse, TTSResponseMetadata, TTSBillingInfo, TTSVoice, TTSVoiceMetadata, AzureProviderOptions, OpenAIProviderOptions, ElevenLabsProviderOptions, GoogleCloudProviderOptions, DeepgramProviderOptions, EdenAIProviderOptions, ProviderOptions, } from './types';
24
- export { isAzureOptions, isOpenAIOptions, isElevenLabsOptions, isGoogleCloudOptions, isDeepgramOptions, isEdenAIOptions, } from './types';
25
- export { BaseTTSProvider, AzureProvider, EdenAIProvider, } from './providers';
23
+ export type { AudioOptions, VoiceConfig, TTSSynthesizeRequest, TTSResponse, TTSResponseMetadata, TTSBillingInfo, TTSVoice, TTSVoiceMetadata, AzureProviderOptions, OpenAIProviderOptions, ElevenLabsProviderOptions, GoogleCloudProviderOptions, GoogleCloudTTSProviderOptions, DeepgramProviderOptions, EdenAIProviderOptions, ProviderOptions, } from './types';
24
+ export { isAzureOptions, isOpenAIOptions, isElevenLabsOptions, isGoogleCloudOptions, isGoogleCloudTTSOptions, isDeepgramOptions, isEdenAIOptions, } from './types';
25
+ export { BaseTTSProvider, AzureProvider, EdenAIProvider, GoogleCloudTTSProvider, } from './providers';
26
+ export type { GoogleCloudTTSRegion, GoogleCloudTTSConfig, } from './providers';
26
27
  export { TTSError, InvalidConfigError, InvalidVoiceError, QuotaExceededError, ProviderUnavailableError, SynthesisFailedError, NetworkError, } from './providers';
27
28
  export { countCharacters, countCharactersWithoutSSML, validateCharacterCount, countBillableCharacters, estimateAudioDuration, formatCharacterCount, } from './utils';
28
29
  export { setLogger, getLogger, resetLogger, setLogLevel, getLogLevel, silentLogger, } from './utils';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/middleware/services/tts/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAGH,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAGvD,OAAO,EACL,WAAW,EACX,YAAY,EACZ,WAAW,GACZ,MAAM,SAAS,CAAC;AAEjB,YAAY,EACV,YAAY,EACZ,WAAW,EACX,oBAAoB,EACpB,WAAW,EACX,mBAAmB,EACnB,cAAc,EACd,QAAQ,EACR,gBAAgB,EAChB,oBAAoB,EACpB,qBAAqB,EACrB,yBAAyB,EACzB,0BAA0B,EAC1B,uBAAuB,EACvB,qBAAqB,EACrB,eAAe,GAChB,MAAM,SAAS,CAAC;AAEjB,OAAO,EACL,cAAc,EACd,eAAe,EACf,mBAAmB,EACnB,oBAAoB,EACpB,iBAAiB,EACjB,eAAe,GAChB,MAAM,SAAS,CAAC;AAGjB,OAAO,EACL,eAAe,EACf,aAAa,EACb,cAAc,GACf,MAAM,aAAa,CAAC;AAGrB,OAAO,EACL,QAAQ,EACR,kBAAkB,EAClB,iBAAiB,EACjB,kBAAkB,EAClB,wBAAwB,EACxB,oBAAoB,EACpB,YAAY,GACb,MAAM,aAAa,CAAC;AAGrB,OAAO,EACL,eAAe,EACf,0BAA0B,EAC1B,sBAAsB,EACtB,uBAAuB,EACvB,qBAAqB,EACrB,oBAAoB,GACrB,MAAM,SAAS,CAAC;AAGjB,OAAO,EACL,SAAS,EACT,SAAS,EACT,WAAW,EACX,WAAW,EACX,WAAW,EACX,YAAY,GACb,MAAM,SAAS,CAAC;AAEjB,YAAY,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/middleware/services/tts/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAGH,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAGvD,OAAO,EACL,WAAW,EACX,YAAY,EACZ,WAAW,GACZ,MAAM,SAAS,CAAC;AAEjB,YAAY,EACV,YAAY,EACZ,WAAW,EACX,oBAAoB,EACpB,WAAW,EACX,mBAAmB,EACnB,cAAc,EACd,QAAQ,EACR,gBAAgB,EAChB,oBAAoB,EACpB,qBAAqB,EACrB,yBAAyB,EACzB,0BAA0B,EAC1B,6BAA6B,EAC7B,uBAAuB,EACvB,qBAAqB,EACrB,eAAe,GAChB,MAAM,SAAS,CAAC;AAEjB,OAAO,EACL,cAAc,EACd,eAAe,EACf,mBAAmB,EACnB,oBAAoB,EACpB,uBAAuB,EACvB,iBAAiB,EACjB,eAAe,GAChB,MAAM,SAAS,CAAC;AAGjB,OAAO,EACL,eAAe,EACf,aAAa,EACb,cAAc,EACd,sBAAsB,GACvB,MAAM,aAAa,CAAC;AAErB,YAAY,EACV,oBAAoB,EACpB,oBAAoB,GACrB,MAAM,aAAa,CAAC;AAGrB,OAAO,EACL,QAAQ,EACR,kBAAkB,EAClB,iBAAiB,EACjB,kBAAkB,EAClB,wBAAwB,EACxB,oBAAoB,EACpB,YAAY,GACb,MAAM,aAAa,CAAC;AAGrB,OAAO,EACL,eAAe,EACf,0BAA0B,EAC1B,sBAAsB,EACtB,uBAAuB,EACvB,qBAAqB,EACrB,oBAAoB,GACrB,MAAM,SAAS,CAAC;AAGjB,OAAO,EACL,SAAS,EACT,SAAS,EACT,WAAW,EACX,WAAW,EACX,WAAW,EACX,YAAY,GACb,MAAM,SAAS,CAAC;AAEjB,YAAY,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC"}
@@ -20,7 +20,7 @@
20
20
  * @module @loonylabs/tts-middleware
21
21
  */
22
22
  Object.defineProperty(exports, "__esModule", { value: true });
23
- exports.silentLogger = exports.getLogLevel = exports.setLogLevel = exports.resetLogger = exports.getLogger = exports.setLogger = exports.formatCharacterCount = exports.estimateAudioDuration = exports.countBillableCharacters = exports.validateCharacterCount = exports.countCharactersWithoutSSML = exports.countCharacters = exports.NetworkError = exports.SynthesisFailedError = exports.ProviderUnavailableError = exports.QuotaExceededError = exports.InvalidVoiceError = exports.InvalidConfigError = exports.TTSError = exports.EdenAIProvider = exports.AzureProvider = exports.BaseTTSProvider = exports.isEdenAIOptions = exports.isDeepgramOptions = exports.isGoogleCloudOptions = exports.isElevenLabsOptions = exports.isOpenAIOptions = exports.isAzureOptions = exports.TTSErrorCode = exports.TTSProvider = exports.ttsService = exports.TTSService = void 0;
23
+ exports.silentLogger = exports.getLogLevel = exports.setLogLevel = exports.resetLogger = exports.getLogger = exports.setLogger = exports.formatCharacterCount = exports.estimateAudioDuration = exports.countBillableCharacters = exports.validateCharacterCount = exports.countCharactersWithoutSSML = exports.countCharacters = exports.NetworkError = exports.SynthesisFailedError = exports.ProviderUnavailableError = exports.QuotaExceededError = exports.InvalidVoiceError = exports.InvalidConfigError = exports.TTSError = exports.GoogleCloudTTSProvider = exports.EdenAIProvider = exports.AzureProvider = exports.BaseTTSProvider = exports.isEdenAIOptions = exports.isDeepgramOptions = exports.isGoogleCloudTTSOptions = exports.isGoogleCloudOptions = exports.isElevenLabsOptions = exports.isOpenAIOptions = exports.isAzureOptions = exports.TTSErrorCode = exports.TTSProvider = exports.ttsService = exports.TTSService = void 0;
24
24
  // ===== Main Service =====
25
25
  var tts_service_1 = require("./tts.service");
26
26
  Object.defineProperty(exports, "TTSService", { enumerable: true, get: function () { return tts_service_1.TTSService; } });
@@ -34,6 +34,7 @@ Object.defineProperty(exports, "isAzureOptions", { enumerable: true, get: functi
34
34
  Object.defineProperty(exports, "isOpenAIOptions", { enumerable: true, get: function () { return types_2.isOpenAIOptions; } });
35
35
  Object.defineProperty(exports, "isElevenLabsOptions", { enumerable: true, get: function () { return types_2.isElevenLabsOptions; } });
36
36
  Object.defineProperty(exports, "isGoogleCloudOptions", { enumerable: true, get: function () { return types_2.isGoogleCloudOptions; } });
37
+ Object.defineProperty(exports, "isGoogleCloudTTSOptions", { enumerable: true, get: function () { return types_2.isGoogleCloudTTSOptions; } });
37
38
  Object.defineProperty(exports, "isDeepgramOptions", { enumerable: true, get: function () { return types_2.isDeepgramOptions; } });
38
39
  Object.defineProperty(exports, "isEdenAIOptions", { enumerable: true, get: function () { return types_2.isEdenAIOptions; } });
39
40
  // ===== Providers =====
@@ -41,6 +42,7 @@ var providers_1 = require("./providers");
41
42
  Object.defineProperty(exports, "BaseTTSProvider", { enumerable: true, get: function () { return providers_1.BaseTTSProvider; } });
42
43
  Object.defineProperty(exports, "AzureProvider", { enumerable: true, get: function () { return providers_1.AzureProvider; } });
43
44
  Object.defineProperty(exports, "EdenAIProvider", { enumerable: true, get: function () { return providers_1.EdenAIProvider; } });
45
+ Object.defineProperty(exports, "GoogleCloudTTSProvider", { enumerable: true, get: function () { return providers_1.GoogleCloudTTSProvider; } });
44
46
  // ===== Errors =====
45
47
  var providers_2 = require("./providers");
46
48
  Object.defineProperty(exports, "TTSError", { enumerable: true, get: function () { return providers_2.TTSError; } });
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/middleware/services/tts/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;;;AAEH,2BAA2B;AAC3B,6CAAuD;AAA9C,yGAAA,UAAU,OAAA;AAAE,yGAAA,UAAU,OAAA;AAE/B,oBAAoB;AACpB,iCAIiB;AAHf,oGAAA,WAAW,OAAA;AACX,qGAAA,YAAY,OAAA;AAsBd,iCAOiB;AANf,uGAAA,cAAc,OAAA;AACd,wGAAA,eAAe,OAAA;AACf,4GAAA,mBAAmB,OAAA;AACnB,6GAAA,oBAAoB,OAAA;AACpB,0GAAA,iBAAiB,OAAA;AACjB,wGAAA,eAAe,OAAA;AAGjB,wBAAwB;AACxB,yCAIqB;AAHnB,4GAAA,eAAe,OAAA;AACf,0GAAA,aAAa,OAAA;AACb,2GAAA,cAAc,OAAA;AAGhB,qBAAqB;AACrB,yCAQqB;AAPnB,qGAAA,QAAQ,OAAA;AACR,+GAAA,kBAAkB,OAAA;AAClB,8GAAA,iBAAiB,OAAA;AACjB,+GAAA,kBAAkB,OAAA;AAClB,qHAAA,wBAAwB,OAAA;AACxB,iHAAA,oBAAoB,OAAA;AACpB,yGAAA,YAAY,OAAA;AAGd,wBAAwB;AACxB,iCAOiB;AANf,wGAAA,eAAe,OAAA;AACf,mHAAA,0BAA0B,OAAA;AAC1B,+GAAA,sBAAsB,OAAA;AACtB,gHAAA,uBAAuB,OAAA;AACvB,8GAAA,qBAAqB,OAAA;AACrB,6GAAA,oBAAoB,OAAA;AAGtB,qBAAqB;AACrB,iCAOiB;AANf,kGAAA,SAAS,OAAA;AACT,kGAAA,SAAS,OAAA;AACT,oGAAA,WAAW,OAAA;AACX,oGAAA,WAAW,OAAA;AACX,oGAAA,WAAW,OAAA;AACX,qGAAA,YAAY,OAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/middleware/services/tts/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;;;AAEH,2BAA2B;AAC3B,6CAAuD;AAA9C,yGAAA,UAAU,OAAA;AAAE,yGAAA,UAAU,OAAA;AAE/B,oBAAoB;AACpB,iCAIiB;AAHf,oGAAA,WAAW,OAAA;AACX,qGAAA,YAAY,OAAA;AAuBd,iCAQiB;AAPf,uGAAA,cAAc,OAAA;AACd,wGAAA,eAAe,OAAA;AACf,4GAAA,mBAAmB,OAAA;AACnB,6GAAA,oBAAoB,OAAA;AACpB,gHAAA,uBAAuB,OAAA;AACvB,0GAAA,iBAAiB,OAAA;AACjB,wGAAA,eAAe,OAAA;AAGjB,wBAAwB;AACxB,yCAKqB;AAJnB,4GAAA,eAAe,OAAA;AACf,0GAAA,aAAa,OAAA;AACb,2GAAA,cAAc,OAAA;AACd,mHAAA,sBAAsB,OAAA;AAQxB,qBAAqB;AACrB,yCAQqB;AAPnB,qGAAA,QAAQ,OAAA;AACR,+GAAA,kBAAkB,OAAA;AAClB,8GAAA,iBAAiB,OAAA;AACjB,+GAAA,kBAAkB,OAAA;AAClB,qHAAA,wBAAwB,OAAA;AACxB,iHAAA,oBAAoB,OAAA;AACpB,yGAAA,YAAY,OAAA;AAGd,wBAAwB;AACxB,iCAOiB;AANf,wGAAA,eAAe,OAAA;AACf,mHAAA,0BAA0B,OAAA;AAC1B,+GAAA,sBAAsB,OAAA;AACtB,gHAAA,uBAAuB,OAAA;AACvB,8GAAA,qBAAqB,OAAA;AACrB,6GAAA,oBAAoB,OAAA;AAGtB,qBAAqB;AACrB,iCAOiB;AANf,kGAAA,SAAS,OAAA;AACT,kGAAA,SAAS,OAAA;AACT,oGAAA,WAAW,OAAA;AACX,oGAAA,WAAW,OAAA;AACX,oGAAA,WAAW,OAAA;AACX,qGAAA,YAAY,OAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"edenai-provider.d.ts","sourceRoot":"","sources":["../../../../../src/middleware/services/tts/providers/edenai-provider.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,oBAAoB,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAElE,OAAO,EACL,eAAe,EAEhB,MAAM,qBAAqB,CAAC;AAG7B;;GAEG;AACH,UAAU,YAAY;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAeD;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,qBAAa,cAAe,SAAQ,eAAe;IACjD,OAAO,CAAC,MAAM,CAAe;IAC7B,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAS;IAEhC;;;;;OAKG;gBACS,MAAM,CAAC,EAAE,OAAO,CAAC,YAAY,CAAC;IAqB1C;;;;;OAKG;IACH,OAAO,CAAC,oBAAoB;IAS5B;;;;;;;;;OASG;IACG,UAAU,CACd,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,oBAAoB,GAC5B,OAAO,CAAC,WAAW,CAAC;IA2DvB;;;;;;;;;;;;;;;;;;OAkBG;IACH,OAAO,CAAC,kBAAkB;IAkD1B;;;;;;;OAOG;YACW,aAAa;IAmC3B;;;;;;OAMG;YACW,wBAAwB;IA2CtC;;;;;;;;;;;;OAYG;IACH,OAAO,CAAC,eAAe;CAWxB"}
1
+ {"version":3,"file":"edenai-provider.d.ts","sourceRoot":"","sources":["../../../../../src/middleware/services/tts/providers/edenai-provider.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,oBAAoB,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAElE,OAAO,EACL,eAAe,EAEhB,MAAM,qBAAqB,CAAC;AAG7B;;GAEG;AACH,UAAU,YAAY;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAeD;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,qBAAa,cAAe,SAAQ,eAAe;IACjD,OAAO,CAAC,MAAM,CAAe;IAC7B,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAS;IAEhC;;;;;OAKG;gBACS,MAAM,CAAC,EAAE,OAAO,CAAC,YAAY,CAAC;IAqB1C;;;;;OAKG;IACH,OAAO,CAAC,oBAAoB;IAS5B;;;;;;;;;OASG;IACG,UAAU,CACd,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,oBAAoB,GAC5B,OAAO,CAAC,WAAW,CAAC;IA2DvB;;;;;;;;;;;;;;;;;;OAkBG;IACH,OAAO,CAAC,kBAAkB;IA+C1B;;;;;;;OAOG;YACW,aAAa;IAmC3B;;;;;;OAMG;YACW,wBAAwB;IA2CtC;;;;;;;;;;;;OAYG;IACH,OAAO,CAAC,eAAe;CAWxB"}
@@ -166,16 +166,16 @@ class EdenAIProvider extends base_tts_provider_1.BaseTTSProvider {
166
166
  // Default to FEMALE - EdenAI requires this field
167
167
  edenaiRequest.option = 'FEMALE';
168
168
  }
169
- // Build settings object for model-specific options only
170
- // Note: EdenAI settings format is { "model": "Neural" } style, NOT speaking_rate etc.
171
- const settings = {};
172
- // Model selection (e.g., "Neural", "Standard", "Wavenet")
173
- if (options.model) {
174
- settings.model = options.model;
169
+ // Build settings object for provider-specific model/voice selection
170
+ // Format: { "provider_name": "model_or_voice_id" }
171
+ // Example: { "openai": "de_nova" } or { "google": "Neural" }
172
+ if (options.settings) {
173
+ edenaiRequest.settings = options.settings;
175
174
  }
176
- // Add settings to request only if model is specified
177
- if (Object.keys(settings).length > 0) {
178
- edenaiRequest.settings = settings;
175
+ else if (options.model) {
176
+ // Legacy: if model is specified without settings, build settings object
177
+ const providerName = (options.provider || 'google').split('/')[0];
178
+ edenaiRequest.settings = { [providerName]: options.model };
179
179
  }
180
180
  // Fallback providers (top-level)
181
181
  if (options.fallback_providers && options.fallback_providers.length > 0) {
@@ -1 +1 @@
1
- {"version":3,"file":"edenai-provider.js","sourceRoot":"","sources":["../../../../../src/middleware/services/tts/providers/edenai-provider.ts"],"names":[],"mappings":";AAAA;;;;;;;;GAQG;;;AAGH,oCAAuC;AACvC,2DAG6B;AAwB7B;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAa,cAAe,SAAQ,mCAAe;IAIjD;;;;;OAKG;IACH,YAAY,MAA8B;QACxC,KAAK,CAAC,mBAAW,CAAC,MAAM,CAAC,CAAC;QAE1B,yDAAyD;QACzD,IAAI,CAAC,MAAM,GAAG;YACZ,MAAM,EAAE,MAAM,EAAE,MAAM,IAAI,OAAO,CAAC,GAAG,CAAC,cAAc,IAAI,EAAE;YAC1D,MAAM,EAAE,MAAM,EAAE,MAAM;SACvB,CAAC;QAEF,IAAI,CAAC,MAAM;YACT,IAAI,CAAC,MAAM,CAAC,MAAM,IAAI,gDAAgD,CAAC;QAEzE,yBAAyB;QACzB,IAAI,CAAC,oBAAoB,EAAE,CAAC;QAE5B,IAAI,CAAC,GAAG,CAAC,MAAM,EAAE,6BAA6B,EAAE;YAC9C,SAAS,EAAE,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM;YAC/B,MAAM,EAAE,IAAI,CAAC,MAAM;SACpB,CAAC,CAAC;IACL,CAAC;IAED;;;;;OAKG;IACK,oBAAoB;QAC1B,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC;YACxB,MAAM,IAAI,sCAAkB,CAC1B,IAAI,CAAC,YAAY,EACjB,6CAA6C,CAC9C,CAAC;QACJ,CAAC;IACH,CAAC;IAED;;;;;;;;;OASG;IACH,KAAK,CAAC,UAAU,CACd,IAAY,EACZ,OAAe,EACf,OAA6B;QAE7B,yBAAyB;QACzB,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC;QAE7B,MAAM,SAAS,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;QAE7B,sFAAsF;QACtF,MAAM,OAAO,GAAG,CAAC,OAAO,CAAC,eAAe,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,mDAAmD;QACnD,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC,yBAAyB,CAAC,CAAC;QAEvD,IAAI,KAAK,EAAE,CAAC;YACV,OAAO,KAAK,CAAC,CAAC,CAAC,CAAC;QAClB,CAAC;QAED,0DAA0D;QAC1D,OAAO,OAAO,CAAC;IACjB,CAAC;CACF;AAjTD,wCAiTC"}
1
+ {"version":3,"file":"edenai-provider.js","sourceRoot":"","sources":["../../../../../src/middleware/services/tts/providers/edenai-provider.ts"],"names":[],"mappings":";AAAA;;;;;;;;GAQG;;;AAGH,oCAAuC;AACvC,2DAG6B;AAwB7B;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAa,cAAe,SAAQ,mCAAe;IAIjD;;;;;OAKG;IACH,YAAY,MAA8B;QACxC,KAAK,CAAC,mBAAW,CAAC,MAAM,CAAC,CAAC;QAE1B,yDAAyD;QACzD,IAAI,CAAC,MAAM,GAAG;YACZ,MAAM,EAAE,MAAM,EAAE,MAAM,IAAI,OAAO,CAAC,GAAG,CAAC,cAAc,IAAI,EAAE;YAC1D,MAAM,EAAE,MAAM,EAAE,MAAM;SACvB,CAAC;QAEF,IAAI,CAAC,MAAM;YACT,IAAI,CAAC,MAAM,CAAC,MAAM,IAAI,gDAAgD,CAAC;QAEzE,yBAAyB;QACzB,IAAI,CAAC,oBAAoB,EAAE,CAAC;QAE5B,IAAI,CAAC,GAAG,CAAC,MAAM,EAAE,6BAA6B,EAAE;YAC9C,SAAS,EAAE,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM;YAC/B,MAAM,EAAE,IAAI,CAAC,MAAM;SACpB,CAAC,CAAC;IACL,CAAC;IAED;;;;;OAKG;IACK,oBAAoB;QAC1B,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC;YACxB,MAAM,IAAI,sCAAkB,CAC1B,IAAI,CAAC,YAAY,EACjB,6CAA6C,CAC9C,CAAC;QACJ,CAAC;IACH,CAAC;IAED;;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