TTS doesn't initialize in Android 11

25 Views Asked by At

I am working on Text-to-Speech. The program I am trying to make, runs at API level 24, but it gives an error ("null") at level 30. The problem persists even though I added the following lines to the manifests file for Android 11. Unfortunately, I could not find a source about this. I would be grateful if you could help me.

To Manifest

    ...

    <queries>
      <intent>
        <action
           android:name="android.intent.action.TTS_SERVICE" />
      </intent>
    </queries>

    ...

My Code:

    ...

      'tts = new TextToSpeech(getApplicationContext(), new TextToSpeech.OnInitListener() {'

    ...
0

There are 0 best solutions below