This Python script empowers you to transform short stories into engaging audiobooks effortlessly. Leveraging the capabilities of OpenAI's GPT-3 and TTS-1 models, the converter not only generates captivating short stories but also converts them into beautifully formatted PDFs and narrates them in audio format.
- OpenAI API Key
- Python 3 installed on your system
Follow these simple steps to set up and run the PDF to Audiobook Convertor:
- Clone the Repository
git clone https://github.com/your-username/pdf-to-audiobook.git
- Navigate to the Project Directory:
cd pdf-to-audiobook
- Install Required Packages:
pip install -r requirements.txt
- Set OpenAI API Key:
export OPENAI_API_KEY="your-api-key"
Running the script is straighforward. Follow these steps:
- Execute the main script:
python main.py
- Respond to the prompt:
- To generate a new story, PDF, and audiobook, type "Y".
- To convert an existing PDF to an audiobook, type "N" and provide the PDF filename.
- PDF: The generated PDF is saved in the output/ directory.
- Audiobook (MP3): The audio rendition is saved in the output/ directory.
- The generated story is limited to 4000 characters.
- Ensure the input PDF is in the root directory and spelled correctly.
Currently, contributions are not accepted for this project.
This project is licensed under the MIT License - see the LICENSE file for details.