Podcast Creation Script – Update

I’m just now posting the latest episodes, and they will all be generated using the updated version of my podcast creation script as described here.

The basic script calls a series of functions:

  • cs_set_variables, cs_set_filenames – set required variables and filenames
  • cs_choose_background_color – choose a background colour for the art, generated based on the episode number in such a way as to have it change significantly for each episode.
  • cs_art_background – create background using ImageMagick
  • cs_art_texts – generate text images
  • cs_art_logo – generate Coiled Spring logo image
  • cs_art_cover – generate cover image
  • cs_art_combine – combine all images into the complete cover art
  • cs_audio_speech – generate all the speech using espeak
  • cs_audio_fix_existing – fix all input audio files for sample rate etc using SoX.
  • cs_audio_logotone – create interstitial logotone using speech and random beeps
  • cs_audio_mix_intro – mix the intro music and the intro speech
  • cs_audio_concat_process – string together all the audio files into the complete episode, process using a dynamic compression algorithm to improve the sound, and then convert to MP3
  • cs_audio_tag – Use eyeD3 to tag the MP3 file with the title and episode number
  • cs_delete_working – delete all the working files

To do

There are still some improvements I could make. The following list includes stuff I thought of when I originally posted the script. Some are now fixed, some are redundant, some are new ideas.

  • I’m sure the script as it stands has some inefficiencies in it. I would like to fix it if I get the chance, or if anyone fancied lending me a hand.
  • Is bash the best language to use? Seems fine to me.
  • Generate multiple logotones instead of just having one repeated. Perhaps say, “End of Part 1 of the Coiled Spring” etc. Use different random beeps in each one, or even a different sound effect. Just leave it for now.
  • Use a seeded random generator to make sure the background color changes sufficiently between episodes. Maybe base it on the episode number and title for predictability. (Alternatively, use a trick to combine the title and episode number, turn it into the color, and not be random at all.) Done. If you’re interested, the background colour is generation is described in a separate blog post.
  • Alternatively, generate the artwork first using a random colour, display the result, and then only proceed to create the sound file when the artwork is approved. I did this for a while, until the colour generation was fixed.
  • Get rid of so many temporary files by using pipes and other things to feed results of one command to another command directly.
  • Understand the artwork filter – make it more like GIMP‘s “colour to alpha” function. Perhaps a normalization before the process starts. I found a script someone wrote that does a pretty good job.
  • Tweak the compression settings to improve the audio quality. I’m happy with it for now.
  • Tweak the sample rate to improve the audio quality. I’m happy with it now.
  • Put the reused files in a different directory, and create the new files in their own directory. This is tricky with bash. Done.
  • Get the script to open a browser, go to OpenStreetMap, find a relevant place (maybe ask for a location (or just a URL to be simple)), use a command-line screenshot tool to grab the map, use ImageMagick to manipulate the image (rotate, crop, filter), and then use that as a background. Maybe just provide a map image, and randomly crop it for each episode. I’ve decided to use a particular image for each episode, filtered specially.
  • Tweak the settings to make the voice a little better (the espeak voice, obviously, ahem). I’m happy with it for now.