Speech Recognition: Speech to text in Sketchware


We can implement Speech recognition using codes in add source directly block in Sketchware. Follow the steps below to implement Speech recognition in Sketchware.

1. Create a new android project in Sketchware.

2. In VIEW area add a Button button1 and an EditText edittext1 (or a TextView).

3. Add a new FilePicker component fp.

4. Add a new More Block extra.

5. To define this block extra, use an add source directly block and put following code in it:
}
public static final int REQ_CODE_SPEECH_INPUT = 1;
{

6. In the event button1 onClick, use an add source directly block and put following code:
Intent intent = new Intent(android.speech.RecognizerIntent.ACTION_RECOGNIZE_SPEECH); intent.putExtra(android.speech.RecognizerIntent.EXTRA_LANGUAGE_MODEL, android.speech.RecognizerIntent.LANGUAGE_MODEL_FREE_FORM); intent.putExtra(android.speech.RecognizerIntent.EXTRA_LANGUAGE, Locale.getDefault()); intent.putExtra(android.speech.RecognizerIntent.EXTRA_PROMPT, "Speak Now");
try { startActivityForResult(intent, REQ_CODE_SPEECH_INPUT); }
catch (ActivityNotFoundException a) {
Toast.makeText(getApplicationContext(), "There was an error", Toast.LENGTH_SHORT).show(); }

7. Add the event FilePicker onFilesPicked. Here use an add source directly block and put following code:
}
break;
case REQ_CODE_SPEECH_INPUT:
if (_resultCode == RESULT_OK && null != _data) {
ArrayList<String> result = _data.getStringArrayListExtra(android.speech.RecognizerIntent.EXTRA_RESULTS);
edittext1.setText(result.get(0));

8. Save and run the project. Now in the app, the Button can be pressed to speak things to be written in the EditText field.

Comments

  1. Please , add video "how to your app work is background"

    ReplyDelete
  2. Please add video how to creat one time view activity(page)

    ReplyDelete
  3. i am sri lanka....i watched your all videos....i am your subscriber....👊👊👊👊

    ReplyDelete
  4. Thank you for this excellent tutorial...
    I'm working on an app, and I want to get the current location of the device, how can I do this in sketchware?
    Thank you!

    ReplyDelete
  5. Replies
    1. How to use your code on sketchware.. Please add screen shot

      Delete
  6. How to make a application like this ?

    https://github.com/AllAboutEE/Android-App-HTTP-Helper/blob/master/app/src/main/java/com/allaboutee/httphelper/HomeActivity.java

    ReplyDelete
  7. how to automatic screenshot method in sketchware

    ReplyDelete
  8. It's not work and given 3 error line

    ReplyDelete
  9. Dear admin...
    Can you tell me how to change the speech recognition language?? I want use another language. Thank you!

    ReplyDelete
  10. how can i limit the time of the speech function, because it doesn't stop recognizing sound if there's still some noise.

    ReplyDelete
  11. Svp comment faire une application d'enregistrement audio

    ReplyDelete
  12. Create a SONG reconation app
    Like Google assistant

    ReplyDelete
  13. More efficient and effective than writing by hand, transcribe video to text is a powerful tool that can benefit users with healthier bodies and states of mind.

    ReplyDelete
  14. There's also a Latest music filter to see recently added songs in stafaband. You can also search for artists that you know to see if their music is available for download.

    ReplyDelete
  15. Have you ever used stafaband? You can play the songs before downloading them, but when you're ready to save the songs to your computer.

    ReplyDelete
  16. This is a great article thanks for sharing this informative information. I will visit your blog regularly for some latest post. Text to Speech Mp3 Free

    ReplyDelete
  17. Thanks bro,👊
    I was able to creat this app💪

    ReplyDelete
  18. Most of the court does not work. Show me some error. How can I solve it?olsen mark question is how can I set Bangla language to speech to text?

    ReplyDelete
  19. This comment has been removed by the author.

    ReplyDelete
  20. This is a great post with lots of informative resources. I appreciate your work. This is really helpful for everyone. Check out our website Panasonic Programming Manual Support for more visit.

    ReplyDelete
  21. This is a good post. Static QR Code Generator Thanks for sharing with us, Excellent work and I really appreciate your work.

    ReplyDelete

Post a Comment

Popular posts from this blog

Simple car racing android game in Sketchware

Creating a Drawing View in Sketchware

Enable Fullscreen for Youtube videos in WebView

How to enable upload from webview in Sketchware?

List of Calendar Format symbols valid in Sketchware