ThemeSong AIR App: Adobe AIR and Bluetooth

Recently, a co-worker of mine, Val from thisisportable.com, showed me a great use of a free Bluetooth server and Flash.  Some of you may have seen the server in action at FITC Amsterdam.  The server is called Roomware.  It is a free Bluetooth server that will run on your Mac or PC.  After brainstorming a bit we came up with the idea of a ThemeSong server.  Basically, we thought it would be awesome to walk into a room and have our own theme song be played.

After some work, I have an initial release of ThemeSong available fo those interested in using it for themselves.  ThemeSong is written in Adobe AIR and leverages the Roomware Server in order to detect Bluetooth devices in proximity.  ThemeSong provides the ability for you to remember devices (mostly phones) and to assign entrance and exit theme songs that you would like to have played when that device is present (discoverable) or absent (undiscoverable).  My distribution of the Roomware Server uses a modified config file to make the server poll the list of devices more often than it does by default.  You will however, be at the mercy of your computer’s hardware limitations for the number of queries it can do in a given amount of time.

Enough Talk – How Do I Install this Thing?

What You Need:

  • A computer with Bluetooth capabilities (most Macs have this built-in these days – you can try a Bluetooth dongle though they seem spotty with the Roomware Server)
  • Bluetooth devices to detect (your cell phone with the Bluetooth on and set to discoverable)
  • Some MP3s to assign to devices
  • Some speakers on your computer
  • If on a PC you may need to install a JRE
  • The Adobe AIR Runtime
  • Download ThemeSong with the bundled Roomware Server

How to get the Roomware Server Running:

The download consists of a zip file containing both an .air and .zip file.  Please unzip the roomware-server.zip to a folder on your desktop or somewhere you will remember the location.  This should give you a folder on your desktop called roomware-server.  Inside of the roomware-server folder there is a README that will let you get the Bluetooth server up and running using the Terminal or the Command Line.  Once the server is running you should see it processing any Bluetooth devices in the area.  Below are screenshots of what you would need to type to get the server running on your Mac and PC:

Installing and Using ThemeSong:

Next, install the AIR application and press connect.  It should query the devices in the area and eventually assign the Friendly name to them in the list.  You can click a device in the list and pick and entrance and exit mp3 sound that will play when that device is seen (someone walks within 30 feet of your computer with their phone) or goes away (someone leaves the area with their phone).

The mp3 is copied and stored by ThemeSong.  ThemeSong does what the name implies.  It plays the ThemeSong assigned to a device.  Make sure to hit Remember This Device’s Settings to store the info and to remember the device for when you run the server later.

Configuring The Server
The default update time for the Roomware Server to poll for new and absent devices is a bit high for an application like this. To make it function more quickly you can edit the roomware.conf file within the roomware-server > conf folder. You can play around with the two lines that look like this:

bluetooth-update-interval-time: 2
bluetooth-device-clear-time: 5

You should be able to tweak these and get the performance you are looking for.

Conclusion

I hope you enjoy ThemeSong.  It has been a lot of fun in the office to hear the Imperial March play whenever I walk into the room.  This was a proof of concept we wanted to do so please don’t take it too seriously.

Just like the Roomware Server, this software is released as follows:

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

