DEV Community

loading...

Discussion on: Convert any .pdf file 📚 into an audio 🔈 book with Python

Collapse
gadgetsteve profile image
Steve (Gadget) Barnes

I would suggest adding two lines to save the MP3 file to the same location and name as the PDF file.

from os.path import splitext

outname = splitext(filelocation)[0] + '.mp3'

then use:

final_file.save(outname)

Collapse
mustafaanaskh99 profile image
Mustafa Anas Author

That would be a nice add!

Collapse
sadorect profile image
sadorect

Oh, fantastic! I was looking to add this by myself but I don't know python coding. Thanks for bringing it up!