# Speech to text return

**URL:** https://community.thunkable.com/t/speech-to-text-return/1989672
**Category:** Questions about Thunkable X
**Tags:** beginner
**Created:** [August 6, 2022, 8:05am UTC](https://community.thunkable.com/t/speech-to-text-return/1989672 "2022-08-06T08:05:13Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![eladkobitr8f](https://avatars.discourse-cdn.com/v4/letter/e/e9c0ed/32.png) [@eladkobitr8f](https://community.thunkable.com/u/eladkobitr8f)
#### Post date: [August 6, 2022, 8:05am UTC](https://community.thunkable.com/t/speech-to-text-return/1989672/1 "2022-08-06T08:05:13Z")

</div>

Hey guys. So I am working on an app that does a few things and among that I created a screen that the purpose of it is to always listening and when certain words are spoken the app does some staff. So when the screen opens I do this forever loop and it works just fine but whenever the app failes the understand the word which might happen the forever loop stucks. I tried put error on the label if the speech to text function returns null but it didn’t worked. Any suggestions?  
Thanks!

 ![error](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/9/b/9bd2c42f0f02a853ab9542e7c9fc411bf5e7e153.jpeg)

---

<div class="post-metadata">

### Author: ![domhnallohanlon](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/domhnallohanlon/32/29554_2.png) [@domhnallohanlon](https://community.thunkable.com/u/domhnallohanlon)
#### Post date: [August 6, 2022, 9:52am UTC](https://community.thunkable.com/t/speech-to-text-return/1989672/2 "2022-08-06T09:52:15Z")

</div>

One thing you should probably try here @eladkobitr8f is to use else clauses as part of your first If statement, rather than having multiple if statements like this.

Having something like this running forever will probably run the users battery down pretty quickly - have you considered having a button that would start listening for, say, 30 seconds?

---

<div class="post-metadata">

### Author: ![eladkobitr8f](https://avatars.discourse-cdn.com/v4/letter/e/e9c0ed/32.png) [@eladkobitr8f](https://community.thunkable.com/u/eladkobitr8f)
#### Post date: [August 6, 2022, 10:04am UTC](https://community.thunkable.com/t/speech-to-text-return/1989672/3 "2022-08-06T10:04:22Z")

</div>

Hey @domhnallohanlon, thank’s for your answer I tried else, I tried to check if the label is empty then continue the loop but it didn’t worked to. And for the battery, yea I would do that but I just need it to be like that for some project. Any other suggestions? Thank’s! (adding photo of an attempt I tried, still the loop stops when the speech to text dosen’t recognize)  
 ![error](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/b/d/bdb2cf4550a3265d53ce6fa471d46f703b0cf523.jpeg)

---

<div class="post-metadata">

### Author: ![muneer](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/muneer/32/75210_2.png) [@muneer](https://community.thunkable.com/u/muneer)
#### Post date: [August 6, 2022, 2:12pm UTC](https://community.thunkable.com/t/speech-to-text-return/1989672/4 "2022-08-06T14:12:11Z")

</div>

Instead of the `Forever` loop use a `Timer` and let it listen every second or two.

---

<div class="post-metadata">

### Author: ![eladkobitr8f](https://avatars.discourse-cdn.com/v4/letter/e/e9c0ed/32.png) [@eladkobitr8f](https://community.thunkable.com/u/eladkobitr8f)
#### Post date: [August 6, 2022, 2:45pm UTC](https://community.thunkable.com/t/speech-to-text-return/1989672/5 "2022-08-06T14:45:14Z")

</div>

Thank you @muneer ! That fixed it up.

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/0/f/0f59f292712368bce16ff80133ae10de8a6f27e8.png) [@system](https://community.thunkable.com/u/system)
#### Post date: [November 4, 2022, 2:46pm UTC](https://community.thunkable.com/t/speech-to-text-return/1989672/6 "2022-11-04T14:46:01Z")

</div>

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
