Tuesday, July 14, 2009

Technical Trials: Recording Realtime Streaming Audio On A Mac

Much as I love the BBC, like a certain other three-letter entity, it does tend to move in mysterious ways. Or more accurately, downright mystifying ways. Take for instance the unfathomable policies on (not) letting the listener hear programmes online after the initial broadcast time. Some programmes are podcast, some you can listen to for seven days afterwards, and some are just buried in the dark and backward abysm of time, also known as the BBC archive. How I wish that we, the licence-paying public, could have access to what must be the world's richest treasure chest of sound. Yes, I know the licence only comes from TV owners now, but in the good old days, wireless sets (the size of tea chests) were also included.

As it is frustrating to complain about something without offering some kind of solution, I have a small and partial suggestion: record the audio stream on your computer at the time of broadcast and put it in your own archive (for your own personal use only).

On a PC, capturing streamed audio is relatively easy, but on a Mac it is another matter. Things reached boiling point this morning when I badly wanted to listen to a programme about the number of UK politicians being paid for from the public purse, but helping my wife with her final day of preparation before the dreaded GMAT exam was more urgent. I just couldn't get my MacBook to record the audio stream and had to give up and get back to the high-priority task.

But the days of lost streams are over now, because later in the day I was able to take some time off and figure out the mystery of real-time audio capture and what is more, I'll share the secrets with you. First I sent out a desperate SOS Tweet asking for suggestions for audio capture software. Within minutes, five people came back with three suggestions, one free and two not, but having trial versions. I'll deal with the free one first.

Audacity (suggested by @UncompletedWork aka Merrel Davis)
Audacity is free but has two important blocking issues that can be fixed (for free) with some effort. 1) It won't save to MP3 format and 2) it can't capture the Mac internal sound, which is where streaming audio seems to live (commenters may tell me I am wrong).

1) can be fixed by downloading the LAME MP3 encoder library (there's nothing lame about the code - it stands for MPEG Audio Layer III (MP3) encoder). The easiest way to do this is by going to Preferences > Import/Export - MP3 Export Library and clicking the Download button. Otherwise you can download the file from here - the download link is about half way down the page. When that's done and installed (by clicking the Install icon of the downloaded package), click the Audacity Locate button (also in Preferences > Import/Export), which seems to default to the right place on the Mac hard drive, namely /usr/local/lib/audacity/libmp3lame.dylib. (This last step may not even be necessary.) If you think you might need the FFmpeg library for audio in video encoding presumably, you can download this library at the same time - the section for doing this is just to the right of MP3 section.

2) can be solved by downloading Soundflower. After it installs, you will need to set Audacity to use the Soundflower output and (I think) set the Mac audio output to Soundflower. I may have overdone the settings - the speaker seemed to stop working unless one was recording in Audacity - so if anyone has better ideas, let me know in the comments below or tweet me at @juliandarley.

With this done, I was able to able record a snatch of Beethoven's Ninth - in fact the Ode to Joy, believe it or not. Possibly rather grandiloquent for such a small achievement, but more appropriate than Tosca topping herself I suppose (much though I love the opera).

If you don't mind a bit of fiddling and tweaking, this free combination of Audacity, Lame and Soundflower seems to work.

Next I tried Audio Hijack Pro (suggested by @PaulTRussell)
Audio Hijack Pro comes from the slightly worryingly named Rogue Amoeba. However, my sense is that this software won't increase your chances of being infected by any roving pandemics or epidemics. I downloaded and installed the trial version, which apparently will add noise to your recording after ten minutes until you pay for a registered copy (US $32).

As far as I can tell, Audio Hijack also uses Soundflower to re-direct streaming audio to the recording input of this program (again, someone let me know if I have misunderstood this). The main difference from Audacity appears to be that Soundflower is included and installed with Audio Hijack Pro. The program is able to do a lot more than just capture audio streams, including adding all kinds of effects. However, I don't need any of this (I don't think). I liked the fact that if you go to Quick Record, you can select which application (eg Firefox) you want to record from. Audio Hijack Pro has a library area in which you can see your recordings, which could be useful (especially if, like me, you are not all that fond of Finder).

