How to create SpeechToText in Sketchware?

 How to create SpeechToText in Sketchware?


Add textview and imageview follow below image.



Add a filepicker component click onfilesPicked follow below image.


Click on files picked. Add source directly follow below image.




Copy this 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));




Click on imageview to add source directly follow below image. 

Copy this 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(); }


Create a block click on this blog use source directly follow below image.


Define block Add source directly follow below image.



Copy this code.......

}

public static final int REQ_CODE_SPEECH_INPUT = 1;

{

Watch video to develop




Comments

Popular posts from this blog

Rohingya books apk