https://github.com/lazycatcoder/pdf-to-mp3
This Python code allows to convert PDF files to MP3 in the chosen language (English, Polish, Ukrainian)
https://github.com/lazycatcoder/pdf-to-mp3
automatic-translation converter english googletrans googletranslate gtts language mp3 pdf pdf-to-mp3 polish pypdf2 python reading texttospeech ukrainian
Last synced: 5 months ago
JSON representation
This Python code allows to convert PDF files to MP3 in the chosen language (English, Polish, Ukrainian)
- Host: GitHub
- URL: https://github.com/lazycatcoder/pdf-to-mp3
- Owner: lazycatcoder
- License: gpl-3.0
- Created: 2023-03-17T22:38:34.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-04-12T22:28:29.000Z (over 2 years ago)
- Last Synced: 2025-05-05T22:14:25.059Z (5 months ago)
- Topics: automatic-translation, converter, english, googletrans, googletranslate, gtts, language, mp3, pdf, pdf-to-mp3, polish, pypdf2, python, reading, texttospeech, ukrainian
- Language: Python
- Homepage:
- Size: 16.6 KB
- Stars: 4
- Watchers: 1
- Forks: 2
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
PDF to MP3 Converter
This is a Python script that allows users to convert PDF files to MP3 audio files in the language of their choice. It uses PyPDF2 to extract text from the PDF files, Google Translate API to translate the text into the selected language, and Google Text-to-Speech (gTTS) API to synthesize the speech and save the audio file.
The script has a user-friendly command-line interface that prompts the user to select the PDF file, the language, and gives the option to exit or continue converting files. It also creates separate folders for PDF and MP3 files.
## ๐กPractical use
This script can be useful for people who prefer to listen to text instead of reading. This can be convenient, for example, when traveling on public transport or playing sports. In addition, the script can be used to create audio books or audio lectures.
# Settings
To use it, you need to complete the following steps:
### ๐ Clone this repository
```
git clone https://github.com/lazycatcoder/pdf-to-mp3.git
```
### ๐ฆ Install dependencies
```
pip install -r requirements.txt
```#
## โจ How to use
- Download the repository and install the required modules
- Create "pdf" and "mp3" folders in the same directory as the script (optional)
- Place the PDF files to be converted into the "pdf" folder
- Run the script ๐
- Follow the instructions on the screen
### ๐ง Additional Information
๐ด For the script to work correctly, it is necessary that PDF files be recognized or that it is possible to highlight the characters contained in them, since this is necessary for the script to read text from files.