Friday brought the fantastic transcript of the interview with Joe Kinnear. I’ve got no interest in football but seeing the interview one just had to marvel at how fantastic it is. Such idiocy.

So of course Jemima Kiss had to move on and create a Wordle cloud. Oooh, ever so sweary. But at lunchtime I had the sudden realisation that I could take it yet a step further, pointlessly but with fun, by getting the computer to read it out.

That’s because Apple machines have a text-to-speech facility, and comes with different voices – mens’, womens’, mad ones.

And what’s more, you can write Applescripts (programs using an English-like programming language) that will get it read out.

So here’s what happened when I realised I could do it.
1) Go to interview.
2) Copy interview into text window (using Tex-Edit Plus):
-remove double paragraph marks
-turn each paragraph mark into “,” – the latter step needed so that each part of the conversation would be turned into something like “SB Me.” (Where SB is the name of the person talking.)

Now it needs to be turned into what Applescript calls a list – that is, something that goes {“1”,”2″….}. So I turned the interview into a list. Why? Because I realised that I could step through the list, and get the computer to speak each item; and the initials at the start of the item would tell you who was speaking. Each item would be a sentence.

You’d have a repeat command, having started with a list – call it thelist – with each of the sentences from the transcript. The first word of each sentence (VK, SB) would tell you who was speaking, and so which voice to use. (For Kinnear I used Alex, the new voice in Leopard, as it’s much more realistic than other ones.

OK, but how to record it? There’s an output command for say, but as I was doing it as a repeat loop, that would create lots of little files. I needed to just have it said and record that.

Hello, Audio Hijack – which I see now isn’t available anymore, but it’s pretty cheap for what it does: grabs audio from any application.

Audio grabbed: creates a 85MB AIFF file. (Time taken: 8 minutes.) Then I needed to convert it to MP3. Quicktime Pro can do that! Except that when you look at the export options, none seems to be “export as MP3.” Grrr.

So: Amadeus Pro, which I have left over from converting some records ages ago. Nice simple “convert to MP3” in the “Save As” menu. Hurrah! MP3 generated. (Time: 1 minute.)

Which only left the trivial problems of getting the audio loaded on to the Guardian system, and a blog written.

Looking back, it seems like a lot of work – but it took only 24 minutes from pasting in the text to having the audio ready for output. That includes twiddling the script to get the right voices, and trying to figure out how to turn the sentences back into sentences after I’d taken the first word off. (The secret lay in Applescript’s text item delimiters, possibly the single most useful thing in Applescript text wrangling once you wrap your head around them.)

As journalism? You be the judge – the result is at this blog post.