Giter Club home page Giter Club logo

pdf-to-audio's Introduction

PDF to Audiobook Converter

PDF to Audio Converter

I needed a quick tool to convert a long PDF to a single audio file so I decided to write a very simple small script to do so. Expect nothing fancy. It's just a tool you can clone, execute and profit from.

This project provides a script that converts PDF documents into audiobooks using OpenAI's text-to-speech capabilities. It splits the PDF text into chunks, generates audio files for each chunk, and then merges these into a single audiobook file.

Requirements

  • bun
  • Access to OpenAI API

Installation

To install the required dependencies, run:

bun install

Usage

Execute the script with bun, providing the path to the input PDF and the desired output path for the audiobook:

bun index.ts [inputPdfPath] [outputAudioPath]

Ensure you have set the OPENAI_API_KEY in your .env file to use the OpenAI API.

Note

This script utilizes fluent-ffmpeg for audio processing (merging chunk audio files to one file), pdf-parse for reading PDF content, and the OpenAI SDK for generating speech.

pdf-to-audio's People

Contributors

zaunermax avatar

Stargazers

Max Mayr avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.