Maybe this can help you:
Speech runs at a different rate than incoming data, so you need a list to act as a queue.
This sample does not include connection and permissions, just receipt of data sent via println().
Screen1.Initialize - I use a Line Feed (10) Message Delimiter
Speech is started only after adding a message to an empty speech queue, or finishing a current announcement. If the speech queue is not empty, a speech action must already be in progress and we just add the incoming message to the queue.
BlueTooth_delimited_speech.aia (3.2 KB)
If you need translation in addition to speech, that's an extra queue, feeding the speech queue.
(I am not sure if you want that. Ask for it, and I will add it.)
Dear Abraham Getzler
Thankyou for the solution. And i wanna ask you one thing like if i use translation queue, the receiving data from bluetooth module like Thankyou , welcome can be translated while displaying in the text box into Nepali word like dhanyabad and also speak in nepali language even though the receiving data are all English?
App_Bluetooth123.aia (4.3 KB)
i have added translation queue like this in above code. what other thing should add so that when the app receive the data from bluetooth module it translate into Nepali word and also speak in Nepali even though the data are in English.
What is the two letter code for Nepali?
App_TRansbluetooth_copy1.aia (4.6 KB)
can you check this code. i have tried to apply both translation and speech queue. but i dont know what is missing here.
I am on my phone now.
You are not following BT Delimiter patterns.
Show all the transmission Arduino code for compatibility check
sketch_feb12a.ino (953 Bytes)
this is the basic code for sending hello and bye
App_TRansbluetooth_copy1 (2).aia (4.7 KB)
And This the block code of the app.
In this block code, voice translation is also not happening. can you help me in translation queue so that the message displaying in English translate into Nepali Language (ne)
Can it be possible to display the data in text box in different language . Like if the received data is in english language then when it received in app through bluetooth can it display in another language?
you can use a translator component (media).
how can i add the country code in block so that when translating the language it sound similar.
and while uploading this code it says error fetching translation . how can i solved it
which code is "ne"?
edit: I have seen Nepali...sorry
You have a TextToSpeech.Country property.
yeah but in there is no country code for Nepal in that property
You have the block, but I don't know if it will work with other codes not present in designer menu.
Sorry for the delay, I have a life.
Here is a completed app, tested with manual input because I don't have a Bluetooth device to send text.
I verified in your Arduino code that you use println so I adjusted your BT receive code for that.
The general rule here is Translate before Speech.
I added a manual Enter button for testing.
To save on usage of the translator service when asked to translate the same text over and over again, I added a TinyDB instance just for Nepali translations, where the tags are English and the values Nepali translations.
Notice the separate NameSpace value, in case you decide to also add other language targets.
If the phrase has already been translated, say the translation, otherwise add it to the translation queue. If nothing else is in progress, start a translation.
(You omitted a length of list test in your code.)
The translator is finicky, so we have to test its response code for success.
Successful translations get saved in TinyDBne to save translation money.
We call the SAY procedure with either our successful translation or a detailed error message.
Then we remove the phrase from the translation queue to not be a pest.
To say a translation, we add it to the speech queue.
If it's up at bat, we show it in a Label and ask for it to be spoken alout.
I was lazy and did not add error checking for text to speech. I leave it to you to read the tool tip and think of something.
App_TRansbluetooth_copy12.aia (5.9 KB)
sample run (sorry, no audio)
thankyou so much for the help and code @ABG .
but 1 have one problem like when the data is received it say error 404 couldnot translate. why is it works on your phone but when i try to do it in my phone it says error