Mum found a collection of old cassette tapes of us when we were kids,
making and recording songs and radio shows. I've been digitising them
over the last few weeks, and today the first recorded cassette was ready
to share with the family.
I suppose I could've just given them raw MP3 files, but I wanted to
record each cassette as two large files — one per side — so as to not
loose much of the various crackles and clatters made when the tape
recorder was stopped and started. But I did want to catalogue the more
interesting points in the recording, and it would've been a bit "meh"
simply giving them to others as one long list of timestamps (simulating
the rewind/fast-forward seeking action would've been a step too far).
Plus, simply emailing MP3 files wasn't nearly as interesting as what I
did do, which was to put together a private site where others could
browse and play the recorded tapes:
The site is not much to talk about — it's a Hugo site using the Mainroad theme and deployed to Netlify. There is some JavaScript that moves the playhead when a chapter link is clicked, but the rest is just HTML and CSS. But I did want to talk about how I got the audio files into Netlify.
I wanted to use `git lfs` for this and have Netlify fetch them when building the site. Netlify doesn't do this by default, and I get the sense that Netlify's support for LFS is somewhat deprecated. Nevertheless, I gave it a try by adding an explicit `git lfs` step in the build to fetch the audio files. And it could've been that I was using the LFS command incorrectly, or maybe it was invoked at the wrong time. But whatever the reason, the command errored out and the audio files didn't get pulled.
I tried a few more times, and I probably could've got it working if I stuck with it, but all those deprecation warnings in Netlify's documentation gave me pause.
So what I ended up doing was turning off builds in Netlify and using a Github Action which built the Hugo site and publish it to Netlify using the CLI tool. Here's the Github Action in full:
This ended up working quite well: the audio files made it to Netlify and were playable on the site. The builds are also quite fast; around 55 seconds (an earlier version involved building Hugo from source, which took 5 minutes).
So for anyone else interested in trying to serve LFS files via Netlify, maybe try turning off the builds and going straight to using Github Action and the CLI tool.
That is… if you can swallow the price of LFS storage in Github. Oof! A little pricy. Might be that I'll need to use something else for the audio files.