Comment créer une application qui convertit un texte en parole
Cette section donne le code de la vidéo dans laquelle j'ai montré comment créer une application qui convertit un texte en parole très facilement avec sketchware. Le seul code utilisé pour créer cette application est le suivant : 👉 final android.speech.tts.TextToSpeech 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) { Toast.makeText(getApplicationContext(), "Error",Toast.LENGTH_SHORT).show(); } } }); button1.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View _v) { String sentence = edittext1.getText().toString(); Toast.makeText(getApplicationContext(), sentence,Toast.LENGTH_SHORT).show(); t1.speak(sentence,android.speech.tts.TextToSpeech.QUEUE_FLUSH, null); } } ); On peut le mettre dans "onCreate" comme dans "onclick". Il faut être sûr que les...