Skip to content

seoeunjungg/audio_book

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Audio Book Reader

A small Flask web app that extracts text from a selected range of PDF pages and reads the text aloud in the browser.

What It Does

  • Upload a PDF from the browser.
  • Choose a start page and end page.
  • Extract text from those pages with PyPDF2.
  • Display the extracted text in a retro-styled reader.
  • Read the text aloud with the browser Web Speech API.
  • Change reading speed and volume before starting playback.

Tech Used

  • Python
  • Flask
  • PyPDF2
  • HTML
  • CSS
  • JavaScript
  • Browser Web Speech API

Project Structure

audio_book/
  main.py
  requirements.txt
  templates/
    index.html
  static/
    style.css
    script.js
    fonts/
    images/

How To Run

Create and activate a virtual environment:

python3 -m venv .venv
source .venv/bin/activate

Install the dependencies:

pip install -r requirements.txt

Start the Flask app:

python main.py

Open the local site:

http://127.0.0.1:5000/

How The App Works

Flask receives the uploaded PDF and page numbers from the form in templates/index.html.

main.py uses PyPDF2 to extract text from the selected pages, then sends that text back into the page as extracted_text.

static/script.js handles the browser controls. It reads the displayed text aloud, stops playback, and applies the selected speed and volume.

static/style.css contains the retro window design, custom font, toolbar, reader box, and control styling.

Notes

The browser speech controls apply speed and volume when a new reading starts. Changing speed or volume while speech is already playing may not affect the current reading until playback is restarted.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors