Article2Audio is a straightforward web app designed for personal use, allowing users to convert online articles to lovely audio files. It extracts the content of an article, formats it nicely in preparation of audio conversion, then uses OpenAI's Text to Speech API to produce the audio file.
For ease of use, we also include a simple python script which allows users to directly convert article URLs to audio files without needing to spin up the web app.
The.Most.Precious.Resource.is.Agency.mp4
-
Clone the repository:
git clone https://github.com/yourusername/Article2Audio.git cd Article2Audio
-
Add your openAI api key
Open
convert_article_urls_to_audio.py
and add your OpenAI API key to theOPENAI_KEY
variable at the top of the file. -
Install the required packages:
pip install -r server/requirements.txt
The script convert_article_urls_to_audio.py
allows for two modes of operation:
-
Default Mode: By default it will use the URLs specified in the
HARDCODED_URLS
list at the top of the file.python convert_article_urls_to_audio.py
-
Command Line Mode: Overrides hardcoded URLs by specifying URLs via the command line with the --urls option.
python convert_article_urls_to_audio.py --urls https://www.thefitzwilliam.com/p/james-joyce-was-a-complicated-man "https://www.honest-broker.com/p/how-picasso-turned-me-into-a-strategy"
-
Clone the repository:
git clone https://github.com/yourusername/Article2Audio.git cd Article2Audio
-
Create a
.env
file with necessary environment variables in the/server
dir:cd server touch .env
Add the following environment variables to the
.env
file:OPENAI_KEY=your-openai-key LOGIN_PASSWORD=your-password SECRET_KEY=your-secret-key
-
Build and run Docker
docker compose up --build
Enjoy your audio versions of any article you want at http://localhost:3000! 🎉
Note that it can take up to a few minutes to generate the audio file depending on the length of the article. Will look into optimizing this/ running it concurrently without OpenAI rate limiting issues in the future. UI and iterface will be updated soon too, particularly with making the audio files persist on the web interface so they're more readily available!