Note: this instructable required the use of the command line. which you can find at Applications menu > Accessories > Terminal.
Step 1: Adding a Bit of Software (with Ubuntu).
You can do the same with the Synaptic package manager.
Or use the old command line with:
$ sudo apt-get install xpdf
xpdf will be one of two workhorses we will use.
text2wave is another workhorse, but it comes standard and no need to install. You may want to look at the documentation for text2wave with man or gman (has to be installed).
Step 2: Creating a Text File From the Pdf.
$ pdftotext inputfile.pdf outputfile.txt
# Optional: split the text file into smaller portions if you want to for manageable listening.
Test.pdf is the pdf file I created with openoffice. Just wanted to create a small pdf file to deal with for this demo.
So for me I typed.
$ pdftotext test.pdf test.txt
This command created an additional file from the pdf file into what is known as a non-formatted plain text or ascii file. This was quick for such a small pdf file. larger files will take longer.
To make sure a file was created , so I displayed the output file.
So far so good.
Step 3: Text to Speech!
$ text2wave < outputfile.txt > file.wav
$ text2wave < test.txt > test.wav
If you get an error, you can uusally but not always ignore it.
Now you want to test if the text was converted to a music file; Make sure the speakers are on and the sound is at a reasonable level.
$ aplay test.wav
Viola I heard the the converted text file as speech!!!!
You may want to copy the file over to the desktop to make it easier to find.
$ cp test.wav ~/Desktop/.
Step 4: Put It on the Music Player.