by Benjamin King
11. February 2010 14:13
Our First Open Source Project
The project is an audio driver that connects the iPhone audio system, using the Audio Unit API, to the PJSIP framework (also open-source). It's primary propose is to provide Voice over Internet Protocol (VoIP) using the PJSIP framework on the Apple iPhone platform.
The iPhone SDK has a couple of audio API's. The choice of Audio Units gives very low-latency audio input/output in near-real-time. Audio Units are the lowest audio layer available in the iPhone SDK. In addition to this, Apple has supplied the Voice Processing I/O Audio Unit which provides acoustic echo cancellation! We take for granted the fact that we don't hear ourselves (an echo) when talking on speakerphone.
In the iPhone, the speaker (used in speakerphone mode) and the microphone are in very close proximity to each other. (They're both on the bottom of the device.) This can easily cause feedback, or an echo, when the microphone picks up sound coming out of the speaker. Consequently that sound gets sent back to the caller who now hears an echo of his/her voice. The echo is so bad that some VoIP software providers opt not to support speakerphone on the iPhone device.
Another major component of this echo cancellation capability is the ability to remove system sounds or alerts. For example when you are on a phone call and the device plays an alert tone that may or may not have come from your application. The voice processing unit removes the alert tone from the audio input, and the person you are talking to does not hear it at all. These noises are normally impossible to dampen, as they originate outside the pjsip audio stack.
By open-sourcing, we hope to promote VoIP on the iPhone platform, and a broader collaboration from both the iPhone and PJSIP communities. We encourage others to contribute by providing ideas, solutions and improvements by way of bug fixes, performance improvements, added features and thorough testing beyond our own application environment. Because of the BSD-license any iPhone developer will be able to use the work, including commercial apps. We hope this equates to more interest in the project, and more active development from a larger audience. Ultimately, we want to encourage open collaboration and provide the best user experience for VoIP on the iPhone platform.
http://code.google.com/p/pjsip-iphone-audio-driver/