@pie-players/tts-server-polly 0.1.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.
@@ -0,0 +1 @@
1
+ $ tsc
package/README.md ADDED
@@ -0,0 +1,181 @@
1
+ # @pie-players/tts-server-polly
2
+
3
+ AWS Polly provider for server-side text-to-speech with native speech marks support.
4
+
5
+ ## Overview
6
+
7
+ This package provides a server-side TTS provider that uses AWS Polly to generate high-quality neural speech with millisecond-precise word timing through speech marks.
8
+
9
+ ## Features
10
+
11
+ - ✅ **Native Speech Marks** - Millisecond-accurate word timing from AWS Polly
12
+ - ✅ **Neural Voices** - High-quality neural TTS (default) or standard voices
13
+ - ✅ **25+ Languages** - Wide language support
14
+ - ✅ **Full SSML** - Supports Speech Synthesis Markup Language
15
+ - ✅ **Parallel Requests** - Audio and speech marks fetched simultaneously
16
+ - ✅ **60+ Voices** - Multiple voices per language
17
+
18
+ ## Installation
19
+
20
+ ```bash
21
+ npm install @pie-players/tts-server-polly
22
+ ```
23
+
24
+ ## Usage
25
+
26
+ ### Basic Setup
27
+
28
+ ```typescript
29
+ import { PollyServerProvider } from '@pie-players/tts-server-polly';
30
+
31
+ const provider = new PollyServerProvider();
32
+
33
+ await provider.initialize({
34
+ region: 'us-east-1',
35
+ credentials: {
36
+ accessKeyId: process.env.AWS_ACCESS_KEY_ID!,
37
+ secretAccessKey: process.env.AWS_SECRET_ACCESS_KEY!,
38
+ },
39
+ engine: 'neural', // or 'standard'
40
+ defaultVoice: 'Joanna',
41
+ });
42
+ ```
43
+
44
+ ### Synthesize Speech
45
+
46
+ ```typescript
47
+ const result = await provider.synthesize({
48
+ text: 'Hello world, this is a test of AWS Polly text to speech.',
49
+ voice: 'Joanna', // Optional, uses defaultVoice if not specified
50
+ includeSpeechMarks: true,
51
+ });
52
+
53
+ console.log('Audio:', result.audio); // Buffer
54
+ console.log('Speech marks:', result.speechMarks); // Array of word timings
55
+ console.log('Duration:', result.metadata.duration, 'seconds');
56
+ ```
57
+
58
+ ### List Available Voices
59
+
60
+ ```typescript
61
+ // Get all neural voices
62
+ const voices = await provider.getVoices();
63
+
64
+ // Filter by language
65
+ const spanishVoices = await provider.getVoices({ language: 'es-ES' });
66
+
67
+ // Filter by gender
68
+ const femaleVoices = await provider.getVoices({ gender: 'female' });
69
+ ```
70
+
71
+ ### Speech Marks Example
72
+
73
+ ```typescript
74
+ const result = await provider.synthesize({
75
+ text: 'Hello world',
76
+ includeSpeechMarks: true,
77
+ });
78
+
79
+ // result.speechMarks:
80
+ // [
81
+ // { time: 0, type: 'word', start: 0, end: 5, value: 'Hello' },
82
+ // { time: 340, type: 'word', start: 6, end: 11, value: 'world' }
83
+ // ]
84
+ ```
85
+
86
+ ## Configuration
87
+
88
+ ### PollyProviderConfig
89
+
90
+ ```typescript
91
+ interface PollyProviderConfig {
92
+ region: string; // AWS region (required)
93
+ credentials?: { // AWS credentials (optional if using IAM)
94
+ accessKeyId: string;
95
+ secretAccessKey: string;
96
+ sessionToken?: string;
97
+ };
98
+ engine?: 'neural' | 'standard'; // Voice engine (default: 'neural')
99
+ defaultVoice?: string; // Default voice ID (default: 'Joanna')
100
+ }
101
+ ```
102
+
103
+ ### Environment Variables
104
+
105
+ ```bash
106
+ AWS_REGION=us-east-1
107
+ AWS_ACCESS_KEY_ID=your_key_id
108
+ AWS_SECRET_ACCESS_KEY=your_secret_key
109
+ ```
110
+
111
+ ## Capabilities
112
+
113
+ | Feature | Support |
114
+ |---------|---------|
115
+ | Speech Marks | ✅ Native |
116
+ | SSML | ✅ Full |
117
+ | Pitch Control | ⚠️ SSML only |
118
+ | Rate Control | ✅ SSML |
119
+ | Volume Control | ❌ Client-side |
120
+ | Max Text Length | 3000 chars |
121
+ | Audio Format | MP3 |
122
+
123
+ ## Cost
124
+
125
+ - **Standard voices:** $4 per 1M characters
126
+ - **Neural voices:** $16 per 1M characters
127
+ - **Speech marks:** Included (no extra charge)
128
+
129
+ ## Supported Voices
130
+
131
+ Popular voices include:
132
+
133
+ - **English (US):** Joanna, Matthew, Ivy, Kendra, Joey
134
+ - **English (UK):** Amy, Brian, Emma
135
+ - **Spanish:** Lucia, Conchita, Enrique
136
+ - **French:** Celine, Mathieu
137
+ - **German:** Marlene, Hans
138
+ - **Italian:** Carla, Giorgio
139
+ - **Portuguese:** Vitoria, Ricardo
140
+
141
+ Use `getVoices()` for complete list.
142
+
143
+ ## Error Handling
144
+
145
+ ```typescript
146
+ import { TTSError, TTSErrorCode } from '@pie-players/tts-server-core';
147
+
148
+ try {
149
+ const result = await provider.synthesize({ text: 'Hello' });
150
+ } catch (error) {
151
+ if (error instanceof TTSError) {
152
+ console.error('Error code:', error.code);
153
+ console.error('Message:', error.message);
154
+ console.error('Provider:', error.providerId);
155
+ }
156
+ }
157
+ ```
158
+
159
+ ## AWS IAM Permissions
160
+
161
+ Required IAM permissions:
162
+
163
+ ```json
164
+ {
165
+ "Version": "2012-10-17",
166
+ "Statement": [
167
+ {
168
+ "Effect": "Allow",
169
+ "Action": [
170
+ "polly:SynthesizeSpeech",
171
+ "polly:DescribeVoices"
172
+ ],
173
+ "Resource": "*"
174
+ }
175
+ ]
176
+ }
177
+ ```
178
+
179
+ ## License
180
+
181
+ MIT
@@ -0,0 +1,106 @@
1
+ /**
2
+ * AWS Polly server-side TTS provider
3
+ * @module @pie-players/tts-server-polly
4
+ */
5
+ import { BaseTTSProvider, type GetVoicesOptions, type ServerProviderCapabilities, type SynthesizeRequest, type SynthesizeResponse, type TTSServerConfig, type Voice } from "@pie-players/tts-server-core";
6
+ /**
7
+ * AWS Polly provider configuration.
8
+ *
9
+ * This extends the base TTSServerConfig with Polly-specific settings.
10
+ * All fields marked with @extension are AWS-specific and not portable.
11
+ */
12
+ export interface PollyProviderConfig extends TTSServerConfig {
13
+ /**
14
+ * AWS region (e.g., 'us-east-1', 'us-west-2', 'eu-west-1')
15
+ *
16
+ * @extension AWS-specific (region concept)
17
+ * @required
18
+ */
19
+ region: string;
20
+ /**
21
+ * AWS credentials for API authentication
22
+ *
23
+ * @extension AWS-specific
24
+ * @note In production, prefer IAM roles over hardcoded credentials
25
+ * @see https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/setting-credentials.html
26
+ */
27
+ credentials?: {
28
+ accessKeyId: string;
29
+ secretAccessKey: string;
30
+ sessionToken?: string;
31
+ };
32
+ /**
33
+ * Polly engine type: 'neural' (higher quality) or 'standard' (lower cost)
34
+ *
35
+ * @extension AWS Polly-specific
36
+ * @default 'neural'
37
+ * @note Neural: $16/1M chars, Standard: $4/1M chars
38
+ */
39
+ engine?: "neural" | "standard";
40
+ /**
41
+ * Default voice ID if not specified in synthesis requests
42
+ *
43
+ * @standard Voice selection is standard, but voice names are provider-specific
44
+ * @default 'Joanna'
45
+ * @see https://docs.aws.amazon.com/polly/latest/dg/voicelist.html
46
+ */
47
+ defaultVoice?: string;
48
+ }
49
+ /**
50
+ * AWS Polly Server Provider
51
+ *
52
+ * Provides high-quality neural text-to-speech with precise word-level timing
53
+ * through AWS Polly speech marks.
54
+ *
55
+ * Features:
56
+ * - Native speech marks support (millisecond precision)
57
+ * - Neural and standard voices
58
+ * - 25+ languages
59
+ * - Full SSML support
60
+ * - Parallel audio + speech marks requests
61
+ */
62
+ export declare class PollyServerProvider extends BaseTTSProvider {
63
+ readonly providerId = "aws-polly";
64
+ readonly providerName = "AWS Polly";
65
+ readonly version = "1.0.0";
66
+ private client;
67
+ private engine;
68
+ private defaultVoice;
69
+ /**
70
+ * Initialize the AWS Polly provider.
71
+ *
72
+ * This is FAST and lightweight - only validates config and creates the Polly client.
73
+ * Does NOT fetch voices or make test API calls.
74
+ *
75
+ * @param config - Polly configuration with region and credentials
76
+ * @performance Completes in ~10-50ms
77
+ */
78
+ initialize(config: PollyProviderConfig): Promise<void>;
79
+ /**
80
+ * Synthesize speech with AWS Polly
81
+ */
82
+ synthesize(request: SynthesizeRequest): Promise<SynthesizeResponse>;
83
+ /**
84
+ * Synthesize audio stream
85
+ */
86
+ private synthesizeAudio;
87
+ /**
88
+ * Synthesize speech marks
89
+ */
90
+ private synthesizeSpeechMarks;
91
+ /**
92
+ * Get available voices from AWS Polly
93
+ */
94
+ getVoices(options?: GetVoicesOptions): Promise<Voice[]>;
95
+ /**
96
+ * Get AWS Polly capabilities.
97
+ *
98
+ * Clearly documents what features are W3C-standard vs AWS-specific.
99
+ */
100
+ getCapabilities(): ServerProviderCapabilities;
101
+ /**
102
+ * Clean up AWS Polly client
103
+ */
104
+ destroy(): Promise<void>;
105
+ }
106
+ //# sourceMappingURL=PollyServerProvider.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PollyServerProvider.d.ts","sourceRoot":"","sources":["../src/PollyServerProvider.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAaH,OAAO,EACN,eAAe,EACf,KAAK,gBAAgB,EACrB,KAAK,0BAA0B,EAE/B,KAAK,iBAAiB,EACtB,KAAK,kBAAkB,EAGvB,KAAK,eAAe,EACpB,KAAK,KAAK,EACV,MAAM,8BAA8B,CAAC;AAEtC;;;;;GAKG;AACH,MAAM,WAAW,mBAAoB,SAAQ,eAAe;IAC3D;;;;;OAKG;IACH,MAAM,EAAE,MAAM,CAAC;IAEf;;;;;;OAMG;IACH,WAAW,CAAC,EAAE;QACb,WAAW,EAAE,MAAM,CAAC;QACpB,eAAe,EAAE,MAAM,CAAC;QACxB,YAAY,CAAC,EAAE,MAAM,CAAC;KACtB,CAAC;IAEF;;;;;;OAMG;IACH,MAAM,CAAC,EAAE,QAAQ,GAAG,UAAU,CAAC;IAE/B;;;;;;OAMG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;CACtB;AAED;;;;;;;;;;;;GAYG;AACH,qBAAa,mBAAoB,SAAQ,eAAe;IACvD,QAAQ,CAAC,UAAU,eAAe;IAClC,QAAQ,CAAC,YAAY,eAAe;IACpC,QAAQ,CAAC,OAAO,WAAW;IAE3B,OAAO,CAAC,MAAM,CAAe;IAC7B,OAAO,CAAC,MAAM,CAAmC;IACjD,OAAO,CAAC,YAAY,CAAY;IAEhC;;;;;;;;OAQG;IACG,UAAU,CAAC,MAAM,EAAE,mBAAmB,GAAG,OAAO,CAAC,IAAI,CAAC;IAiC5D;;OAEG;IACG,UAAU,CAAC,OAAO,EAAE,iBAAiB,GAAG,OAAO,CAAC,kBAAkB,CAAC;IA2CzE;;OAEG;YACW,eAAe;IAyD7B;;OAEG;YACW,qBAAqB;IAiEnC;;OAEG;IACG,SAAS,CAAC,OAAO,CAAC,EAAE,gBAAgB,GAAG,OAAO,CAAC,KAAK,EAAE,CAAC;IA8D7D;;;;OAIG;IACH,eAAe,IAAI,0BAA0B;IAgC7C;;OAEG;IACG,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;CAM9B"}
@@ -0,0 +1,284 @@
1
+ /**
2
+ * AWS Polly server-side TTS provider
3
+ * @module @pie-players/tts-server-polly
4
+ */
5
+ import { DescribeVoicesCommand, Engine, OutputFormat, PollyClient, SpeechMarkType, SynthesizeSpeechCommand, } from "@aws-sdk/client-polly";
6
+ import { BaseTTSProvider, TTSError, TTSErrorCode, } from "@pie-players/tts-server-core";
7
+ /**
8
+ * AWS Polly Server Provider
9
+ *
10
+ * Provides high-quality neural text-to-speech with precise word-level timing
11
+ * through AWS Polly speech marks.
12
+ *
13
+ * Features:
14
+ * - Native speech marks support (millisecond precision)
15
+ * - Neural and standard voices
16
+ * - 25+ languages
17
+ * - Full SSML support
18
+ * - Parallel audio + speech marks requests
19
+ */
20
+ export class PollyServerProvider extends BaseTTSProvider {
21
+ providerId = "aws-polly";
22
+ providerName = "AWS Polly";
23
+ version = "1.0.0";
24
+ client;
25
+ engine = "neural";
26
+ defaultVoice = "Joanna";
27
+ /**
28
+ * Initialize the AWS Polly provider.
29
+ *
30
+ * This is FAST and lightweight - only validates config and creates the Polly client.
31
+ * Does NOT fetch voices or make test API calls.
32
+ *
33
+ * @param config - Polly configuration with region and credentials
34
+ * @performance Completes in ~10-50ms
35
+ */
36
+ async initialize(config) {
37
+ if (!config.region) {
38
+ throw new TTSError(TTSErrorCode.INITIALIZATION_ERROR, "AWS region is required", undefined, this.providerId);
39
+ }
40
+ this.config = config;
41
+ this.engine = config.engine || "neural";
42
+ this.defaultVoice = config.defaultVoice || "Joanna";
43
+ try {
44
+ // Create Polly client (fast - no API calls)
45
+ this.client = new PollyClient({
46
+ region: config.region,
47
+ credentials: config.credentials,
48
+ });
49
+ this.initialized = true;
50
+ // NOTE: We do NOT call getVoices() here - that's an explicit secondary operation
51
+ }
52
+ catch (error) {
53
+ throw new TTSError(TTSErrorCode.INITIALIZATION_ERROR, `Failed to initialize AWS Polly: ${error instanceof Error ? error.message : String(error)}`, { error }, this.providerId);
54
+ }
55
+ }
56
+ /**
57
+ * Synthesize speech with AWS Polly
58
+ */
59
+ async synthesize(request) {
60
+ this.ensureInitialized();
61
+ const capabilities = this.getCapabilities();
62
+ this.validateRequest(request, capabilities);
63
+ const voice = request.voice || this.defaultVoice;
64
+ const startTime = Date.now();
65
+ try {
66
+ // Make parallel requests for audio and speech marks
67
+ const [audioResponse, speechMarksResponse] = await Promise.all([
68
+ this.synthesizeAudio(request, voice),
69
+ request.includeSpeechMarks !== false
70
+ ? this.synthesizeSpeechMarks(request, voice)
71
+ : Promise.resolve([]),
72
+ ]);
73
+ const duration = (Date.now() - startTime) / 1000;
74
+ return {
75
+ audio: audioResponse.audio,
76
+ contentType: audioResponse.contentType,
77
+ speechMarks: speechMarksResponse,
78
+ metadata: {
79
+ providerId: this.providerId,
80
+ voice,
81
+ duration,
82
+ charCount: request.text.length,
83
+ cached: false,
84
+ timestamp: new Date().toISOString(),
85
+ },
86
+ };
87
+ }
88
+ catch (error) {
89
+ throw new TTSError(TTSErrorCode.PROVIDER_ERROR, `AWS Polly synthesis failed: ${error instanceof Error ? error.message : String(error)}`, { error, request }, this.providerId);
90
+ }
91
+ }
92
+ /**
93
+ * Synthesize audio stream
94
+ */
95
+ async synthesizeAudio(request, voice) {
96
+ // Detect if text contains SSML tags
97
+ const isSsml = request.text.includes("<speak") ||
98
+ request.text.includes("<emphasis") ||
99
+ request.text.includes("<break") ||
100
+ request.text.includes("<prosody") ||
101
+ request.text.includes("<phoneme") ||
102
+ request.text.includes("<amazon:") ||
103
+ request.text.includes("<aws-");
104
+ const textType = isSsml ? "ssml" : "text";
105
+ if (isSsml) {
106
+ console.log("[PollyServerProvider] Detected SSML content, using TextType: ssml");
107
+ }
108
+ const command = new SynthesizeSpeechCommand({
109
+ Engine: this.engine === "neural" ? Engine.NEURAL : Engine.STANDARD,
110
+ OutputFormat: OutputFormat.MP3,
111
+ Text: request.text,
112
+ TextType: textType,
113
+ VoiceId: voice,
114
+ SampleRate: String(request.sampleRate || 24000),
115
+ });
116
+ const response = await this.client.send(command);
117
+ if (!response.AudioStream) {
118
+ throw new Error("No audio stream received from AWS Polly");
119
+ }
120
+ // Convert stream to buffer
121
+ const chunks = [];
122
+ const stream = response.AudioStream;
123
+ if (Symbol.asyncIterator in stream) {
124
+ for await (const chunk of stream) {
125
+ chunks.push(chunk);
126
+ }
127
+ }
128
+ else if (stream instanceof Uint8Array) {
129
+ chunks.push(stream);
130
+ }
131
+ const audioBuffer = Buffer.concat(chunks);
132
+ return {
133
+ audio: audioBuffer,
134
+ contentType: response.ContentType || "audio/mpeg",
135
+ };
136
+ }
137
+ /**
138
+ * Synthesize speech marks
139
+ */
140
+ async synthesizeSpeechMarks(request, voice) {
141
+ // Detect if text contains SSML tags (same logic as audio synthesis)
142
+ const isSsml = request.text.includes("<speak") ||
143
+ request.text.includes("<emphasis") ||
144
+ request.text.includes("<break") ||
145
+ request.text.includes("<prosody") ||
146
+ request.text.includes("<phoneme") ||
147
+ request.text.includes("<amazon:") ||
148
+ request.text.includes("<aws-");
149
+ const textType = isSsml ? "ssml" : "text";
150
+ const command = new SynthesizeSpeechCommand({
151
+ Engine: this.engine === "neural" ? Engine.NEURAL : Engine.STANDARD,
152
+ OutputFormat: OutputFormat.JSON,
153
+ Text: request.text,
154
+ TextType: textType,
155
+ VoiceId: voice,
156
+ SpeechMarkTypes: [SpeechMarkType.WORD],
157
+ });
158
+ const response = await this.client.send(command);
159
+ if (!response.AudioStream) {
160
+ return [];
161
+ }
162
+ // Convert stream to text
163
+ const chunks = [];
164
+ const stream = response.AudioStream;
165
+ if (Symbol.asyncIterator in stream) {
166
+ for await (const chunk of stream) {
167
+ chunks.push(chunk);
168
+ }
169
+ }
170
+ else if (stream instanceof Uint8Array) {
171
+ chunks.push(stream);
172
+ }
173
+ const marksText = Buffer.concat(chunks).toString("utf-8");
174
+ // Parse NDJSON (newline-delimited JSON)
175
+ // Each line is a separate JSON object
176
+ const speechMarks = marksText
177
+ .trim()
178
+ .split("\n")
179
+ .filter((line) => line.trim())
180
+ .map((line) => {
181
+ const mark = JSON.parse(line);
182
+ return {
183
+ time: mark.time,
184
+ type: "word",
185
+ start: mark.start,
186
+ end: mark.end,
187
+ value: mark.value,
188
+ };
189
+ });
190
+ return speechMarks;
191
+ }
192
+ /**
193
+ * Get available voices from AWS Polly
194
+ */
195
+ async getVoices(options) {
196
+ this.ensureInitialized();
197
+ try {
198
+ const input = {
199
+ Engine: this.engine === "neural" ? Engine.NEURAL : Engine.STANDARD,
200
+ };
201
+ if (options?.language) {
202
+ input.LanguageCode = options.language;
203
+ }
204
+ const command = new DescribeVoicesCommand(input);
205
+ const response = await this.client.send(command);
206
+ if (!response.Voices) {
207
+ return [];
208
+ }
209
+ return response.Voices.map((voice) => ({
210
+ id: voice.Id,
211
+ name: voice.Name,
212
+ language: voice.LanguageName,
213
+ languageCode: voice.LanguageCode,
214
+ gender: voice.Gender?.toLowerCase(),
215
+ quality: (this.engine === "neural" ? "neural" : "standard"),
216
+ supportedFeatures: {
217
+ ssml: true,
218
+ emotions: false,
219
+ styles: false,
220
+ },
221
+ providerMetadata: {
222
+ supportedEngines: voice.SupportedEngines,
223
+ additionalLanguageCodes: voice.AdditionalLanguageCodes,
224
+ },
225
+ })).filter((voice) => {
226
+ // Apply filters
227
+ if (options?.gender && voice.gender !== options.gender) {
228
+ return false;
229
+ }
230
+ if (options?.quality && voice.quality !== options.quality) {
231
+ return false;
232
+ }
233
+ return true;
234
+ });
235
+ }
236
+ catch (error) {
237
+ throw new TTSError(TTSErrorCode.PROVIDER_ERROR, `Failed to get voices: ${error instanceof Error ? error.message : String(error)}`, { error }, this.providerId);
238
+ }
239
+ }
240
+ /**
241
+ * Get AWS Polly capabilities.
242
+ *
243
+ * Clearly documents what features are W3C-standard vs AWS-specific.
244
+ */
245
+ getCapabilities() {
246
+ return {
247
+ // W3C Standard features
248
+ standard: {
249
+ supportsSSML: true, // ✅ Full SSML 1.1 + AWS extensions
250
+ supportsPitch: true, // ✅ Via SSML <prosody pitch> (not direct API param)
251
+ supportsRate: true, // ✅ Via SSML <prosody rate> (not direct API param)
252
+ supportsVolume: false, // ❌ Not supported by Polly API (handle client-side)
253
+ supportsMultipleVoices: true, // ✅ 60+ voices across 25+ languages
254
+ maxTextLength: 3000, // AWS Polly limit per request
255
+ },
256
+ // Provider-specific extensions
257
+ extensions: {
258
+ supportsSpeechMarks: true, // ✅ Native WORD speech marks (millisecond precision)
259
+ supportedFormats: ["mp3"], // Currently MP3 only (could add ogg, pcm)
260
+ supportsSampleRate: true, // ✅ Configurable sample rate
261
+ // AWS Polly-specific features
262
+ providerSpecific: {
263
+ engines: ["neural", "standard"], // Engine selection
264
+ supportedSpeechMarkTypes: ["word"], // Currently only WORD (could add sentence, ssml, viseme)
265
+ supportsLexicons: false, // Not yet implemented
266
+ awsSSMLExtensions: true, // <aws-break>, <aws-emphasis>, <aws-w>, etc.
267
+ neuralVoicesCount: 30, // ~30 neural voices available
268
+ standardVoicesCount: 30, // ~30 standard voices available
269
+ languagesCount: 25, // 25+ languages supported
270
+ },
271
+ },
272
+ };
273
+ }
274
+ /**
275
+ * Clean up AWS Polly client
276
+ */
277
+ async destroy() {
278
+ if (this.client) {
279
+ this.client.destroy();
280
+ }
281
+ await super.destroy();
282
+ }
283
+ }
284
+ //# sourceMapp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AAC;CACD"}
@@ -0,0 +1,7 @@
1
+ /**
2
+ * AWS Polly server-side TTS provider
3
+ * @module @pie-players/tts-server-polly
4
+ */
5
+ export type { PollyProviderConfig } from "./PollyServerProvider.js";
6
+ export { PollyServerProvider } from "./PollyServerProvider.js";
7
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,YAAY,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AACpE,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,6 @@
1
+ /**
2
+ * AWS Polly server-side TTS provider
3
+ * @module @pie-players/tts-server-polly
4
+ */
5
+ export { PollyServerProvider } from "./PollyServerProvider.js";
6
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC"}