TalkToMeAPI - Text-to-speech Azure API App
This is a simple and hopefully fun proof-of-concept of a custom Azure API App to be used in a Azure Logic App.
There are two main parts. First the API that hosts a SignalR hub and the second one is the UI that connects one (or more) browser as the API App "Loudspeaker". An Azure API App is just like any 'normal' Web App so it can host both parts and no other deployment is needed.
- WebAPI
- SignalR Hub
- Client UI
- mespeak.js
- SignalR client
My first sample scenario used to try the API App was a Logic App getting weather data from api.openweathermap.com that TalkToMe API will read out. Note that by design the API will return 202/Accepted even if no browser (ie. SignalR client) is connected and no queuing or simmilar is performed.
How to use
-
Deploy Azure API App
-
Create and deploy a Logic App where TalkToMe is used as an 'action'
-
Connect one or more browsers to the API by browsing the root URL of the deployed API. If you are unsure of the URL you can find the link in the 'essentials' section of the API App in the portal.
-
Run the Logic App
When the logic app runs and the TalkToMe action fires the portal should show something like
And you should hear the artificial voice in your speaker:
##Test API using HTTP If you just want to try the API App, outside of an Logic App, you can use a simple REST call.
REST param | Value |
---|---|
URL | http://{your-apiapp-url}/api/TalkToMe |
Method | HTTP POST |
Content-Type | application/json |
Body | { "TextToRead" : "Nice weather today" } |