IPhone Playing sound over a phone call - ios

I would like to play a sound file during a phone call so that the person at the other end of the line can hear it clearly.
I know it is possible to play sounds on the line but i can't figure out how to cut the microphone at the same time so the person at the other side of the line don't hear ambient noises.
Does someone knows how to do that? Or have any cue where I could look for information?

I very much doubt it is possible.
A telephone is an emergency communication device. The inability to make, receive or even clearly hear a phone call could literally kill someone. Consequently, the iPhone API strongly protects the integrity of the phone before all other functions.
Even if you did figure out a way, I doubt Apple would let it through. (Think of the liability issues for them and you!) The iPhone isn't a very small laptop, its a phone with a computer attached and the phone comes first.
You should always consider that when starting a design.

Related

Can an iOS app passivly listen for a certain sound?

I know the iPhone responds to "hey Siri". Is there similar features that I can use in my app to listen for certain sounds? If so what is the name of the iOS framework to use?
No, there is no API for that. Hey Siri is part of the OS and has hardware-level support. Your app can only use the microphones while it’s running; there is support for keeping the app alive while it’s recording audio, but the battery impact would be severe—the device can’t go to sleep—so it would be extremely unlikely to pass app review. That said, if you’d like API support to be added in future, please file an enhancement request with the use case you have in mind.
Yes sure, you can implement a recorder that records from the microphone and then you check anything you may need from recorded files.
Btw, what do you mean by certain sounds?
I think it sounds a bit tricky so please elaborate on your question. What's the business reason? How will you perform "listen for certain sounds"? How do you check it for being "certain". I think it's quite a hard thing to do using iOS but maybe I got your question wrong.
UPDATE: According to your comment: yeah it's possible but not like "hey ios check if it's a gunshot" :)))
But I think you can do it by checking the volume of the sound. If it is loud then it's a gunshot. I think it will work since user will use it on purpose. Check this link.
Also, I saw a similar app for gun shooters. So I'm sure it's doable:)
So shortly: find the way to: 1. use microphone. 2. Listen to sounds. 3. Check the sound for volume/length 4. Try detecting by testing
PS: Be careful with shooting while coding :)
If your "certain" sounds are referring to spoken words. Apple has the Speech Recognition framework for determining particular words.
If you are trying to measure perhaps a particular frequency however, Like many guitar tuner apps use or other music recording type app, I would recommend checking in depth AVFoundation 's guide to audio engineering.

What is the best way to measure bandwidth/connection quality in Twilio?

We are using Twilio video in iOS and Android (through a react-native extension). We would like to warn users about lousy connections if they are making a call. Is there something buried in Twilio's SDKs to do this? Or do people have suggestions for a great library to measure connection quality? (for instance: https://www.npmjs.com/package/network-js)
Twilio developer evangelist here.
In WebRTC implementations there is normally a way to get the connection statistics. In iOS using Twilio Video, you need to call the getStatsWithBlock method on the room. In Android you want the getStats method on the room. I don't know how you've made your react-native wrapper, but those are the bits you are looking for.
Once you've got the stats, you can start looking for the track stats, which will give you information about the frames per second, frames received, frames dropped, etc. This means you can judge the quality of the call not on the network, but on the data being sent and received.
Sorry I can't be more specific, hopefully this gets you started.

Audio streaming between 2 devices via bluetooth/wifi?

I need help making an app that works over bluetooth/wifi. I prefer using bluetooth since there won't be no lags.
Basically, what I want the app to do is stream audio from one device to another device. It has to be accurate.
Any help?(I am willing to pay for the man that helps me).
Thanks in advance!
All of the above is just the beginning. The API allows your iPhone to
stream data from the service once it is discovered and connected to,
etc. Just like the older Bluetooth spec, but simpler. In the spec’s
simplicity lies its power.
for details please have a look at LINK here.

iPhone headphone audio jack re-routing

We created an external iOS notification light that uses the device’s audio for power.
When you get a phone call on iPhone and the light is plugged in, you still get the ringtone but when you pick up, the audio is rerouted to the headphones (the iPhone thinks our light/device is a headphones set) and the user has to extract myLED for at least 2mm to get the audio from the front receiver of the phone.
We have been exploring alternative solutions to this challange - recently we made a prototype with a particular jack shape so that it could be rotated by the user when getting a call to "reroute" the audio to the iPhone speaker/mic.
Although it may sound a clever option, this hardware solution is far from being neat - this leads to having positions where the myLED does not work/ it is not reliable, plus other complications.
I know of the existence of kAudioSessionOverrideAudioRoute_Speaker however I suspect that this will only direct the app audio to the rear speaker (the “loud” one) and not to the front receiver (because the “receiver” for the iphone is the headphones set if they are detected).
What would you suggest?
Super appreciated!
I think you're in a tough spot:
It's highly unlikely Apple will ever release the option to override audio routing for phone calls. As a key functionality of the phone, they tend to keep the call aspect under lock and key.
The headphone jack (probably - this is how most of them do it) uses the impedance between ground and one or both speakers or the remote control to determine if the plug is in. Other than breaking the circuit, there is no good way to simulate this.
The only options I think you have are these:
Require the user to remove the device when a call comes in.
Provide a microcontroller on the jack to drive a transistor; this transistor can electronically break the circuit to provide the same sort of impedance signature as an unplugged jack.
How, when, and if you can provide the information to the jack that a phone call is in progress is beyond my knowledge: is there an API for "incoming but not yet answered call" you can hook to? Will you have to do a watchdog thing to ensure communication with your app? Would it be possible for you to use the dock connector instead? I think these are really your options. Not a complete answer, but those are my thoughts.

iPhone phone call detection software

Has anyone any idea about how www.mrnumber.com works for iPhone? As far as I know, in iPhone, we can not detect an incoming phone call because the following code
- (void)applicationWillResignActive:(UIApplication *)application
will execute in case of launch of any other iPhone process. How do I get to know that this other process was an incoming phone call?
It is not working on the iphone the same as on the android
All the iPhone version doe's is -
Status for calls and texts
Mr. Number brings the idea of status from IM and chat to calls and texts. Let your friends on Mr. Number know when you’re free for a call, when you prefer text, and when you’re tied up. You can even tell Mr. Number to send all your calls to voicemail and let your friends know when you’re free again.
Reverse lookup
Getting calls or texts from numbers that you don’t recognize? Mr. Number can return a name for over 70% of US phone numbers. Enter the number or copy and paste from your recent calls. Once you find out who it is, you can add them to your contacts with one click. And Mr. Number users have posted comments about tens of thousands of phone numbers used by telemarketers, debt collectors, robodialers, and other harassing callers so that you don’t waste your time.
When a call is coming your are dead, and there is nothing you can do about it.

Resources