What a script of 6 lines of code can teach you — from 5 min to seconds

Hector Herradura

Sep 2 · 5 min read

So this is the case, my car an Alfa Romeo GT only plays 192kbps bitrate mp3 through an USB (other bitrates provoke artefacts at the speakers), and to play music first I must convert it to this specific file type. This was resulting in an tedious process where I was spending an average of 5 min to 10 min, to open the converter, setting the files, specifying the bitrate and then waiting to pass my music to the USB.

I love music and I was getting boring due to my music hadn’t changed so much since a year or two because I had to spent time doing conversions. So I wanted to create something fast and an automatic, like a Stradale.

Alfa Romeo 33 Stradale designed by Franco Scaglione, 1967

The first tool I needed was the converter something that would change all my music, the tool in this case is FFmpeg which is a command line tool that can convert, record and stream audio and video.

The next step was to create the script, at this time I was deciding between DOS, Python and PowerShell.

  • I didn’t want to spent much time learning a new language so Python was discarded.
  • I was very tempted to use PowerShell but a quick search on internet taught me that PowerShell doesn’t admit drag and drop files for security reasons, this was a big no.
  • So the decision was taken, to program it the arcane DOS language which I have very little experience with and to convert it later into a batch file.
Published
Categorized as UX Tagged