Kodular | Text To Speech


In this app, we will have a button and if the button is pressed the app will say something which is already predefined inside the app. So let us begin. First, you have to go to projects and click on start a new project. Now, we need a button on the screen. You can simply just drag that from components. You can bring the button to the center of the screen. For that just click on the button, and from its properties, click on align horizontal and click on center then click on align vertical and again click on center.  

Now you have the button at the center of the screen. Add an image to the button. In the properties panel of the button, there is an image section. You can click and upload an image from your computer. If the image is oversized, resize the button to 25% height and 60% width. Now remove the text behind the button and we have the front end built and ready.  

Now we need to put the code behind this button. Click on the button in the block section and there is a button click function given. Let us drag that on the screen. When button one is clicked there should be a sound made in this app. What will happen is that you will put the text you want, and this text will be converted to a sound by the Text to speech converter. For that, we need a medium called text to speech. Just drag it onto the design screen like in the design picture.

Now we will configure that. Inside button clicked function we need call text to speech function. Click text to speech and just drag that function to the screen. Assign any text to it or you can say “hello, have a nice day”. 

So now you can test your app and you will see that when you click on the button it will say what we assign it to say.

Post a Comment

Previous Post Next Post