The Amazon Polly API lets you convert text into lifelike speech using deep learning. With Polly, you can create applications that talk and build entirely new categories of speech-enabled products. Pipedream's platform enables you to integrate Polly's capabilities into workflows that can automate tasks, like generating audio files from blog posts or alert messages, and piping them to various services or storage solutions.
import AWS from 'aws-sdk'
import { PollyClient, StartSpeechSynthesisTaskCommand } from "@aws-sdk/client-polly"
export default defineComponent({
props: {
amazon_polly: {
type: "app",
app: "amazon_polly",
}
},
async run({steps, $}) {
const { accessKeyId, secretAccessKey } = auths.amazon_polly
// Create an Amazon Polly service client object.
const creds = new AWS.Credentials(accessKeyId, secretAccessKey);
const pollyClient = new PollyClient({ credentials: creds, region: "us-east-1" });
// Create input data
var data = {
OutputFormat: "mp3",
OutputS3BucketName: "videoanalyzerbucket",
Text: "Hello David, How are you?",
TextType: "text",
VoiceId: "Joanna",
SampleRate: "22050",
};
return await pollyClient.send(new StartSpeechSynthesisTaskCommand(data));
},
})
Blog Post to Podcast: Automatically convert new blog posts to audio. When a new post is published to your CMS (like WordPress), Pipedream can trigger a workflow that sends the text to Amazon Polly, which then returns an audio stream. The audio file is then uploaded to a podcast hosting platform or cloud storage for distribution.
Real-time Alerts to Speech Notifications: Turn alerts from monitoring tools like Datadog into spoken notifications. When an alert is triggered, it's sent to Pipedream, where Polly generates an audio message. This message could be played over a PA system or sent as a voice notification to a team's phones.
Language Learning App: Enhance a language-learning platform by providing users with pronunciation examples. As users submit text, it goes through Pipedream to Polly, which translates the text into spoken words in the chosen language. The audio can then be embedded back into the app for the users to listen to.
Amazon Polly uses API keys for authentication. When you connect your Amazon Polly account, Pipedream securely stores the keys so you can easily authenticate to Amazon Polly APIs in both code and no-code steps.
Amazon Polly is an AWS service.
Follow the AWS Instructions for creating an IAM user with an associated access and secret key.
As a best practice, attach the minimum set of IAM permissions necessary to perform the specific task in Pipedream. If your workflow only needs to perform a single API call, you should create a user and associate an IAM group / policy with permission to do only that task. You can create as many linked AWS accounts in Pipedream as you'd like.
Enter your access and secret key below.