Text to Speech – Android Studio Tutorial

In this video we will learn, how to use the text to speech API in Android. We will set up ab OnInitListener, override the onInit method, set our desired language and take care of any Exceptions. We will also adjust the pitch and speed of the spoken text using SeekBars.

Source code:

Subscribe to my channel:

Want more Android tutorials? Check my playlist section:

Follow me on social media:





36 Replies to “Text to Speech – Android Studio Tutorial”

  1. Talati Utsav

    If you type "Sneh" then your application speak the each spell like S , N , E , H
    Also if you type "Utsav" then also it speaks one word not correct pronunciation

    If you can solve this then make video for it ?

  2. Ezequel Hadjie

    Sir i have a question, in text to speech is it possible to pause the tts while it is speaking? i have tried it but it only stop and playing it again from the start? could you make a tutorial for it if possible? Thanks! 🙂

  3. PrudviRaj Dharavath

    mTTs.speak(text, TextToSpeech.QUEUE_FLUSH, null);

    Where speak got stricken and moreover speech engine is not able to pronounce 1st four characters that entered

    Please help me out for this thank you

  4. zeyad jy

    amazing video thank you, i am trying to implement this listener to know when it finshes specking but i cant get it to work
    mTTS.setOnUtteranceProgressListener(new UtteranceProgressListener() {
    public void onStart(String utteranceId) {


    public void onDone(String utteranceId) {
    Toast.makeText(NumbersActivity.this,"Done speaking ",Toast.LENGTH_LONG).show();



    public void onError(String utteranceId) {
    Toast.makeText(NumbersActivity.this,"Error happend ",Toast.LENGTH_LONG).show();


  5. Prakash Dahal

    Bro I was searching to compare two voices whether it is of same user or not.
    I like your videos I found this one also very useful. If you can suggest me something for this.
    My gmail is dahalprakash1720@gmail.com

  6. golam mawla

    Your tutorial is obviously helpful for the person who are extremely new as an android developer like me. Sir, appreciate upon your tutorial. I would like to ask you one question please let me know its ans as it is manageable to you. the question how can i set this "text to speech " in pdf view? lets say in the pdf view if user wants to listen the texts instead of reading that are on the pdf view. how should i solve this sir? The same thing you may take a look as you browse the windows edge browser for reading a pdf file will be able to see that a "text to speech" option is given to the corner on the upper bar. As user is lazy to read can be able to listen those texts. I want that same thing to do in android pdfView. Please suggest me as your effort.

Leave a Reply

Your email address will not be published. Required fields are marked *