-
Notifications
You must be signed in to change notification settings - Fork 0
Home
- Introduction
- Real-World Application Scenario 🛠️
- Technical Overview
- Key Components
- Real-World Benefits 🌍
The Guggiana Project is a comprehensive solution designed to automate and enhance the process of converting textual content into high-quality, multilingual audio files. It leverages AWS services such as Polly, Step Functions, and DynamoDB, alongside the AWS Cloud Development Kit (CDK), to create an efficient, scalable, and customizable text-to-speech (TTS) pipeline.
This project is particularly suited for applications requiring audio content generation in multiple languages, such as e-learning platforms, news websites, and accessibility tools for visually impaired users.
Imagine a news website that publishes articles daily in multiple languages. To improve accessibility for visually impaired users and cater to a global audience, the website needs to:
- Convert articles into audio files in multiple languages.
- Provide a seamless experience for users to access these audio files.
- Ensure scalability to handle high traffic and a large volume of articles.
With the Guggiana Project, this can be achieved efficiently:
- Article Input: News articles are ingested into the system via URLs.
- Language Translation: Content is translated into multiple languages using AWS Translate.
- Audio Generation: High-quality audio files are generated using AWS Polly's neural voices.
- Storage and Access: Audio files are stored in S3 buckets and made accessible via signed URLs.
- Scalability: The system scales automatically to handle increased demand.
This not only enhances accessibility but also broadens the website's reach to a global audience, including those who prefer auditory content.
- Framework: AWS CDK (Cloud Development Kit)
- Language: TypeScript and Node.js
| Service | Purpose |
|---|---|
| AWS Polly | Converts text to speech with neural voice support. |
| AWS Translate | Translates content into multiple languages. |
| AWS Step Functions | Orchestrates the workflow of content processing and audio generation. |
| AWS S3 | Stores generated audio files. |
| AWS DynamoDB | Maintains metadata and tracks the status of content processing tasks. |
- Content Ingestion: Articles are fetched and parsed from provided URLs.
- Translation: Content is translated into supported languages.
- Text-to-Speech: Translated content is converted into audio using AWS Polly.
- Audio Merging: Multiple audio segments are merged into a single file.
- Storage and Retrieval: Final audio files are uploaded to S3 and accessible via signed URLs.
| Module | Description |
|---|---|
| Content Table | Tracks content metadata and processing status. |
| Tasks Table | Manages individual tasks in the workflow. |
| Polly Workflow | Orchestrates the TTS and translation tasks using AWS Step Functions. |
| Pre-Translation Lambda | Prepares content for translation by AWS Translate. |
| Polly Listener Lambda | Listens for Polly task completion and updates the database. |
| Merge Files Lambda | Merges multiple audio segments into a single file. |
- Increased Accessibility: Makes content accessible to visually impaired users.
- Global Reach: Supports multiple languages for a broader audience.
- Cost Efficiency: Pay-as-you-go model with AWS services ensures cost optimization.
- Scalability: Handles a high volume of content effortlessly.
- Customizability: Modular design allows easy customization and extension.
- Automation: Reduces manual effort through end-to-end automation.
const buildPollyWorkflow = (
stack: Stack,
bucket: Bucket,
preTranslateLambda: NodejsFunction,
prePollyLambda: NodejsFunction,
mergeFilesLambda: NodejsFunction,
pollyWaitLambda: NodejsFunction,
pollyListenerLambda: NodejsFunction
) => {
const stateMachineRole = new Role(stack, `${stack.stackName}StateMachineRole`, {
assumedBy: new ServicePrincipal('states.amazonaws.com'),
});
const languagesStateTemplate = {
StartAt: `AvoidTranslateEN`,
States: {
AvoidTranslateEN: {
Type: 'Choice',
Choices: [
{
Not: {
Variable: '$.language.translate',
StringEquals: 'en',
},
Next: `PreTranslate`,
},
],
Default: `PrePolly`,
},
PreTranslate: {
Type: 'Task',
Resource: 'arn:aws:states:::lambda:invoke',
Parameters: {
FunctionName: preTranslateLambda.functionArn,
'Payload.$': '$',
},
Next: `ParallelTranslation`,
},
},
};
return new StateMachine(stack, `${stack.stackName}ContentToSpeechStateMachine`, {
definitionBody: DefinitionBody.fromString(JSON.stringify(languagesStateTemplate)),
role: stateMachineRole,
});
};- 🚀 Automates TTS and translation workflows.
- 🌐 Enhances accessibility and global reach.
- 💡 Built with cutting-edge AWS technologies.
This project is a robust solution for organizations aiming to deliver high-quality audio content to diverse audiences.