Share My Creation Bare Bone Text To Speech (TTS) with Speech Synthesis Markup Language (SSML) tool

The advantage of a standard is that everyone can give it their own interpretation. That raises the question of what and how Text To Speech (TTS) works on my phone.
When you search for TTS on this forum you mainly see questions and answers that are "dated". Like many things, the API levels of newer Android versions have also been tweaked to support TTS.

After a lot of searching on this forum and the Internet, I shamelessly tested solutions that I found. B4A supports TTS as an internal library, but that library is not fully compliant with the current API 33 level. The attached M3TTS is error free according to Eclipse Version: 2023-06 (4.28.0) and compiled with SLC with Java 8. In addition, I used to add a method that returns a list of installed voices. The question remains what can you do with M3TTS on your Android phone? The Google cloud version of TTS can do a lot, but you have to pay for it and get started with a token. I have made a B4Xpage program to test the TTS support in B4A on a Samsung Galaxy A13.

1691918374758.png


Answers given in this forum do not use Speech Synthesis Markup Language (SSML). By marking a text string with SSML tags, the text-to-speech of the synthetic audio can be personalized in many ways.
This program is not a "slick" all-encompassing completely error-free solution, but a tool to help you find out how to format your text into a form that satisfies you. You can then use that found formatting text in another program of yours. During text entry, the keyboard is displayed on the lower part of the screen. I simply placed the explanation of the chosen SSML command on the occupied space of the screen without worrying about how IME height would allow me to adjust the layout during the display of the keyboard. That's why this bare bone tool only offers you the opportunity to find the right format for your texts to be spoken.
 

Attachments

  • M3TTS.jar
    3.5 KB · Views: 149
  • M3TTS.xml
    5.3 KB · Views: 147
  • M3TTS.zip
    25.5 KB · Views: 171

maleche

Active Member
Licensed User
Longtime User
This TTS module works well. a little slow to start the speech which i believe is causing some slow down for Timer loops.
My application is a moving Bitmap on Google Maps. Its Lat/Lon position and other obstical Lat/Lon positions are calculated to return the distance and bearing to each other every 1.5 seconds. I use the TTS to speak the Range and Bearing, but when there is more than one to report, the speech/sentence report everything in the speech buffer and falls behind the moving Bitmap.
it appears i might have to build a mapSentenceBuffer (Map type) to capture all the sentences, start at the top, speak the first, second, third, etc. then delete the sentence from the mapSentenceBuffer.
Is there another way to ensure the TTS will speak without skipping sentences in the TTS buffer? I tried ClearQueue=false and true, but it did not fit my needs.
Any suggestions?
Thanks so much!
 

MicroDrie

Well-Known Member
Licensed User
Your sample rate is1.5 seconds. So your result has to speak in let say 1.4 seconds. Now you can shorten the text, or increase the speed or use cardinal or ordinal spech. Maybe it is impossible to speak the full text in only 1.4 seconds and there is no other way then take more interval time.
 

Penelope78

New Member
This "Bare Bone Text To Speech (TTS) with Speech Synthesis Markup Language (SSML) tool" is a game-changer! Its simplicity belies powerful capabilities, making SSML easily accessible. Perfect for users seeking efficient, customizable TTS solutions without unnecessary complexities. A valuable addition to the toolkit for anyone venturing into the realm of speech synthesis.
 
Top