user198725878
user198725878

Reputation: 6386

play an audio file during the call

I am having the following requirement to be implemented into my application

I want to play an audio file after answering the call / after making a call from my application.i mean that i want to fake the caller to pretend to be in traffic / rain by playing the audio file on call..

Please provide me your insights

Thanks a lot for your views and help

Upvotes: 2

Views: 3571

Answers (4)

Jason
Jason

Reputation: 21

This could certainly be done. The app would have to be a phone app first, (like the green one with the white phone in the center on iPhone) and a sound board added in the same app. A "sample" button system would be the secondary feature of this app. You could pull the phone away from your ear during a live call, finger-slide the screen with "end call" off to the side and expose your "sample board" and select an audio file to be played over your phone call. You could tap mute first so the listener only heard your audio file.

Upvotes: 2

jbat100
jbat100

Reputation: 16827

You should read the Audio Session Programming Guide, your requirements are impossible to meet. On receiving phone calls or on system alarms your audio session is interrupted. There is no way around it. Your application cannot play sound during the call. It does not kill your app however, you can get notifications on interruption begin/end so as to react gracefully. Relevant bit of the document (in "Handling Audio Interruptions"):

Adding audio session code to handle interruptions ensures that your application’s audio continues behaving gracefully when a phone call arrives or a Clock or Calendar alarm sounds.

An audio interruption is the deactivation of your application’s audio session—which immediately stops or pauses your audio, depending on which technology you are using. Interruptions happen when a competing audio session from a built-in application activates and that session is not categorized by the system to mix with yours. After your session goes inactive, the system sends a “you were interrupted” message which you can respond to by saving state, updating the user interface, and so on.

Upvotes: 1

shannoga
shannoga

Reputation: 19879

This is not just a matter of app store, you just can not do it programmatically (Assuming that the iPhone is not jailbroken) as the call kills any other process that runs by any "not apple" app. I do agree about the fun tough :)

Upvotes: 0

Jack
Jack

Reputation: 16728

I don't think the app store will allow this type of app.

Would be fun though ;-)

Upvotes: 0

Related Questions