In this section we will wire together a number of Spring components and inject services into them. Together these components will implement the following functionality:
- Turn the FlightUpdateNotification into the text for an announcement
- Turn the announcement into an MP3 stream using the Google Text To Speech API
- Put the MP3 file for the announcement in the Airport’s Public Dropbox folder (and return a direct link to it)
Using this combined functionality, we can extend the FlightUpdateNotificationService with a new channel that publishes a public tweet regarding the flight status change with a link to the audio file.
Blog article by Jeff Chien: Google Translate Text To Speech With Java
Steps to register application for Dropbox.
Download Dropbox Java SDK.
Code of the Day: How to post a Tweet in Java using Twitter REST API and Twitter4J Library
The starting point sources are in the folder FlightUpdateNotificationService_step1. The end result for this section is in the FlightUpdateNotificationService_step2 folder.