Convert Tweet Into Audio File Using Cognitive Service With Azure Logic App

Azure Logic Apps

Logic App is a cloud-based service. It allows us to react to an event in one service (such as SharePoint online) and do something with the data from that event in another Service (such as Twitter). It makes it practical and simple for business processes. The users build workflows that automatically perform some business tasks and processes across applications and services. We can connect our business-critical apps and services with Azure Logic Apps, automating our workflows without writing a single line of code.

Before reading this article, please go through some important article links, mentioned below.

Here, we will see how to convert specific Twitter tweets to Audio files automatically.

Create a Logic Flow to convert a specific Tweet to Audio File

Here, we need to connect to Twitter, Microsoft Cognitive Service (Text-to-speech), and OneDrive

Prerequisites

  • Microsoft Azure Account.
  • Twitter Account.
  • OneDrive.

Follow the below steps to build a workflow using a template.

Step 1. Log into https://portal.azure.com/

  • In the dashboard, search for "Microsoft Translator" and click on "Translator Text".
    Microsoft Translator
  • Enter the name, subscription, pricing tier, and resource group for the Translator Text API Then, click on "Create".
    Translator Text API
  • Under Keys, you have keys for accessing the Translator Text.
    Translator Text

Step 2. Now, let us create the Logic App for converting the specific tweet into an audio file and store it on the OneDrive.

  • In the dashboard, choose to create a resource and click on Integration, Now, choose Logic App.Logic App
  • Enter the name you want to assign to the logic, choose the subscription, the resource group where you organize related resources, and the location where your logic app is stored, Then, click on "Create".
    Create
  • Here is the dashboard Click on Logic App Designer.
    Logic App Designer

Step 3. Now, click on the Blank Logic App.

Blank Logic App

Step 4. Configure the data by signing into Twitter and OneDrive.

  • Search Twitter on the search bar.
    Twitter
  • Choose the Triggers tab.
    Triggers tab
  • Next, let us sign in.
    Sign in
  • Give permission to access our accounts.
    Permissions
  • Next, set the specific keyword ( Eg. #AzureLogicApp) for which you want to convert that specific tweet into an audio file and then, give the time interval and frequency for checking the workflow as one minute.
     Specific keyword

Step 5. Configure the Text Analytics for detecting the sentiment of the tweet.

  • Search for Translator.
    Translator
  • Choose the Action.
    Text to speech
  • After that, give the Cognitive Service Connection name and key.
    Cognitive Service
  • Configure the condition.
    Configure the condition

Step 6

  • Next, we want to save the file. So, search for OneDrive.
    OneDrive
  • Then, choose an Action for the workflow.
    Workflow
  • Next, choose the folder path, file name, and file content for saving the tweet.
    Choose folder
  • The final workflow will be like this.
    Final workflow

Step 7. Now, we need to save the workflow and run it.

 Run

Output

Send a Tweet with a specific hashtag.

Specific hashtag

Now, the Tweet converts into an audio file and is saved on OneDrive.

Tweet converts

Audio File

Audio File

Summary

I hope you understand how to convert a tweet about a specific hashtag into an audio file and save that automatically into OneDrive, Stay tuned for more.


Similar Articles