Bluetooth, LineIn, Soundflower: talking over Skype and playing music

Someone who wants to teach dance classes online asked me if there was a reasonable way (i.e.., without spending a lot of money) to set up a Skype link that can be used for both music and a wireless microphone setup.

The plan is to put something together that allows her to

  • Get far enough away from the camera that she can be seen head to toe (being able to see the footwork is important) and with a wide enough angle that she doesn’t have to dance unnaturally in one spot.
  • Send iTunes output and her voice over the line at the same time to one or more people,  in sync to the music.
  • Have some kind of a wireless mic to be able to communicate to her students without shouting.
  • Be able to hear her students talk back without their hearing their own voices delayed, or her hearing her own voice, delayed.

This turns out to be more complicated than it might seem. The iSight camera doesn’t work very well for this; its field of view is quite narrow, and it’s very difficult to adjust it so that it pointed properly on top of that. This was relatively easy to solve: a Logitech HD Pro 920 works fine for both the wide-angle and head-to-toe issues; it can be mounted on a tripod (it has the necessary threading to mount on a standard photo tripod), and after an upgrade to a more powerful laptop – her 2008 MacBook Air was just not cutting it! – the video issue was solved.

The audio issue was thornier. Originally, I hit up Sweetwater Sound for a real wireless mic setup; after realizing this was going to be well north of $300 once I got the mic, the base station, and the computer interface to actually hook it up with, and that this was going to be a lot of different hardware issues to deal with as well, I decided I’d better scout around for a better option.

I was stuck until the instructor suggested a Bluetooth headset instead. It’s a reasonable, good-enough audio input channel at 8KHz – she wants to talk across it, not record studio-quality audio, so a little bit tinny is OK – and it’s definitely wireless. After a bit of investigation, I settled on the Jawbone ERA as the most-likely-workable option. The ERA is light, small, fits tightly (important for a dancer) and is the current best headset suggestion from Wirecutter, who I have learned to trust on stuff like this. It’s easy to connect a Bluetooth headset to OS X (getting it to talk properly to the software’s a different issue, see below). This takes a lot of hardware complication out of the way. Skype supports Bluetooth, so I thought I’d solved the problem.

Unfortunately, an audio test with the music and voice both going through the Bluetooth mic showed me I’d have to get more creative; the music was either inaudible or distorted (that 8KHz bandwidth made it sound hideous, when you could hear it at all). It needed to be audible and undistorted if it was going to be possible for a student on the far end to use it to dance along with.

A lot of Googling finally led me to thisevilempire’s blog entry on how to play system audio in Skype calls on OS X. This got me part of the way: I had, according to tests with the Skype Audio Tester “number”, gotten the audio to play nicely across the link, but I was getting a half-second delay of my voice back on the same channel, which made it hard to talk continuously. Not good enough for an instructor.

More searching found a post on Lockergnome spelling out how to transmit clean audio, overlay voice,  and hear the returned call without an echo. Here’s how:

  1. Install Soundflower and LineIn, both free.
  2. Make sure the Bluetooth headset is on.
  3. Open the Sound preference pane in System Preferences.
  4. Set the
    1. Jawbone ERA as the input device
    2. Soundflower (64ch) as the output.
  5. Duplicate LineIn in the Applications folder, and rename both copies: one to “LineIn Bluetooth” and the other to “Bluetooth System”. The names aren’t important; this just so you can tell them apart.
  6. Launch both copies of LineIn. You’ll need to drag one window aside to reveal them both; they initially launch in exactly the same spot.
  7. Choose the “LineIn Bluetooth” instance in the Dock, and set
    1. Input to “ERA by Jawbone”
    2. Output to Soundflower (2ch).
    3. Click the “Pass thru” button.
  8. Select the other instance, “LineIn System”, and set
    1. Input to Soundflower (16ch)
    2. Output to Soundflower (2ch).
    3. Click the “Pass thru” button.
  9. Run Soundflowerbed (installed in the Applications folder by the Soundflower install). In the menu bar, click on the little flower icon, and
    1. Select “None” under Soundflower (2ch)
    2. Select “Built-in Output” under Soundflower (16ch).
  10. Run Skype, and open its preferences.
    1. Select “Soundflower 2ch” in its Microphone pulldown, and leave everything else alone.
    2. If you have an alternate camera attached, switch the Camera pulldown to the appropriate camera.

You should now be able to make a Skype call, and play music from iTunes, DVD Player, or Youtube over the wire at full fidelity, and talk at the same time. You should hear the far end’s voice on your  speakers, along with the music you’re sending across (undelayed).

Try to keep the headset away from the speakers to minimize the chances of feedback.

It’s not all that  difficult; it’s just the tricky bits of being able to reroute the audio internally via the two LineIn instances and Soundflower. Getting those tricky bits right is the difficult part.

I’ve tested this with the Skype test call and it seems to have worked; the big test will be the full-up video camera plus the streaming audio. We’ll give that a shot soon and I’ll follow up on whether the Bluetooth mic is good enough, or if a better mic is needed.

Update: Undoing the process!

It’s necessary to restore the normal audio routing after the call; you can do this with System Preferences.

  1. Open System Preferences and select Sound.
  2. Set Input to Internal Microphone. If you’re wearing the ERA, it will make a little descending bleep to let you know it’s been disconnected.
  3. Set Output to Internal Speakers.
  4. Quit both copies of LineIn.
  5. Check the Soundflowerbed menu; it should have both Soundflower 2ch and SoundFlower 64ch pointing to None. Quit Soundflowerbed.
  6. Turn off the Bluetooth headset; put it on its charger for a while.
  7. Quit Skype.

You should be all set.

This entry was posted in Programming and tagged , , . Bookmark the permalink.

Leave a Reply