Question

I got a requirement from One of my client is that We have to say some thing in the iPhone mic and that sound (Which we have speak in the mic) has to come from the iPhone speaker simultaneously(Without any delay.).

Example: In the open meetings if the speaker say something in the mic,that sound comes out from the speakers without any delay. I have to do the samething

We have to do it using Objective-c. I have been doing research since last one day. Could any one please guide me how to do this.Any ideas/suggestions could be very grateful.

Was it helpful?

Solution

If you have any experience programming with audio in iOS it's not that difficult, but if you've never programmed anything like this prepare to read some considerable amount of documentation.

What you need can be achieved using Audio Units. There are some Apple's examples, like Audio Mixer.

In short, Audio units are little pieces that you connect together to create an Audio Graph. You need to connect and Input Audio Unit routed to the microphone to an Ouput Audio Unit routed to the speakers.

At this point, it's hard for me (and for anyone) to say anything else on this subject that is not in the docs. Maybe when you make some progress your questions will be more specific.

OTHER TIPS

Zero delay is not possible. The minimum Audio Unit buffer latency on most iOS devices in 5.8 milliseconds; and there is no faster public API connected to the mic or speaker.

If latency of that order is acceptable, then try using the RemoteIO Audio Unit for audio record and play, and request the minimum buffer time and size using the AVAudioSession API.

iOS Audio Units use a pure C API, as all the higher level Objective C APIs are slower, and thus unsuitable for low latency audio.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top