The "Speak Text" feature in Okular is not working. How do I get it to work?

I'm currently using Ubuntu 18.04 and Okular for viewing pdf documents. I thought it would be convenient if I could use the text to speech feature. I tried following all the instructions given here: http://freesoftwaremagazine.com/articles/listen_your_books_epub_pdf_okular/ (which was the only source I could find online) and I'm yet unable to get the text-to-speech feature working. Can you please tell me what should I do to get this working? If it is not possible because it was deprecated, can you please recommend a good alternative?

I tried opening the application from the terminal to listen to the audio. This was the output on the terminal when I selected a part of the text and clicked "Speak Text":

using null output device, none available
qt.speech.tts.flite: "Failed to start audio output (error 1)"

Qt Multimedia module is not installed by default so you are required to install it.

sudo apt install qml-module-qtmultimedia

I followed this instruction set successfully.

Install the dispatcher:

sudo apt-get install speech-dispatcher 

Install the synthesizer:

sudo apt-get install espeak

Install the speech plugin for Okular:

sudo apt-get install qtspeech5-speechd-plugin

Note: in this moment the version of Qt is 5. In the future, when you still read this article, you may find the version changed and the package version or name changed as well. This article is based only on current version.

Run the dispatcher first:

speech-dispatcher -d

You must run Okular after speech-dispatcher.