# Text to Speech for a book

**URL:** <https://community.thunkable.com/t/text-to-speech-for-a-book/1397170>\
**Category:** Questions about Thunkable X\
**Tags:** texttospeech\
**Created:** [July 15, 2021, 7:04am UTC](https://community.thunkable.com/t/text-to-speech-for-a-book/1397170 "2021-07-15T07:04:26Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![overshield](https://avatars.discourse-cdn.com/v4/letter/o/e19b73/32.png) [@overshield](https://community.thunkable.com/u/overshield)\
**Post date:** [July 15, 2021, 7:04am UTC](https://community.thunkable.com/t/text-to-speech-for-a-book/1397170/1 "2021-07-15T07:04:26Z")

</div>

I’m looking for a way to use text to speech to save the placement in a book. So the user would have the ability to pick up where they left off the next time they resume reading.

I’m thinking maybe variables could be the solution but I can’t figure out how to tie in where the text to speech stops and starts.

Thanks all

---

<div class="post-metadata">

**Author:** ![catsarisky](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/catsarisky/32/100661_2.png) [@catsarisky](https://community.thunkable.com/u/catsarisky)\
**Post date:** [July 15, 2021, 10:01am UTC](https://community.thunkable.com/t/text-to-speech-for-a-book/1397170/2 "2021-07-15T10:01:30Z")

</div>

What if you broke your text up (into sentences? Or paragraphs?) and used a stored variable to record the most recently played sentence/paragraph?

---

<div class="post-metadata">

**Author:** ![overshield](https://avatars.discourse-cdn.com/v4/letter/o/e19b73/32.png) [@overshield](https://community.thunkable.com/u/overshield)\
**Post date:** [July 15, 2021, 4:25pm UTC](https://community.thunkable.com/t/text-to-speech-for-a-book/1397170/3 "2021-07-15T16:25:02Z")

</div>

I thought about that but it is way too long to break up that many times.

---

<div class="post-metadata">

**Author:** ![catsarisky](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/catsarisky/32/100661_2.png) [@catsarisky](https://community.thunkable.com/u/catsarisky)\
**Post date:** [July 15, 2021, 4:29pm UTC](https://community.thunkable.com/t/text-to-speech-for-a-book/1397170/4 "2021-07-15T16:29:19Z")

</div>

I wouldn’t do it manually! 🙂 Code it!

---

<div class="post-metadata">

**Author:** ![overshield](https://avatars.discourse-cdn.com/v4/letter/o/e19b73/32.png) [@overshield](https://community.thunkable.com/u/overshield)\
**Post date:** [July 15, 2021, 9:56pm UTC](https://community.thunkable.com/t/text-to-speech-for-a-book/1397170/5 "2021-07-15T21:56:23Z")

</div>

I’m wondering if there’s a built in way though in Thunkable, that would be ideal and more efficient.

Hopefully someone has done something similar in the past.

---

<div class="post-metadata">

**Author:** ![skulamester](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/skulamester/32/100480_2.png) [@skulamester](https://community.thunkable.com/u/skulamester)\
**Post date:** [July 16, 2021, 6:48am UTC](https://community.thunkable.com/t/text-to-speech-for-a-book/1397170/6 "2021-07-16T06:48:14Z")

</div>

Try this block:

![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/9/3/93ba5ca58bf04c057c27124b7890e33a7ae00b61.png)

---

<div class="post-metadata">

**Author:** ![codeswept](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/codeswept/32/87755_2.png) [@codeswept](https://community.thunkable.com/u/codeswept)\
**Post date:** [July 16, 2021, 6:55am UTC](https://community.thunkable.com/t/text-to-speech-for-a-book/1397170/7 "2021-07-16T06:55:50Z")

</div>

OK, this might seem a long shot, but you might want to make a list from text with a delimiter ‘.’, as @skulamester suggested. But I doubt that all your sentences would end with a full stop.

---

<div class="post-metadata">

**Author:** ![overshield](https://avatars.discourse-cdn.com/v4/letter/o/e19b73/32.png) [@overshield](https://community.thunkable.com/u/overshield)\
**Post date:** [July 17, 2021, 4:48pm UTC](https://community.thunkable.com/t/text-to-speech-for-a-book/1397170/8 "2021-07-17T16:48:10Z")

</div>

Ok I’ve been doing some work on this.

Currently as it cycles through each iteration it changes the variable pretty much instantly to the next, so it just go straight to the end of the story in a matter of seconds.  
I need the counting to pause while the text to speech is speaking. Then once the speaking is done for that sentence, it needs to change the variable +1 and continue.

But I can’t get it to pause while it’s speaking is the new problem.

Thanks for the tip with the list though, that seems to be the right direction to go.

Edit: I also thought about building in a timer, but there’s no way to be sure that each paragraph or sentence will always take the same amount of time to speak out loud.

---

<div class="post-metadata">

**Author:** ![tatiang](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tatiang/32/55482_2.png) [@tatiang](https://community.thunkable.com/u/tatiang)\
**Post date:** [July 17, 2021, 7:09pm UTC](https://community.thunkable.com/t/text-to-speech-for-a-book/1397170/9 "2021-07-17T19:09:04Z")

</div>

Could you take the [average length of a word](https://www.wolframalpha.com/input/?i=average+english+word+length) and determine how long it takes text to speech to say that and then multiply by the number of words in the text? And then maybe add a buffer of a second or two? You’d have to test it to see how reliable it was.

**Edit:** a quick test shows that the English text-to-speech engine reads at about 3 words per second. You probably could get away with 3.4 words per second.

---

<div class="post-metadata">

**Author:** ![tatiang](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tatiang/32/55482_2.png) [@tatiang](https://community.thunkable.com/u/tatiang)\
**Post date:** [July 17, 2021, 8:19pm UTC](https://community.thunkable.com/t/text-to-speech-for-a-book/1397170/10 "2021-07-17T20:19:26Z")

</div>

Here’s a demo:

[https://x.thunkable.com/copy/d96b2d90528c5231bd2099a55ee407b4](https://x.thunkable.com/copy/d96b2d90528c5231bd2099a55ee407b4)

---

<div class="post-metadata">

**Author:** ![overshield](https://avatars.discourse-cdn.com/v4/letter/o/e19b73/32.png) [@overshield](https://community.thunkable.com/u/overshield)\
**Post date:** [July 17, 2021, 8:28pm UTC](https://community.thunkable.com/t/text-to-speech-for-a-book/1397170/11 "2021-07-17T20:28:06Z")

</div>

Ya this is great, the problem now is having the ability to stop and start on command and save the current position in the text.

I don’t see a proper way to do that with what we’ve got here.

---

<div class="post-metadata">

**Author:** ![tatiang](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tatiang/32/55482_2.png) [@tatiang](https://community.thunkable.com/u/tatiang)\
**Post date:** [July 17, 2021, 11:17pm UTC](https://community.thunkable.com/t/text-to-speech-for-a-book/1397170/12 "2021-07-17T23:17:37Z")

</div>

Unless you separate the full text into single words (which you can do quite easily with the blocks from my demo), you can’t. But if you had a list of words from the full text, then you could speak each word and the user could stop at any time. I have no idea how choppy that would sound though!

---

<div class="post-metadata">

**Author:** ![overshield](https://avatars.discourse-cdn.com/v4/letter/o/e19b73/32.png) [@overshield](https://community.thunkable.com/u/overshield)\
**Post date:** [July 17, 2021, 11:20pm UTC](https://community.thunkable.com/t/text-to-speech-for-a-book/1397170/13 "2021-07-17T23:20:22Z")

</div>

I’ve tried delimiting with just a single space, so it does break them up for each word, but yes it is in fact extremely choppy.  
As bad as the native text-to-speech already sounds with no inflection it gets terribly worse when broken up by spaces.

---

<div class="post-metadata">

**Author:** ![catsarisky](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/catsarisky/32/100661_2.png) [@catsarisky](https://community.thunkable.com/u/catsarisky)\
**Post date:** [July 17, 2021, 11:24pm UTC](https://community.thunkable.com/t/text-to-speech-for-a-book/1397170/14 "2021-07-17T23:24:26Z")

</div>

It’s too bad these blocks don’t have a pause and restart, or the ability to start at a certain point, or a way to know they’ve completed.

---

<div class="post-metadata">

**Author:** ![overshield](https://avatars.discourse-cdn.com/v4/letter/o/e19b73/32.png) [@overshield](https://community.thunkable.com/u/overshield)\
**Post date:** [July 17, 2021, 11:26pm UTC](https://community.thunkable.com/t/text-to-speech-for-a-book/1397170/15 "2021-07-17T23:26:02Z")

</div>

Yes exactly what I was thinking, there should be some type of “is still speaking” or something.

---

<div class="post-metadata">

**Author:** ![ioannis](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/ioannis/32/146956_2.png) [@ioannis](https://community.thunkable.com/u/ioannis)\
**Post date:** [November 8, 2024, 1:19pm UTC](https://community.thunkable.com/t/text-to-speech-for-a-book/1397170/16 "2024-11-08T13:19:44Z")

</div>


