For the past five years a lot of the posts you’ve read here are ones I wrote and posted via email, using a process I described in 2016. Having my phone or tablet become a mobile blogging platform was a tectonic shift in my blogging practice, freeing me from posting only while in the office in front of my computer. I
When I originally set this system up, I added a feature to look for an MP3 file in the email, and add this as a playable attachment to the blog post. This was fine when I was blogging from my Android phones, where I used a third-party audio recorder that saved audio in MP3 format, but since I moved to use an iPhone in mid-2020, I haven’t been able to do this because the Voice Memos app on the phone saves audio as M4A files.
I set out to solve this today by installing FFmpeg on my server, and then looking for incoming files with a MIME type of audio/x-m4a; when my script finds them, it converts them to MP3s:
system("/usr/bin/ffmpeg -i $sanitized_filename -acodec libmp3lame -ab 128k $sanitized_filename_mp3");
I used the new capability with this post this morning.
Stay tuned for a revivified Peter and Oliver Podcast, missing in action since March 2020!
Add new comment