In order to avoid repeating the code in several places, and to be able to focus on the new parts as we progress to more complex applications, we have encapsulated the most frequently used TTS functionalities into a library named
sandra.libs.tts in the source code), which is employed in the different applications.
TTS.java class has been created following the Singleton design pattern. This means that there can only be a single instance of this class, and thus an app that employs the library uses a single TTS object with which all messages are synthesized. This has multiple advantages, such as optimizing resources and preventing developers from unwittingly creating multiple
TextToSpeech instances ...