Problema di TextToSpeech

I have created translators and they all have the same problem:
as soon as I launch the app and proceed with the translation, the same happens eg: English = translation with Italian stamp and translation with Italian voice and not even exact.
While the second time I press the button eg: English = English voice and English timbre as it should always be.

This error to those who download the app by showing up at the opening may not allow the user to continue using it because he thinks that the app is not optimally implemented.

Why this error

I set for English (GBR) (en) Italian (ITA) (it)

Didn't get what you mean?
Can you be more clear on what the app is intended to do and is it actually doing?

I sent the project file to be able to better see what I have described.
However I will try to explain it again.
The App when you press the button with the Italian flag displays the recorder in which, I said the following writing: my name is angel.
The app should read it in English and write it in English in the writing space, and everything happens regularly, but at the first start, when I first press on the Italian flag instead of translating the text into perfect English, and with an English voice, it reads with voice Italian and translates into English but read by an Italian. This is only the first time, when the second press on the Italian flag the translation is correct in English with English voice.

If you are asking for help, I recommend you to make it as easy for others to be able to help you ...
You probably will get more feedback then...

which means in your case post a screenshot of your relevant blocks...

To download the aia file, upload it to App Inventor, open it, do some bug hunting for you, etc... this takes time, and most people will not do that...
Thank you.


Trying to push the limits! Snippets, Tutorials and Extensions from Pura Vida Apps by icon24 Taifun.

Dear Angelo, you have to reverse the order of some blocks. Please take a look here below:

Please also take a look to the speechrecognizer1 after getting text : it was different with respect to the same block for speech2.
Try it :slight_smile: it works.

Ciao, Ugo.

Thank you but unfortunately even with your blocks it continues to give the same problem.

Hi guys, sorry if I explain to Angelo in Italian. The explanation below is more or less what I have already told in my previous post in English, so I believe that there is no need to translate it back to English. I just use Italian to try to be more clear to Angelo.
Thanks for your understanding.
Kind regards.

Ciao Angelo,
ti posso garantire che senza i blocchi messi col mio ordine avevo lo stesso problema: se selezionavo bandiera italiana e chiedevo la traduzione mi rispondeva in inglese ma con accento italiano. Dopo avere "rovesciato" la sequenza in modo da permettere "prima" la selezione del country e del linguaggio e solo "dopo" far partire il text to speech allora selezionando la bandiera italiana e chiedendo la traduzione, la cadenza è diventata correttamente quella inglese. Ho provato ad entrare ed uscire diverse volte per evitare che rimanesse in cache qualche settaggio tra un caricamento ed il successivo. Il mio telefono è uno Xiaomi mi 5 con Android 8.1.0. con OS in lingua primaria italiana. (sono di Torino con provider WEB wind3).
Quello che voglio dire è che tutto AI2 è single thread a eventi asincroni, quindi potrebbe essere che alcune operazioni vengano eseguite mentre l'operazione successiva è già partita: tipico è l'esecuzione dei suoni: se ne lanci due in sequenza troppo rapida, solo il secondo si sente, perchè il primo viene annullato dal secondo. E devi mettere un ritardo tra il primo e il secondo per poter sentire anche il primo.
Prova piuttosto a far partire il text to speech con un timer che lo lancia 500 milli dopo aver premuto il tasto. In allegato il mio aia, anche con questa ultima modifica dei timers, col mio phone funziona.
Fammi sapere se va col tuo...
Ciao, Ugo.Traduttore_Ugo.aia (417.3 KB)

Grazie davvero tantissimo e complimenti per l'acume io non ci sarei mai arrivato.
Un ultima cosa, sei in grado per favore di risolvermi questo problema ho inserito anche la traduzione in albanese, mentre quando indico: "Il mio nome è Angelo" lo traduce spero come dovrebbe non capendo il linguaggio anche se con voce metallica come i primi text to speak della Microsoft,, nell'altro caso se ripeto la frase in peseudo albanese non succede nulla non viene tradotto.=Thank you very much and congratulations for the insight I would never have gotten there.
One last thing, are you able please to solve this problem for me I have also included the translation in Albanian, while when I indicate: "My name is Angelo" I hope it translates as it should not understanding the language even if with a metallic voice like the first text to speak of Microsoft, in the other case if I repeat the phrase in Albanian peseudo nothing happens it is not translated.

