Inspiered by Google's NotebookLM, Learncast is a podcast generation application that leverages AI to create engaging and informative podcasts based on user-provided content. Users can input various types of sources, such as URLs, PDF files, or DOC files, and specify the style, analogy, and topic of emphasis for the podcast. The application generates a podcast script and converts it into audio format, ready for playback with intro and outro music. See sample generations in App/generated
- AI-Powered Podcast Generation: Utilizes OpenAI's API to generate conversational scripts.
- Multiple Source Types: Supports URLs, PDF files, and DOC files as input sources.
- Customizable Output: Users can specify the style, analogy, and emphasis for the podcast.
- Background Music and Voice Settings: Incorporates background music and customizable voice settings for different speakers.
- Real-time Status Updates: Users can check the status of their podcast generation in real-time.
- FastAPI: For building the backend API.
- OpenAI API: For generating podcast scripts.
- Pydub: For audio processing.
- BeautifulSoup: For web scraping content from URLs.
- Streamlit: For the user interface.
- Python: The primary programming language.
To set up the project locally, follow these steps:
-
Clone the repository:
git clone https://github.com/cal3bdev/LearnCast-AI.git
-
Create a virtual environment (optional but recommended):
python -m venv venv source venv/bin/activate # On Windows use `venv\Scripts\activate`
-
Install the required packages:
pip install -r requirements.txt
-
Set up environment variables: Create a
.envfile in the root directory and add your OpenAI API key:OPENAI_API_KEY=your_openai_api_key -
Run the FastAPI server:
python main.py
-
Run the Streamlit UI: In a new terminal, run:
streamlit run ui.py
- Open your web browser and navigate to
http://localhost:8501to access the Streamlit interface. - Fill in the required fields:
- Source Type: Select the type of source (URL, PDF, or DOC).
- Source: Enter the URL or file path.
- Analogy: Provide an analogy to guide the podcast generation.
- Emphasis: Specify the emphasis for the podcast.
- Style: Choose the style of the podcast (entertaining, informative, academic, funny).
- Click the "Generate" button to start the podcast generation process.
- Wait for the podcast to be generated. The status will be updated in real-time.
- Once completed, the podcast will be available for playback in the audio player.
- Endpoint:
POST /generate_podcast - Request Body:
{ "source_type": "url", // or "pdf", "doc" "source": "http://example.com", "analogy": "an analogy", "emphasis": "important points", "style": "entertaining" } - Response:
{ "podcast_id": "unique_podcast_id" }
- Endpoint:
GET /podcast_status/{podcast_id} - Response:
{ "id": "unique_podcast_id", "status": "pending | completed | failed", "podcast_url": "http://example.com/podcast.mp3" // only if completed }
Contributions are welcome! If you have suggestions for improvements or new features, please open an issue or submit a pull request.
This project is licensed under the MIT License. See the LICENSE file for details.
For any inquiries, please contact [lwangacalebb@gmail.com].