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 into 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 file automatically.

 

How to 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".

    Convert Twitter Tweet into Audio File using Cognitive service with Azure Logic App
  • Enter the name, subscription, pricing tier, and resource group for the Translator Text API. Then, click on "Create".
Convert Twitter Tweet into Audio File using Cognitive service with Azure Logic App
  • Under Keys, you have keys for accessing the Translator Text.
Convert Twitter Tweet into Audio File using Cognitive service with Azure Logic App

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.
Convert Twitter Tweet into Audio File using Cognitive service with Azure Logic App
  • Enter the name you want to assign to the logic, choose the subscription, resource group where you organize related resources, and location where your logic app is stored. Then, click on "Create".
Convert Twitter Tweet into Audio File using Cognitive service with Azure Logic App
  • Here is the dashboard. Click on Logic App Designer.
Convert Twitter Tweet into Audio File using Cognitive service with Azure Logic App

Step 3

Now, click on the Blank Logic App.

Convert Twitter Tweet into Audio File using Cognitive service with Azure Logic App

Step 4

Configure the data by signing into Twitter and OneDrive.

  • Search Twitter on the search bar.
Convert Twitter Tweet into Audio File using Cognitive service with Azure Logic App
  • Choose the Triggers tab.
Convert Twitter Tweet into Audio File using Cognitive service with Azure Logic App
  • Next, let us sign in.
Convert Twitter Tweet into Audio File using Cognitive service with Azure Logic App
  • Give permission to access our accounts.
Convert Twitter Tweet into Audio File using Cognitive service with Azure Logic App
  • 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.
Convert Twitter Tweet into Audio File using Cognitive service with Azure Logic App

Step 5

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

  • Search for Translator.
Convert Twitter Tweet into Audio File using Cognitive service with Azure Logic App
  • Choose the Action.
Convert Twitter Tweet into Audio File using Cognitive service with Azure Logic App
  • After that, give the Cognitive Service Connection name and key.
Convert Twitter Tweet into Audio File using Cognitive service with Azure Logic App
  • Configure the condition.
Convert Twitter Tweet into Audio File using Cognitive service with Azure Logic App

Step 6

  • Next, we want to save the file. So, search for OneDrive.
Convert Twitter Tweet into Audio File using Cognitive service with Azure Logic App
  • Then, choose an Action for the workflow.
Convert Twitter Tweet into Audio File using Cognitive service with Azure Logic App
  • Next, choose the folder path, file name, and file content for saving the tweet.
Convert Twitter Tweet into Audio File using Cognitive service with Azure Logic App
  • The final workflow will be like this.
Convert Twitter Tweet into Audio File using Cognitive service with Azure Logic App

Step 6

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

 Convert Twitter Tweet into Audio File using Cognitive service with Azure Logic App

Output

Send a Tweet with a specific hashtag.

Convert Twitter Tweet into Audio File using Cognitive service with Azure Logic App

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

Convert Twitter Tweet into Audio File using Cognitive service with Azure Logic App

Audio File

Convert Twitter Tweet into Audio File using Cognitive service with Azure Logic App

Summary

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