Show HN: PDF to Podcast – Convert Any PDF into a Podcast Episode (pdf-to-podcast.com)
I'm stoked to share a project I've been working on called PDF to Podcast. It's a free, open-source tool that automatically converts PDF documents into engaging, informative podcast-style audio content using large language models and text-to-speech tech.
Inspiration: The idea for this project came from the NotebookLM demo at Google I/O, where they showcased generating audio dialogue from uploaded PDFs and other sources. However, that audio feature hasn't been publicly released yet, and I wanted to challenge myself to build something similar using existing tools and APIs.
How it works:
The user uploads a PDF The tool extracts the text and feeds it into Google's Gemini Flash language model Gemini Flash generates a natural, engaging podcast dialogue script based on the key information in the document This script is then converted to audio using OpenAI's text-to-speech API The user can listen to the generated "podcast episode" and read along with the transcript I chose to use Gemini Flash for the language model because it's good at writing high-quality prose while being fast and cheap. We use OpenAI's TTS API to then bring the dialogue to life.
Under the hood, it's built with Python, FastAPI, Gradio for the web UI, and my own library, promptic, for calling the LLM and getting structured output. The code is open-source and available on GitHub.
Apart from the tool's practical utility, I'm hoping this project can serve as a helpful example for others looking to build applications on top of large language models. It demonstrates an end-to-end flow from document intake to language model usage to audio output, with a simple web interface on top.
I would love to hear any feedback or ideas from the HN community! I think there's a lot of potential to expand on this concept and make all sorts of written content more accessible and engaging through audio conversion. Let me know what you think :)
44 comments
[ 4.8 ms ] story [ 102 ms ] threadAn escrow agent.
Like others have mentioned, I’d be scared to accidentally upload a 100 page PDF only for it to cost me $100 without me really knowing up front.
Do you have any samples of the audio? It would be great to hear what it's like before trying it out.
Also, have you considered doing this all in client side JS? Would be a good way to protect the API key (at least in this demo case).
It starts like this:
The way this uses different OpenAI TTS voices for the different roles is really neat!Hopefully not much, but I've heard horror stories about trailing spaces...
That said if it's a topic that I'm really really ignorant about, a little podcast/YouTube can be helpful. For example Yannick kilchers YouTube videos, especially how he annotates and breaks down the math equations, can be very useful if the paper's domain is new to me.
I think about it as pre-reading the paper.
A more focused first and second reading mode, may I propose, would add even more value. In these modes, the paper would be read more faithfully.
A problem that text to speech has when you feed it a regular PDF is that it will choke on titles, headings, footers, inline citations, page numbers, acronyms, abbreviations, numerical tables, charts, and diagrams.
So I would like to build or see something that conversationally reads the PDF as if it were a peer reading to me, unpacking abbreviations, mentioning titles and authors and years of citations (when I want that), describing charts, and perhaps even letting me interrupt to discuss specific misunderstandings I'm having.
There's obviously a challenge that reading a paper is an active engagement depending on your own knowledge state. We might gloss over formulas, footnotes, and citations on a first read, for example.
Still, a low hanging fruit would be a converter mode that accurately strips out page numbers and headers. There is little in this world more aggravating than listening to a 30 page paper, and having to hear that paper title and authors repeated an additional 15 times because it's reading the header.
I accidentally wrote 'podcasters' instead of 'podcasts'.
I mean I'll grant that podcasters are the scum of the Earth but. But I didn't intentionally mean to insult them there. [Here I'm just doing it for fun, lol.]
And I swear to God and warn you!
You all are going to make me start a podcast if you end up downvoting this comment too! Is that what the world needs!?? For me to start an AI generated podcast!?!! Don't make me do it!!!
However, I find that when I realize a podcast is generated using AI and synthetic audio, I immediately lose interest. For me, the value of podcasts lies in authentic human conversations, and AI-generated content just doesn’t have the same appeal.
Probably it's just me being obsessed with old-school podcasts, though. I do believe there are listeners (not sure if many or few) who don't mind if a podcast is AI-generated.
I have tried to set up something similar with text-to-speech browsers extension but I loose my place if I have to close and reopen.
It's all far from perfect.
I don't like podcasts. I tune out after about 30 seconds of chit chat and intros and blah blah blah and end up missing stuff and can't search for it or copy and paste it.
Just wondering why the choice of OpenAI TTS instead of elevenlabs?
Got distracted by other priorities so I haven’t done the RSS bits yet. In large part because that’s just boring old engineering stuff instead of playing with new toys. But I intend to get back and finish this thing by the time I start training for my next marathon. Need lots of listening material when that happens :)
Until then, hope this helps: https://github.com/Swizec/rss-to-podcast
Take some article or book written for adults. Maybe some archaeological discovery, interesting stuff from HN. Or science books from the 1960s.
Then have it turned into a conversation between the father and a curious, seven year old daughter. And convert it to audio with two different speakers.
While it’s been fun to build this, I never ended up letting my kids use it. It just feels wrong. The educational equivalent of Harlow’s Monkeys.
https://simply-ai.podbean.com
https://www.simplynews.ai