Skip to main content

How to create your own app that converts text to speech

If you've ever wanted to create apps but felt you could not because you had no coding skills, then this one's for you. This tutorial covers how to create your own app that will convert whatever you type into audio when you click a button. This app will be created using Sketchware. If you're not familiar with Sketchware you might want to check out this article.

This can be particularly useful for people with a speech disability or when making learning apps. You can easily create an app that reads notes, gives instructions whilst the user completes an activity. Feel free to ask if you get lost or need help.

Duration:

5 - 10 Minutes


Preparation

• You will need to have Sketchware installed and running on your phone. If you haven't installed it yet, you can download Sketchware here.

• You will also need to create and set up a new project. If you're not sure how to do that, please check out an article I wrote on how to Create a new Sketchware project


Step 1. Build your layout

Let's create our layout. Our app will only require an edittext field and a button. The user will type something in the edittext then click the button to speak. Simple right? Drag your items onto the screen as shown below. 

In the image below, step one is building the layout and step 2 is opening the button's onClick event. This is where we will place our logic.

texttospeech app layout


Step 2: Create a TextToSpeech component


In our button onClick logic we will create a TextToSpeech component. This is what will convert our written text to speech. 

By default, most android devices come with a text to speech engine pre-installed. You can go to your settings and install additional languages.

Simply follow the steps below to create the component.
Add new component


In our components menu, choose TextToSpeech as shown below.


Choose TextToSpeech component


Name your component. I have given mine the name 'read' as shown below.


Name TextToSpeech component


Step 3: Set up your logic


Drag the TextToSpeech setSpeak block to your logic as shown in the following image.


Drag setSpeak block


Go to the view blocks and choose a textView getText block as shown below. This block will get our text after we type it.

Add getText block


Click on the blank space right next to the word TextView on your getText block. This will open up the menu below. Choose your edittext.

Select edittext


after choosing your edittext also choose your text to speech component by clicking on it. Your blocks should now look as shown below.


TextToSpeech logic
Our app is almost done. At this point you can click the back button. 


Step 4: Run your app

After clicking the back button, you will notice the blue button at the bottom of your screen with the word 'Run'

Click 'Run' and your application will be installed on your phone.

Run your app

After your app has been installed on your phone, you can start typing in whatever you want it to read. You can copy a passage from your favourite book and paste it into the edittext and it will read that for you.



Text to speech demo


Conclusion

Using Sketchware you can easily create an app that converts text to speech. More importantly, this can be combined with other concepts to create even more powerful apps. You can also use this if you're creating:

• a book or magazine app
• an app for people with a speech impediment
• to send warnings in an app
• so much more...


I hope you found this very helpful and you're enjoying the process of creating your own apps. If you would like to create more apps, please check out the tutorials section.

Comments

Popular posts from this blog

Hip hop and RnB songs to apologize to your partner

Love is a beautiful thing, but it often goes wrong. This often leads to pain, suffering and sorrow.  Being imperfect beings, hearts tend to get broken all the time regardless how hard we may try to avoid it.  The heartbreak is often inadvertent but at times we find ourselves in the wrong. An oversight, a word unsaid or even a lapse in our judgement can cause our loved ones harm. This doesn't always have to be the end though. Oftentimes, relationships can be mended by simply uttering three simple words: "I AM SORRY". This article is a collection of some of my favourite 'I'm sorry' songs. I hope you'll enjoy these apology songs, but more importantly, I hope you will get a few quotables and some wisdom nuggets from them.  The best apology however, is to change behaviour (got that from a Jay Z interview) so as you apologize, please remember that it was your actions that hurt them. The best apology is one which involves you not repeating those same mistakes aga

Php date: How to get the first and last day of the week

In this tutorial, I'll show you how to get the first and last day of the week in php. By default, in PHP the week runs from Monday to Sunday. However we'll cover two methods to get the first and last day for both those who consider Sunday or Monday as their first day of the week. We will be using 2 functions to achieve this: date() strtotime() We will use a combination of these two functions and store the result in a variable.  How to get the first day of the week If you want to get Sunday, use this method: $firstday = date('l Y-m-d', strtotime("sunday -1 week")); echo $firstday; If you want to get the date for Monday, this current week, use this method: $monday = date('l Y-m-d', strtotime("monday -1 week ")); echo $monday; How to get the last day of the week The following code will give you Saturday as the last day of the current week. $lastday = date('l Y-m-d', strtotime("saturday 0 week")); echo $last

How to easily create background notifications in Sketchware(original)

How to easily create background notifications in Sketchware(original) One of the keys to building a successful app is to find mechanisms that will keep your users engaged. You can do this by using background notifications. This tutorial will show you how to do that in Sketchware. We will cover: 1. How to create notifications in Sketchware 2. How to show these notifications even when the app is closed.