Create Text to speech converter app using Sketchware
If you haven't yet watched the video , watch it right now !
Open Sketchware. Create new project .Go to the logic section . In on Create event , add the following code
t1=new android.speech.tts.TextToSpeech(getApplicationContext(), new android.speech.tts.TextToSpeech.OnInitListener() {
@Override public void onInit(int status) {
if(status != android.speech.tts.TextToSpeech.ERROR) {
t1.setLanguage(Locale.UK); } } });
}android.speech.tts.TextToSpeech t1;
private void nothing(){
@Override public void onInit(int status) {
if(status != android.speech.tts.TextToSpeech.ERROR) {
t1.setLanguage(Locale.UK); } } });
}android.speech.tts.TextToSpeech t1;
private void nothing(){
Go to the logic section and tap on Button1 on Click event
Create a string variable named "speak". Now set the value of that string variable using blocks.
Please watch the above video for Reference.
Now use add source directly block and add the following code
t1.speak(speak, android.speech.tts.TextToSpeech.QUEUE_FLUSH, null);
Run the app.
If you have any doubts comment below
How to change Language?
ReplyDeleteJust instead of the first code, insert this t1=new android.speech.tts.TextToSpeech(getApplicationContext(), new android.speech.tts.TextToSpeech.OnInitListener() {
Delete@Override public void onInit(int status) {
if(status != android.speech.tts.TextToSpeech.ERROR) { } } });
}android.speech.tts.TextToSpeech t1;
private void nothing(){
No anda este codigo t1.speak( hablar , android.speech.tts.TextToSpeech.QUEUE_FLUSH, null);
ReplyDeleteStoring the questions as a JSON array is much easier to maintain than hardcoding ten screens. I swapped in vocabulary questions to make a little word quiz for my kids. It's the same idea that kept me hooked on Bookworm Deluxe years ago: short rounds, instant feedback, and a score you want to beat.
ReplyDeleteSnake and Ladder with a housemate during lockdown sounds like a lovely way to get through those MCO days, and Congkak and Batu Seremban bring back memories too! Tetris will always be a classic. If you like slower puzzle games as well, the old PopCap word game Bookworm is worth revisiting. You link letter tiles to make words, and it's great for relaxing. There's a good overview here: Bookworm Deluxe.
ReplyDelete