Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

A Python script project that converts PDF text into an MP3 audio file using text-to-speech technology.

NotificationsYou must be signed in to change notification settings

theshobhitsingh/PDFVoice

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 

Repository files navigation

Overview

The PDFVoice is a Python script project that reads the content of a PDF file and converts it into an MP3 audio file using text-to-speech technology. This tool is useful for making text content more accessible and creating audio versions of documents.

Features

  • Extracts text from a PDF file
  • Converts extracted text to speech
  • Saves the audio as an MP3 file
  • Configurable speech rate and volume

Requirements

  • Python 3.x
  • pyttsx3 library (for text-to-speech conversion)
  • PyPDF2 library (for reading PDF files)

Installation

  1. Clone the repository (if applicable) or download the script:

    git clone https://github.com/your-username/pdf-to-speech-converter.gitcd pdf-to-speech-converter
  2. Install the required libraries:

    pip install pyttsx3 PyPDF2

Usage

  1. Update the PDF file path: With the path to your own PDF file in the script.

  2. Update the output MP3 file path: With your desired output file name.

  3. Run the script:

    python pdf_to_speech_converter.py

    This command will convert the PDF file into an MP3 file with speech.

Script Details

  • convert_pdf_to_speech(pdf_path, mp3_path): Main function that handles PDF reading, text extraction, and speech conversion.
    • pdf_path: Path to the input PDF file.
    • mp3_path: Path where the MP3 file will be saved.

Configuration

  • Speech Rate: Adjust the speech rate by modifying therate property in thespeaker.setProperty('rate', 150) line. The default rate is 150 words per minute.
  • Volume: Adjust the volume by modifying thevolume property in thespeaker.setProperty('volume', 1.0) line. The default volume is 1.0 (full volume).

Troubleshooting

  • Issue: "No module named 'pyttsx3'".

    • Solution: Ensure thatpyttsx3 is installed. You can install it usingpip install pyttsx3.
  • Issue: "No module named 'PyPDF2'".

    • Solution: Ensure thatPyPDF2 is installed. You can install it usingpip install PyPDF2.

Contributions

  • All the suggestions and contributions are welcomed!

Author

This script is build by Me!

About

A Python script project that converts PDF text into an MP3 audio file using text-to-speech technology.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages


[8]ページ先頭

©2009-2025 Movatter.jp