You will not pay attention to my request for help for the Albanian, I solved. I hadn't entered enable.true on the watch.

:blush: :muscle: :muscle: :muscle:
Well done Angelo, now enjoy your app !!!
All the best, Ugo.

Ciao ugo, mi scuso del disturbo che può recarti questa domanda, la rivolgo a te sperando che tu sia in grado di rispondermi.

Sto realizzando un app di multitraduzione da parlato a testo come avrai notato, ma mentre giravo in rete ho trovato una pagina cui google chiede un pagamento per le voci utilizzate nelle proprie app o altro.

Significa che tutte le voci dall'italiano a tutto il resto utilizzate nella mia app sono a pagamento e quindi non posso utilizzarle e pubblicarle?

Hi ugo, I apologize for the inconvenience this question may cause you, I address it to you hoping that you will be able to answer me.

I'm making a speech-to-text multi-translation app as you may have noticed, but while I was surfing the net I found a page where google asks for a payment for the voices used in its apps or other.

Does this mean that all the voices from Italian to everything else used in my app are paid and therefore I cannot use and publish them?

Dear Angelo, I'm awfully sorry, but I'm not aware of this. When I use the speechrecognizer of AI2, the unique "trick" that I use is to force the use of an off-line language. Obviously the language(s) shall be available in the settings of your phone/tablet, as off-line languages, too. This is a setting of your Android phone. I use the speechrecognizer to give voice-commands to my apps, and I don't use it as a translator, therefore I don't make the phone to speak.

To this regard I believe that the community will aswer you better than I can do. :upside_down_face:
Ciao, ugo.

Thanks I hope someone knows, otherwise it's a big problem.
YES as for online, I have already downloaded the languages and I know how they work, but in my opinion this does not solve the problem because you are still using items that Google must authorize, even if the authorization we think is implied, it may not be.

Comuenue we hope that someone knows the answer. , I also wrote to Google, look forward to. hello and thanks anyway.

Furthermore, the other problem only google gives you the abbreviations but without specifying the country, you search on the net, but many are different and some cannot be found, so everything becomes indecipherable and unusable.

In the two lists that appear by inserting them in a label with "available countries" and "available languages" you expect them to be in order of abbreviation, that is, en-GRB and instead they are each on its own and therefore impossible for some to find the correspondence.

It means that when all the free credits expire, you will be charged for usage if you are you using this service >>

Google Text to Speech - Voice Transcription .

If you use the Cloud service, you must abide by Google's terms. This service requires fees. Google does provide a certain amount of 'free usage' 60 minutes per month for Speech-to-text transcription .

If your app uses the languages pre installed on a users Android, you have no problem. There aren't any charges.

See TextToSpeech country code for several sources of TTS language codes. "many are different and some cannot be found, so everything becomes indecipherable and unusable"... if the abbreviations cannot be found, that means the language/country combination is not available. You can copy all this data and maintain your own list for your personal reference if you want the information sorted. :cry: You can make your own documentation file. :slight_smile:

Thanks you have reassured me, also because to my request, made to Google, the answer was that I have to pay the service of the voices if I use them, obviously it refers to external voices that I could use in other software. Hi.

If you use the Cloud services you do have to pay for them. Understand, there are two ways to use TTS; one is entirely free provided the TTS engine is available on an Android; the other one uses Cloud services. From this forum discussion, it is NOT clear how you built your app.

It is not obvious 'it' refers to external voices.

I used the internal voices, those elncate in appinventor2 "TextToSpeech1" = "Country-Language".
But not all of them, because even by checking the ISO codes you described, some acronyms are not understandable what to match them with, that is
en = GBR, many others not only do not know how to combine the two letters, "Language with Country" but you cannot find them on the net either, they are not found, or they do not correspond to some of the languages listed.

But wouldn't it have been easier to write the letter like I had to do? That is, "English: en-GRB" and so for all the others? is it just for all the ones that the component can actually use?

Instead of driving us pseudo developers crazy to run whole days and then not find them at all?

For the cost of the languages, I understand now, that only the cloud ones are paid, but when I read the article, I was worried, not knowing as a layman, if the internal ones were part of it.
Now I'll try your blocks and say hi to you.