This program clearly does the job, but if all you want is to capture the odd raw radio stream from time to time, then paying $32 may seem like a stretch.

Finally, I tried out the two WireTap products from Ambrosia Software (suggested by @PhilipSheppard, @IrfanHabib and @byrnegreen aka Chris Byrne). The main difficulty here is the price of WireTap Studio ($69) relative to the single, simple task desired and understanding the relationship with its earlier cousin WireTap Pro. My understanding is the following: WireTap was once free, then it became WireTap Pro, which will work in free mode, but will only capture in the AIFF format (which is similar to WAV in size - ie. it's very large). If you want to save in MP3 (as I do) you have to get the licensed version for US $19 or listen to a lady with a very miserable voice telling you every 12 seconds that your recording was made with an unregistered version.

However, to complicate the picture further, Ambrosia no longer supports WireTap Pro, though it did release a last final version for OS 10.5. I managed to track down this official URL and downloaded a trial copy from here. But with the same insistence of their lady announcer, Ambrosia make it pretty clear that they would much rather you bought WireTap Studio. When you install WireTap Pro you get a message and link that says there is a new version - but there isn't. The link takes you to ... WireTap Studio. I think this kind of message is misleading, especially if you have bought the registered version (for $19).

For completeness and following the beseaching of the sad siren voice, I decided to download and install WireTap Studio. Whilst doing this, I noticed that WireTap also seems to use the LAME MP3 library, but it's included and installed without user intervention (which is easier than with Audacity).

I prefer the new interface of Studio to Pro, and it also offers the chance to organise your library of recordings. The trial version of Studio lasts for 30 days, but appears to be a full working version. I like the fact that you can select two inputs at once, though I am not sure you can change the volume of either. A really nice feature of both WireTap Pro and Studio is that you can set the software to record in advance and for a definite time, which could be extremely useful if you have to go out hours in advance of a much desired programme and don't want to record everything before that (which I suppose in the worst case could cause your computer to crash). You will still have to leave your computer on and streaming - I have not seen a sleep state that automatically wakes itself up at a certain time and fires up requisite programs and streams. Maybe it's out there - do let me know, if it is.

Whether the extra horsepower of WireTap Studio is necessary for you will be a personal decision.

To sum up: for just the most basic job of recording live audio streams, Audacity (with Soundflower and LAME MP3) seems perfectly adequate. If you want the extras provided by Audio Hijack or WireTap or don't want the slight hassle of installing Soundflower and LAME MP3, then parting with somewhere between $19 and $69 will be the way to go. I hope all this helps you to listen to what you want or need to when you want to or are able to. It has certainly helped me mitigate (to some extent) the mysterious (though often wonderful) ways of the BBC.

@juliandarley

Thursday, July 2, 2009

Why Bother With Twitter?

An old friend of mine from graduate school in Texas wrote to me today to let me know that he had finally become a tenured professor (in Colorado). He was now looking forward to writing another book and, as he put it, professin'. Leaving aside the issues of tenuredom and academic freedom, the question I wanted to ask him, especially given that his area covers communications, was, Why don't you use twitter? He sends out daily emails of broad interest to a large number of people he knows, so why not share the love more widely? His answer was: give me some reasons to bother with twitter and maybe I'll try (again). This is my attempt to justify his bothering with twitter.


Firstly, and perhaps most importantly, twitter offers what is sometimes called ambient awareness. It's more like the sensation one has of being in a village or other community, and say bumping into someone on the street and having a three sentence conversation, or chatting to someone in a shopping queue or seeing someone in the park or seeing another parent when meeting your children from school. In Italy and Spain these kinds of events can happen in the piazza as well as elsewhere. In Britain we still have some pubs (public houses) remaining, which are actually designed to create accidental and one might hope felicitous rendezvous.


The kinds of conversations and interactions that are engendered by meeting accidentally are, I believe, actually of profound importance however they happen. It seems as if there is a part of the brain that actually needs and attaches special value to aleatoric (throw of the dice) or serendipitous meetings and messages. These events serve to reinforce existing message streams or introduce new ones and sometimes, perhaps surprisingly often, act as the capstone to action. That is, they are the final trigger that causes you to read that book, go to that cafe, ring that old friend etc. Even without the capstone tendency, any single tweet on its own is unlikely to be of overwhelming significance, but in context they start to add up and reinforce the virtual, physical and ideational worlds.


One of the reasons why twitter acts to build up social resonance is the act of retweeting, in which you rebroadcast a message to your circle of 'followers' that you have seen in a message from somebody else, either that you are following or that you have discovered by a search or seen in a hashtag web page (see below for more on hashtags). Even if the person you are 'retweeting' is not following you, they will see just that message and therefore will know that you are favouring their message. Sometimes that may cause that person to start following you, which is always pleasant.


I find that twitter works particularly well in concert with physical meetings. In fact, i would say that a lot of the meetings and events I now attend are the direct result of information and recommendations that come to me via twitter. In addition, because many people are happy to reveal their locations, via their iPhones (or similar) you can tell when someone you know is coming to town. Even if they don't enable that feature or don't tweet from a mobile (or cell) phone, many people announce that they are in a certain place or visiting something well known, such as the Louvre. If you are nearby and you spot this, you may be able to arrange a meeting.


Another vital feature of twitter allows you easily to find new interesting people and then see whom they find interesting, or at least whom they have decided to follow. Because you don't have to have permission to follow someone, it's a very fluid and effortless way of building an affinity circle. Thus it becomes an extraordinary way of finding ideas, books, thoughts, events that there is almost no chance of discovering on your own, especially as one may increasingly follow writers and doers of increasing eminence and also see the conversations they have (the ones they have on twitter, at least). Twitter also has the potential to make it easier for people with talent to get the attention of the world.


With twitter, it is much easier to help groups of like-minded people get together, either occasionally to create 'tweetups', or more regularly, such as the #Tuttle gathering in London, which meets every Friday to discuss in small ad hoc groups social media and anything else that catches the breeze.


Another interesting matter is that the twitter demographic is apparently mostly over 35 years old. If you are generally interested in serious discussions, especially about democracy, politics and philosophy, then given that research tends to show that in English-speaking cultures at the moment, people tend to become more engagé in the second half of their lives, then twitter is likely to be an increasingly happy hunting ground. Reinforcing this, it would also appear that twitter users are more likely to be progressive, which is likely to match the profile of many academics, including the one I am trying to persuade with this epistle.


Yet another way of finding information and people to follow is by looking at #hashtags web pages. These allow you to see messages from anyone who uses that hashtag, whether you are following them or not. For instance #reith2009 (http://search.twitter.com/search?q=%23reith2009) collects all the comments of those who are listening to this year's Reith lectures by American political philosopher Michael Sandel. Most of the comments are careful and thoughtful; some are even profound.


As further evidence against the case that twitter is merely trivial, it played a seminal role in the recent Iranian election and has surely proven the significance of microblogging. Twitter may not have actually changed the final outcome in Iran, but my goodness, it has got the attention of those in or around power all round the world, including, for instance, @GideonRachman, the Financial Times chief foreign affairs commentator, former Economist writer, and not an easy nut to crack.


In these ways and more, twitter has created access to an extraordinary and interactive body of people and knowledge. So I have asked my professor friend give twitter another try. To him I would say try letting your followers know what you are writing or reading, and if possible, say why (in my opinion, you can use more than one tweet for this kind of thing - there are no rules against chain tweeting).


My friend is a Dewey scholar and pragmatist, and I would like to think that pragmatists will appreciate twitter's practical value. Be that as it may, my twitter moniker is @juliandarley and I become further convinced of twitter's value with each passing day. I am also convinced that the sooner the academic world embraces the twitterverse and shares its wisdom more widely and easily, the better the state of knowledge of will be.