Cant find how to TTS a dynamic text

hi to eveyone, i need help with text to speech block

i cant find how to configure a text-to-speech button (onClick)

to read a dynamic text (from indexedDB, localStorage or json)
or a specific class from my html (this would be insane!!!)

is that possible? please help

You can use text, variable, or data source blocks inside of the “Hello” section of this block:

ok, let me explain better why dynamic is my only option.
i made a web with the bible that uses web speech aAPI and each chapter is on its own url.
so i created a js to send specific chapter data (excluding header/footer texts) and send chapter content to localStorage…
if i use serverData, i would need to insert whole bible in just one file… or create 1090 files with each chapter.

so i need TTS button to read dynamic content or specific content from the DOM like class=“read” innerText

this type of configuration would make thunkable UNIQUE, i have spent lot of money paying others just for that and no one yet have being able… i endede using thunkable as last option cause chatGPT always recommended everything except this… i did a very deep research to find thunkable and test it… i like it over SAP immediately…

i know i can do anything here… but the TTS has being a big head-ache for me, lol.

bible website is:

maybe, i can handle to create dataTables, all bible in one file… but not sure how to get that content depending on my URL location

I’m not sure how to help you with that but if I was doing anything with Text-To-Speech, I would be using Eleven Labs or Google Text to Speech and using the API to generate the speech from the supplied text.

i just need “how to read data” (from localStorage, indexedDB or json),
how do i call the data from one of those options? it is possible? i hope so :pray:t2:

Thanks in advance sir.

Yes. Google data sources Thunkable and click on the first link. The documentation will explain how to do that.

thanks, i saw that, but im trying to evade, not to do 1190 files of the bible for 1190 screenviews (1 for each chapter) cause that would be too much. :sweat_smile:

ok, another thought , based on your response: (I can create a code to overwrite db as i need when i load any url of my website and make it dynamic).

question is, if i can tell thunkalove where’s my db, or if i can locate thunkable localDB so i can overwrite that db when a chapter is loaded.

Those instructions are for using a Google Sheet or Airtable database. If the data is part of an API, then you would get the JSON response and create rows in a Thunkable data source. If it’s somewhere else… then you need to figure out how to get that data.

ok, this is how far i am… i manage to create a dynamic json.
and screenshot im sending at least says: object object

but i havent being able to select data section. any addition always says: null

any help would be appreciated sir :pray:

Screenshot 2024-09-21 01.54.30

This is because “data” is an object with two properties: “capitulo” and “titulo”. So to get either of those values, you would need to get the property “data.capitulo” or “data.titulo”.

ok, i manage to read sub-data, i set name Bible as main name (not “data”),
but it reads literally: Title, Chapter, Verses…
but still figuring out how to read inner data from those.

i tried “Biblia.Título” but got nothing… still learning…

project link:
https://x.thunkable.com/projectPage/66b70504d084fcc0591fc6eb

Screenshot 2024-09-21 14.37.48


ignore everything, lol… test only works on browser test window,
it seems ill have to do it the hard way :smiling_face_with_tear:

In the “then do” section of the Web_API block, set a variable to the get object properties of blocks instead of using the say block. Then, set a label’s text to the variable. And then say the variable.

That way you see the text that is returned and you hear it. If one of those doesn’t work (or both don’t work) then you have new information about what might be going wrong.

This is how I debug API responses:

Modified project link: Thunkable

It works in a browser and in Thunkable Live on an iPhone 13 Pro but the value of “Biblia.Título” is “” (empty) on both. Can you create a value for that property?

From https://codebeautify.org/jsonviewer:

sir… thanks to you… i was able to do a great advance :raised_hands:

it seems json is still not updated when button extracts json,
thats why it was empty (cause i did it like that) but i fixed it (thanks)
BUT on console, json is updated by a js function and i always see the edited result :face_with_raised_eyebrow:

if we manage button to read data after loading full website,
so he can read updated json… we finish!!!
DA BOMB!!! cause the updated json will by totally dynamic
depending on which chapter im reading… insane!!!

i sent example of button in english and spanish working nice!

https://x.thunkable.com/projectPage/66b70504d084fcc0591fc6eb

1 Like

ok, i discovered why im reading initial json data.
its because im running json.php and not json.js.
json.js is the one that changes json data

so, i created WebAPI_2 with json.js… but is not working
how can i run that script to get the updated data?

I don’t know. I’m sorry but I don’t have experience with getting data from an API I created. I always refer to the documentation for the API I’m using.

hi Tatiang, hope your fine, God bless :pray:

at last, i was able to create, manage and read a dynamic json
but now i have the issue that i cant get my cURL (current url)

i visited various topics, maybe not all of them,
but it seems it is a missed block we urgently need :sweat_smile:

do you know how to get it?

I don’t understand your question. Are you trying to parse a JSON response?