DEV Community

Mariela Dimitrova for Software AG Tech Community

Posted on • Originally published at tech.forums.softwareag.com on

Conversion of text translated by Google Translator to speech by Amazon Polly

Summary

This article describes a business use case where the text translated by Google Translator will be converted to speech by Amazon Polly.

Pre-requisites

  • User should have a working webMethods.io Integration tenant.

  • User should have a working Google and Amazon AWS account.

Steps

  1. Login to webMethods.ioIntegration tenant and create a FlowService.

  2. Add the Google Translator connector and select the Translate Text operation. Select Custom OAuth under Configure Accounts to add an account. Provide all the required details in the window that appears and click Add.

    _ Note: _ Refer to the following article to know more about Google OAuth 2.0 connection in webMethods.io,

    Google OAuth 2.0 Connection in webMethods.io
    image

  3. Click Edit Mapping option in the top right corner to input the values for the selected operation. Provide the required inputs and proceed.
    image

  4. In the next steps add if-else conditions on the basis of translatedText response.
    If Condition

  5. If translatedText is not empty then add the Amazon Polly connector and select startSpeechSynthesisTask operation. Select Create account manually under Configure Accounts to add an account. Provide all the required details in the window that appears and click Add.
    image

  6. Click Edit Mapping option in the top right corner to input the values for the selected operation. Map the translatedText to Text field, provide the other required inputs, and proceed.

    Make sure an existing S3 bucket name is provided for OutputS3BucketName field to store the speech file in the mentioned AWS S3 bucket.
    image
    Else Condition

  7. Else throw an error with a custom message like Text couldn’t be translated
    image

  8. Save and run the flow from the top right corner. Download the speech file from the AWS S3 Console. It will be present in the same AWS S3 bucket provided earlier in step 6.

Read full topic

AWS Q Developer image

Your AI Code Assistant

Automate your code reviews. Catch bugs before your coworkers. Fix security issues in your code. Built to handle large projects, Amazon Q Developer works alongside you from idea to production code.

Get started free in your IDE

Top comments (0)

Postmark Image

Speedy emails, satisfied customers

Are delayed transactional emails costing you user satisfaction? Postmark delivers your emails almost instantly, keeping your customers happy and connected.

Sign up

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay