Recording calls through Google Hangouts in Audacity, using Soundflower

Unfortunately, people lie. Fortunately, recording a phone call with a lie can get one out of trouble later. It’s an ugly bit of reality, but since reason has arose lately to encourage me to record certain calls, I started looking into my options.

The ideal solution would be one that lets me record outgoing and incoming audio, during a call through google hangouts on my tablet. Since that solution hasn’t presented itself yet, I set about researching audio recording on the computer. The idea started as “Have phone call (send/receive); Give appropriate notification of call recording to involved parties; Have applicable conversation; Store in the event of contention later.” Easier said than done.

Hangouts will let you press 4 to record an inbound call, but only on a handset. So I can do this when Voice forwards to my handset, but not on the tablet. Bummer. I also can’t activate this when receiving a call on the Hangouts web-app. Final bummer: only works for inbound calls.

I’d tried Audacity to solve this challenge before, and had some success “recording” a call. Alas, the “recording” was just a recording through the microphone on the computer, thus “hearing” and “recording” the inbound audio through an “out loud” loop. One of many problems this presented was my talking over the other party whenever I spoke – and potentially losing whatever they had just said. Soundflower to the rescue.

Apparently the developer has moved around a bit, but I believe the idea behind Soundflower is to produce a kernel extension that creates another audio source/output, thereby creating a “middle-man” of sorts for redistributing sound. In my case, because I’m running Mountain Lion (OS X 10.8.5), I used the Google Code repository to source an older release, and installed 1.6.6b. After a restart, Soundflower 2ch and Soundflower 64ch appeared as Audio devices.

Using this StackExchange post as a good visual example of the developer’s instructions, I created a Multi-Output Device (M-OD for short) with Soundflower and Built-in Output as the selected devices. [This will distribute whatever sound enters this M-OD to both Soundflower and Built-in Output.] Next, I created an Aggregate Device (let’s call it the AD) with both the Built-in Microphone and the Soundflower (2ch) devices. [This will make the sound from both the Built-in Microphone and the Soundflower devices available as one input device.] Now, when loading a Google Hangouts session and starting a phone call, the audio input will remain as Built-in Microphone, but the output will change to the Multi-Output Device. Save the hangout settings during a test call, and it’s good to go.

Here’s what’s happening. Everything I say into the microphone goes two places: to the Google Hangouts input, and to the AD. [So the phone call hears me without issue.] The output from Hangouts goes to the M-OD, distributing it to both Soundflower (2ch) and Built-in Output. [I can hear the phone call through the Built-in output without issue.] The magic happens when the output sent from the M-OD goes to the Soundflower (2ch) device, which is also an input for the AD I created – and recall, the AD is receiving audio from the Built-in Microphone simultaneously. Thus, the AD is hearing both sides of the phone conversation (me in the Mic and the Soundflower audio from the M-OD, where hangouts sends its output).

Wrap it all up: Open Audacity and select the AD as the input source. The trickiest part is in the last part of Emu’s comment … Audacity must be set to record all four channels available in the AD. Two channels will be from the microphone, and two will be from the hangout (each source is stereo, so a left and right from each). Press that record button and launch a call from Google Hangouts (don’t forget to select the M-OD as output for the hangouts call).

As an extra bit of goodness, this solution should be “backwards compatible.” (In quotes because it’s more back-out-ness compatible.) If I don’t want to record, all of the sound still goes where it needs to, and there’s nothing broken by not recording. I just don’t tap off that available feed from the AD.

Next I’d like to find an android app that can record both sides of the audio in Hangouts…

Posted in Uncategorized | Leave a comment

Python Sheepsheet: The simplest way to add a path to your PYTHONPATH in OS X

One day as I was writing python, I grew weary of trying to copy and paste code into the IDLE shell. So I attempted to import the module I was writing …

>>> import pussinboots

Traceback (most recent call last):
File "<pyshell#95>", line 1, in <module>
import pussinboots
ImportError: No module named pussinboots

“What do you mean? I just had it, I was just writing it a moment ago – heck it’s right here!” Then I learned about default paths and system paths and PATH and $PATH and PYTHONPATH. So, since I was on a Windows 7 computer, I used setx to add my working directory to the PYTHONPATH. Hoping for a similar solution, I combed the internet – mostly stackexchange – and found no BASH/scripting/Command Line solution.

In the process of learning all that stuff about the os module and os.getcwd() and os.chdir(), I just figured I’d keep importing os each time I needed it, until I found a programmatic approach I could use with all future mac/linux installs. [The idea is to maximize the reuseability of the everything, including the environment. Since I figure I’ll have to change computers at some point (things break, get reformatted, or I just move to another machine), I’ll keep a list of setup commands to reset my environment to as-close-to-how-I-like-it, and keep working with minimal overhead/downtime. Having figured that out with Win7, I just figured it’d be just as feasable (if not more so) in the mac/linux universe.

I quit looking when I found something easier.

Knowing that messing with the internal Python on which the OS was dependent, I was a bit wary of system-wide commands – and by extension, something executed as Admin in Terminal. I was poring through StackExchange (both SuperUser and StackOverflow) and came upon this question, where the asker is trying to do the same things as I (import modules from a non-default directory). However, the OP wants to add the directory in question to his Python path. (As did I.) Not understanding the primary upvoted answer [and being hesitant, as I said, to alter system-level variables], I kept reading, and the currently-third answer nailed it for me: just change the parameter within IDLE.

The rough concept is to change a parameter, loaded by IDLE, at time of loading. IDLE looks in the file to initialize a few variables – one of which is the path(s) to use when searching for modules to import. By adding sys.path.append("/Users/Me/Documents/PyProject") on the line directly under os.chdir(os.path.expanduser('~/Documents')), IDLE now knows to search my PyProject folder for modules.

Yes, I wanted something smooth and elegant and all CLI-ninja-esque. But this just works so much more easily.

Note that if you want to replicate my results, you’ll need to change the path to be the one that leads to your project… as I will do with future projects. And for the record, this is using IDLE 2.7.10 on OS X 10.8.5.
Posted in Uncategorized | Leave a comment

Python Sheepsheet: Opening and reading a text file.

Next on the list of simple stuff not to forget: Opening and reading a text file.

Matasano Set 1, Challenge 4 includes a text file to read from. The most Pythonic way to read the list from the text file I have found was excellently simple:

f = open( “filepath” )
filedata = list( f )

Wow, was that easy. I gotta remember that one. Oh right, I’ll write about it.

Posted in sheepsheet | Tagged | Leave a comment

Python: IDLE 2.7.10 keyboard shortcuts on mac (OSX 10.8.5)

I’ve been working my way through the first set of the Matasano Security Challenge. In the process, I’ve been [re]teaching myself Python, and getting back into “real” code. One of the hurdles I’ve faced has been the disparity of documentation among Python versions, and even installations. I chose Python for the MSC because I hoped it would be device- (and OS-) agnostic. While it is to some extent, the mac comes with Python installed, and it’s a bad idea to mess with the internal OS-level functionalities.

With that in mind, I downloaded Python 2.7 and 3.4 (with IDLE for both). I chose to use 2.x, as the documentation for 2.x should be plentiful. Plus, since I’ll already have to wade through information that may be older, I’d like to take advantage of some of the clues I might get from older posts without having to mess with syntax changes of a major revision. One of the first problems I encountered was trying to figure out some keyboard shortcuts. The answer seemed simple: just look in Options / Configure Python. Except my “Options” menu only showed “Configure Extensions”, and it was grayed out. (I don’t have any extensions for Python installed.)

This would prove a recurring issue. Many times the answer centered around “Just change the configuration in Options.” and yet I had no way to do that. So, in the future I’ll discuss how I changed the font and size for my IDLE windows, but the most helpful thing was the keyboard shortcuts. It would appear that by looking in the menu for IDLE that I could use “Control”+”3” to comment (for example) – as “Control” is denoted by the caret in the shortcut key column of the menus. Strangely, until today, it required pressing both “Option” and “Control” keys.

The timing was perfect though, as today I was looking up how to reuse previously entered commands in the IDLE GUI, and found the answer on StackExchange. While bash lets me use the up/down arrows, IDLE will review previous commands with “Control”+”n” or “Control”+”p” (for next and previous, respectively.

I’m going to try to list things that I find helpful – so that I can look them up if the time comes when I forget… but also to share what was useful to me with anyone else who stumbles across the info here.

Posted in sheepsheet | Tagged | Leave a comment

Regularity: it does a blog good

Well, the desire is to post weekly – but that hasn’t been happening. So I guess I’ll give it another go, and try for bi-weekly. Hopefully the decreased frequency will make content creation easier. I also hope that I’ll be able to lower my own expectations of the awesomeness of the posts, and thus actually do this.

Regularity. It’s good.

Posted in Uncategorized | Leave a comment

1001 Dates – Idea #1 – Farmers Market

Date Idea #1: Go to a Farmers Market

Buy some fruit?

Is it “Farmer’s”, “Farmers'”, or “Farmers”… who cares? Farmers Markets can be a blast. There’s minimally a variety of fresh fruits and vegetables, which can be purchased if part of the date includes a meal later. Vendors may also offer samples of their wares, which can I’ve seen include honey, watermelon, specialty relish, hot peppers, herbs, tortilla chips, dips, perfumes and ointments, cupcakes, and drinks.

Farmers Markets usually vary with the season, so this gives you the option to return again in a few weeks or months to see something different. You might be able to get produce cheaper than the grocer, and there’s more than just produce. We’ve bought carnivorous plants and herbs, seen butterfly gardens, and some of the larger markets even have food vendors. Funnel cake, anyone?

Posted in 1001 Dates | Tagged , , , , | Leave a comment

1001 Dates – The Idea – One Thousand and One Ideas for You and Your Date


A while ago I was dating my wife. I wanted to look up date ideas on the internet. That’s a terrible idea. “Tastes vary wildly” is an understatement. YMMV, and then some. So of course, I decided “I’ll solve this!” Also potentially a terrible idea. But I’ll give it a go.

So here goes nothing… 1001 Dates: Ideas For You And Yours To Do Together…

The List:

  1. Go to a Farmer’s Market
Posted in 1001 Dates | Tagged , , , , | Leave a comment