Convert Text to Speech

To convert a plain text file to an mp3, use the espeak speech synthesizer and ffmpeg to save the audio as an mp3.

espeak -f Book.txt --stdout | ffmpeg -i - -ab 192k -y AudioBook.mp3

To convert a pdf to an mp3, use pdftotext.

pdftotext Book.pdf - | espeak --stdout | ffmpeg -i - -ab 192k -y AudioBook.mp3

Last updated