An automation tool to transform your blog into audio and publish it as a podcast in Anchor.fm
| Main dependencies:
| Setup:
-
Install ffmpeg. It's recommended to install full version to be sure to have all needed features
-
[Windows]
Addffmpeg
andffprobe
to yourPATH
-
Install other dependencies:
npm install
| How to use:
-
If you want to upload into AnchorFM, you need to set your credentials in
secrets/anchor/email
andsecrets/anchor/password
-
Expected folder structure:
- blog-management\thenursewhocoded (contains .md files used as text input)
- blog-management\songs (contains .mp3 to be added at chapter opening and closure)
- blog-management\hashnode-to-anchorfm (this repository)
-
Add the input text doc in
.md
format inthenursewhocoded
-
Expected input filename structure:
src/input/{postCode}.json
. You have an example insrc/input/test1/post1.json
- In the json file, "code" atribute must be equal to
filename
inthenursewhocoded/{filename}.md
- In the json file, "code" atribute must be equal to
-
Add desired
opening.mp3
song inblog-management/songs/{blogCode}/opening
. Add theclosure.mp3
song inblog-management/songs/{blogCode}/closure
-
Create
output/{blogCode}
folder. It will be used to store the output audio file -
You can run independently the task for transforming from text to voice (? args are optional):
npm run text-to-voice {blogCode} {postCode} {?lang}
A) blogCode
: The name of the folder for your chosen input file, as well as the desired location for the output file. It's part of the input and output file name too
B) postCode
: Part of the input and output file name
C) lang
: Desired language for the voices. Supports Spanish (es
) and English (en
). Defaults to en
-
text-to-voice
output.mp3
audio file will be created onsrc/output/{blogCode}
-
A
{blogCode}.json
file will be created too on output, that will be used by theupload-anchor
task -
[TODO, Not working right now] You can also run only the task for uploading to AnchorFM:
npm run upload-anchor [same params]
-
Audio file will be uploaded to AnchorFM
-
[TODO, Not working right now] You can execute together text-to-voice and upload-anchor tasks with:
npm run text-to-anchor [same params]
| Command executed on ffmpeg in text-to-voice task:
ffmpeg -i src/input/test1/songs/opening.mp3 -i src/output/test1/test1_cap1_0_0.mp3 -i src/input/test1/songs/closure.mp3
-y -filter_complex concat=n=73:v=0:a=1 src/output/test1/test1_cap1.mp3
-
Code for gtts by @W01fw00d from https://github.com/W01fw00d/text-to-voice
-
Hasnode management by @W01fw00d
-
test1
opening and closure songs were created by @W01fw00d
MIT