21 Responses to “ThemeSong AIR App: Adobe AIR and Bluetooth”

  1. Lawrie Says:

    I wish my computer had Bluetooth as I’d love to try this.
    It’s a great inventive use of the technology and a really interesting way of doing a proof of concept.
    I looking forwards to see how other people use the Roomware server too.

  2. ScreamingKettle Says:

    Brilliant!
    I’ve just had an idea… do bluetooth devices have a unique ID like a MAC address? You could have an AIR app to log the IDs of any unknown bluetooth devices that come within range, which then get uploaded to the interweb, which also triggers a security camera. Has this been done already?

  3. Den Says:

    D00d you blow my mind. So cool. I want oFortuna as my theme song. Or Send in the clowns. I haven’t decided.

  4. bobbb Says:

    love it! any chance of the source? :)

  5. Ben Says:

    Sorry – ThemeSong is closed source at this time. I may open it in the future though, so stay tuned.

  6. bobbb Says:

    well i tried running it and it wont save the settings so i get no audio playing :(

  7. joshua Says:

    ben- i appreciate your ideas and willingness to share interesting experiments in Flash. very Keith Peter’s like- stay curious!

  8. Gerry Says:

    After trying this with my Razr phone I found the service to be too slow. I’d leave the room and a minute or so later music would start playing. I don’t see anywhere to add settings for sensitivity or to change the cycle that the server checks for devices.
    I also had problems changing the original songs I selected.
    I’ll watch this space for updates to this app but for now it’s been deleted.

  9. Ben Says:

    LOL well, sorry to hear that you deleted my experiment. There are definitely limitations with the Razr hardware as we tested with them a bit too. Also, there are certain hardware specific limitations to the bluetooth hardware installed on different computers (some can only poll about every 10 seconds). You can mess with the config file in the Roomware server but it sounds like this might not be the app for your needs.

  10. Ty Says:

    Hi, I know this does not relate to your product but does anyone know why this is failing to launch (roomware)

    C:\roomware-server>bin\run.bat
    “”;lib\bluecove-2.0.2.jar;lib\Communicator_Console-1.0.1.jar;lib\Communicator_Ht
    tp-1.0.2.jar;lib\Communicator_Post-0.0.1.jar;lib\Communicator_RoomWare-0.0.1.jar
    ;lib\Module_Bluetooth-1.0.1.jar;lib\Module_Fake-1.0.0.jar;lib\Module_RoomWare-0.
    0.1.jar;lib\RoomWare_Server-1.0.2.jar;lib\RoomWare_Server_Impl-1.0.1.jar
    ‘java’ is not recognized as an internal or external command,
    operable program or batch file.

  11. Ben Says:

    Ty, did you make sure you have the Java RTE installed?

  12. Ty Says:

    Hi Ben, thanks for the response, I have just re-installed it to make sure though the same problem persists, I am thinking possible a problem with Windows 64bit? im not sure

  13. Ben Says:

    Ty, hrm – unfortunately that is not something I can test. I would just verify that you have the Java RTE installed (or re-installed) and check that roomware doesn’t have any conflicts with the 64-bit OS. Sorry you have had trouble with it!

  14. Bite-sized knowledge snippets from SXSW | No passengers Says:

    [...] Create your own theme song, which plays every time you come into the room where your blue+tooth enabled device detects it: http://blog.pixelfumes.com/?p=232 [...]

  15.   links for 2009-03-27 — contentious.com Says:

    [...] Pixelfumes Blog » Blog Archive » ThemeSong AIR App: Adobe AIR and Bluetooth "After brainstorming a bit we came up with the idea of a ThemeSong server. Basically, we thought it would be awesome to walk into a room and have our own theme song be played. [...]

  16. Asheerq Says:

    will try it
    must be
    thanx man

  17. Pixelfumes Blog » Blog Archive » Speaking at Spring Conference 2009 Says:

    [...] AIR applications that people use everyday. This session will also include an overview and demo of ThemeSong, an AIR application that leverages an open source Bluetooth server and AIR. Make sure to come to [...]

  18. pligg.com Says:

    ThemeSong AIR App: Adobe AIR and Bluetooth…

    Recently, a co-worker of mine, Val from thisisportable.com, showed me a great use of a free Bluetooth server and Flash. Some of you may have seen the server in action at FITC Amsterdam. The server is called Roomware. It is a free Bluetooth server th…

  19. Pixelfumes Blog » Blog Archive » Spring Conference Wrap-up Says:

    [...] Intro to Adobe AIR 1.5: Presentation slides (swf – use left and right arrow keys to change slides) ThemeSong AIR Application [...]

  20. Andre Dickson Says:

    Hey Ben! I left a comment on your other blog but figured i better leave one here too. This is a great app. I’m very impressed that you took a cool idea and turned it into a reality. I was using this for a time and then I started getting the same issue as Paul (said he was having trouble saving songs on Windows Vista). I noticed that some other AIR apps seemed to be having issues saving local data. These worked before so I assume there was a Vista update or some kind of system setting that’s causing the issues. I looked into it and found that the XML file that stores the devices and settings was empty. I deleted this and restarted ThemeSong and am now seeing the devices being written into the XML file. I noticed that you can “Remember This Devices Settings” multiple times and create multiple entries for a single device, even if no song has been selected. This makes “Forget this device” not work properly too. I also noticed that the entire XML is stored in the applications memory and is then being written into the local file. I don’t know what advantages or disadvantages there would be to doing this but it seems to make sense to dump that information from the app when the user remembers the device and then go back and read the local file again afterward so that what is in the local file is like the master list. Thanks again for putting this together, I hope you can find time to update it for the hungry masses.

  21. Ben Says:

    Andre, hey thanks for all of the investigative work. This was really a “just for fun” app and I really didn’t put the kind of effort into it that I would for a commercial release. I don’t have Vista so I never tested on it. Thanks for playing with it though!

Leave a Reply