Voice Over IRC

Never having seen it done before, I wanted to create a way to have audio discussion with people over IRC. My first idea was to use DCC to transfer 8-bit 8000Hz audio files to users. It turns out DCC is so, so freaking terrible; DCC simply does not work. You need to open up ports on all users' routers and hope that the connection doesn't drop. So with DCC off the list of ideas, I didn't know what else I could do...until I remembered about base64 encoded binary.

I created a python program called b64oirc. b64oirc provides a bot that acts as a "mailman". The mailman sits in the channel under yourusername_mailman. You tell the mailman to send a file to a user in the channel. The mailman waits until the receiving user accepts. The receiving user also has a mailman under their name. The user has to accept the file transfer request. Once the mail men see that the user has accepted, the sender preps the file and the receiver tells the sender it's ready. The transfer begins. I sent a 3 second gzip'd wav over IRC in about 10 seconds. Every message is 300ish characters because of server flood protection that will kick you. Every message is sent a second apart. The sending mailman tells the receiving mailman that it is done sending data, and it compiles the data together and gunzip's it. The receiving user was able to hear my voice, which said "I am one with the Internet." It was pretty awesome. 

If you'd like to try it out, you can find it at https://github.com/lf94/b64oirc. It's still a bit buggy and could probably optimize bandwidth a bit more, but it really was just a proof of concept. You can send any files over IRC with it.

A friend of mine mentioned XDCC. XDCC is an extension to the DCC protocol that allows reliable sending of files with DCC. It requires a bot setup too, but users usually request files from it, instead of users sending files to others. B64OIRC has a few advantages over XDCC:
  • Can be modified to be used with any text-based messaging system
  • Uses less bandwidth; IRC servers relay my messages to other users
  • More anonymous than XDCC
XDCC would be ideal for efficient peer to peer voice chat, but not so much for peer to many peers.

Comments

Popular Posts