Don’t want to read a PDF file but want to listen to it, then read this article and find out how…
This short article explores the text to speech Python library pyttxs3, reads the PDF files and converts the text to audio, and adjusts the listening speed and volume.
My daughter wanted a program that she can use to listen to a PDF file, an HTML file, or a word document. She wanted to adjust the speed and the volume of the audio and this was my quick solution for her problem using a python text to speech library.
Install pyttsx3 library
pip install pyttsx3
Import the python text to the speech library: pyttsx3, initialize the library, then pass the text to say(), and finally, flush the say() queue to play the text as audio.
import pyttsx3 ## Initialize the library engine = pyttsx3.init() ## specify the text you want to listen text="Wear mask, sanitize, social distance and be safe. Happy Thanksgiving!" engine.say(text) ## Flush the say() queue to play the audio engine.runAndWait()
Guide to Python Programming Language
Python is an interpreted, high-level, powerful general-purpose programming language. You may ask, Python’s a snake right? and Why is this programming language named after it?
Python Hello World Program - Your first step towards Python world. Learn how to create the Hello World Python program in PyCharm.
Python Programming Tutorials For Beginners
SQL stands for Structured Query Language. SQL is a scripting language expected to store, control, and inquiry information put away in social databases. The main manifestation of SQL showed up in 1974, when a gathering in IBM built up the principal model of a social database. The primary business social database was discharged by Relational Software later turning out to be Oracle.