Realtime Voice chat between iOS devices in same network - ios

I'm working in app where I need to implement a simple voice functionality between two iOS devices in same network.
My doubt is about how to get audio units from master device and send over wifi or bluetooth network directly to slave device in realtime.
Some things about network communication I have done, I can transfer any NSData between devices using TCP.
Is very important to not use GK framework, because I need to connect two clients without any notification. For example, when I use GK to connect two devices, the iOS display a alert with a connection request, I need to avoid this connection request.
Currently I can do this with video, is more simple than audio.
Any ideias about the implementation of this are welcome.
Thanks.

First of all, you need learn how to capture the audio using Audio Queue Services.
Then transmit the audio data it over wifi and bluetooth and play it at the other side.
The most obvious choice for you is to use bonjour.
GameKit framework is built on top of this. You dont have to build too much on top of this for your application though. Yours is a straightforward application of bonjour.
Please refer the code for chatty if needed. Incase you need some background theory, please refer to http://mobileorchard.com/tutorial-networking-and-bonjour-on-iphone/.

I have used Audio Queue Services for the same sort of project.
For Networking I am using Bonjour and it has really solved the problem of transmitting text and video.
Did a lot of workarounds to make a voice chat in wifi using Audio Queue Services but have not succeeded. I will update once I find the solution other than this.

Related

Audio Stream WiFi to WiFi - Broadcast

I have a requirement for an IOS app where a user will start the app, records an audio speech (via device microphone) which would be broadcast to other user on the same network, all this has to be live over wireless connection(WIFI).
I did some research for possible solutions and also tried audio streaming via HTTP URL, but it was not feasible and also involves internet.
I'm looking for your opinions and if it's doable then what is the right approach, (what libraries and API's should I look for)
I'm novice to iOS development, i would really appreciate if you could explain in detail.
Thanks in advance.
Yes, it is doable. You will need two major components: A network API to send/receive data , and audio capture and playback API.
For network library, you can try CocoaAsyncSocket. It is quite simple to use.
You can use UDP protocol with multicast address. Even thought you said you wanted to broadcast, but you would be better off using multicast ( send to a group of devices).
For Audio sample how to capture and playback, check out my answer on this .

Audio Chat + Data Stream Library for iOS

I want to build an iOS app that streams audio and some additional custom data between two users real-time. This is possible using GameKit if people are on the same network, but I haven't been able to find an SDK that can do this across the world.
Does anyone know if there is an existing service that does this?
If not, what services do you recommend for doing these two things (streaming audio and streaming data) separately?
Thanks.
WebRTC (www.webrtc.org/) has support for iOS (for audio streams, video promised later). But anyway in order to support communication for peers behind NATs - you will need your own sans, stun servers...
After looking into it, it seems that QuickBlox is able to do everything I need.

Network sniffer on iOS

I need to do video streaming to iPhone.
However, I don't have a homebrewed application playing the H.264 stream yet.
I have to understand first, how much delay there's for iPhone to receive the first packet/frame.
Anyone knows how to get some "sniffer" like WireShark on iPhone? Is it possible at all?
You can configure Fiddler as a reverse proxy and monitor the traffic from mobile devices. I don't know if this will do exactly what you want (I haven't done it in a long time) but the company I work at has analytics products for the various mobile platforms and that was the method we used to monitor their network usage.
http://www.fiddler2.com/Fiddler/help/reverseproxy.asp

How to connect an iOS device to a custom USB device?

I'm developing a custom electronic device - think of it as a special kind of data logger, and I need to connect a computer to it to configure it and to extract the data.
I know I can do this without too much trouble on a PC, but I'd like to use an iOS device to do this.
Two questions:
Can I do this with a regular dock connector / USB cable? Will the EA framework let me do all the communicating?
Once I have extracted the data, what's the best way to get that out of the iPad? Make an email with it, save to a dropbox or something?
Thanks!
Afaik, you need to join the MFi program to make USB accessories for iPad/iPhone. That will give you all the technical resources needed.
As for data transfer there are only "opinions", I say the more options of sending, the better. Just don't force the user to choose more than once, then make it changeable in settings.
If you're doing very light communication, you might be able to get away with using the headphone jack.
Apps communicate to the headphone port through the various audio frameworks on iOS. AVFoundation is a high-level abstract framework to do various audio operations, but for fine-tuning the communication to a device over this interface, you will likely be using the C-language callback-based Audio Queue Services framework to do audio I/O.
This is nice because your device can be cross-platform (iOS, Android, Mac/PC) as long as you write the corresponding software, and because you don't need to go through Apple's MFi approval program. Think like the Square credit card scanner.
You will have to write the communication stack between the device and your iOS device but yes, you can.
there's very few docs about using the EA.framework. All the juicy parts are in the Mfi program but Apple is very strict about giving access to it.
So if you succeed, sharing a tuto will make you a EA hero ;)
About sharing your data, imho, email + CSV is a winning combo.
If you want to plug something into the dock connector, you want to have a look at https://developer.apple.com/programs/mfi/

Iphone as a start button

I would like to develop an (personal) iphone app to use the iPhone as a controller for a small device such as a fan or for example a light bulb. Does anyone know if there is some kind of controllable iphone-dock to use for something like this. And are there some kind of methods to use with such a dock? For example the fan just needs a variable voltage for different rpm.
Thanks in advance,
EAAccessory requires that you become a Apple hardware partner, which is very expensive and not easy (this is why you only see large companies releasing hardware accessories for iOS devices).
There's a few ways around this. The easiest way is to have your app send OSC signals over WIFI to an OSC server. I've set this up before using TouchOSC on the iPhone and an Arduino connected to my desktop via USB. It's not hard at all, but it requires that you have an Arduino connected to a computer; it's not ideal.
Alternatively you can use audio output to send commands over the line output in the iPhone's dock connector, effectively turning the iPhone into a software modem.
Good luck and if you get this figured out, post the code on github. :-D
EAAccessory framework might not be what you want because of the requirement for you to have the license and hardware. You could better implement some sort of small webserver that runs an arduino or something similar. check this out for an example of that. on the arduino, you could just have a 5v relay to control the switch of whatever device and have the other pins of the relay connected to a hot (or cold depending on the relay state) standard 120v plug so you can plug anything into it. here is a good project for arduino controlled relay
for direct serial control, you could do something like this but it would require being jailbroken. i think for a personal app, doing it via wifi would be the best way unless you jailbreak and install the full bluetooth stack where you do not need EAAccessory stuff
Check out EAAccessory Framework. Used to handle external devices.
You could try using an ultrasound detector attached to your device, and playing an audio file at the appropriate frequency etc. on the iPhone.

Resources