Thursday, June 11, 2009

Real Time Voice Streaming for Google Android - Part 2 [Technical Details]

To stream voice, fundamentally, we need the following components.
  • A method to obtain PCM audio from the Mic and store it in an in-memory buffer.
  • A protocol suitable for transfer of real time data - RTP in other words.
  • Some kind of signaling protocol to negotiate the call. (Eg: SIP, XMPP/Jingle).
  • A codec to optimize the data transfer format. (Eg: Speex).
As far as the Google Android platform is considered, until recently (Android SDK 1.1 and lower) did not have the first capability. Android 1.5 still does not have an RTP stack, but I have ported a small but functional Open Source RTP stack to the platform. As for signalling, SIP and XMPP/Jingle, I feel have too much overhead. Since both peers will be utilizing my client, a stripped down negotiation protocol would be more efficient. This is where XMPP comes in. As you may know, XMPP is XML based and is widely used. Hence, we can build a small but fast call negotiation protocol over XMPP, given that the parties are logged in via their Jabber accounts.
One may think that this won't inter-operate with existing infrastructures. This is true. To have that capability would translate into unnecessary complexity at this stage. Integration with existing systems is future work as of now. :-)



Another point is that trasmitting raw PCM over the internet is not a very efficient design choice. For this, we need some kind of Codec that will provide us with compression, decompression etc. the Speex codec is Open source and available in Java as jSpeex. It is simple to use.




I will be approaching this project in the following manner.

1. Write PURE java code and test my ideas and algorithms on a Java applet.
2. Port it to the Android platform.


Real Time Voice Streaming for Google Android - Part 1 [Intro]

Your first thought might be, "Hey, isn't that already available with Skype?". Well, yes and no. For starters, to use the Skype services, ALL features may not be free depending on whom you contact. Secondly, you need to create a specialized Skype account to use their services. What I intend on doing is to utilize existing Google Mail and Jabber IDs to build a P2P voice streaming application for the Android platform(and maybe others, but for now, lets narrow it down). You don't have to create a special ID to use the service. Just login via your already existing GMail or Jabber IDs and start talking!!!