user991429
user991429

Reputation: 322

Play audio over an active phone call, so other end can hear it

A and B are talking on the phone. During the call, A presses a button that pulls audio from a resource and plays it over the phone call to B.

Is this possible using the Android framework? The goal is for the person on the other end of the call to hear the audio.

If it's not possible, is it a hardware limitation or a limit of the Android framework?

Upvotes: 6

Views: 8281

Answers (2)

Leeeeeeelo
Leeeeeeelo

Reputation: 4383

I believe that you cannot achieve that, according to the documentation HERE :

Note: You can play back the audio data only to the standard output device. Currently, that is the mobile device speaker or a Bluetooth headset. You cannot play sound files in the conversation audio during a call.

Upvotes: 7

Neil Townsend
Neil Townsend

Reputation: 6084

According to http://developer.android.com/reference/android/media/AudioManager.html, there are a number of channels though which audio can be played:

  • STREAM_ALARM The audio stream for alarms
  • STREAM_DTMF The audio stream for DTMF Tones
  • STREAM_MUSIC The audio stream for music playback
  • STREAM_NOTIFICATION The audio stream for notifications
  • STREAM_RING The audio stream for the phone ring
  • STREAM_SYSTEM The audio stream for system sounds
  • STREAM_VOICE_CALL The audio stream for phone calls

These are what the android framework allows for. It would seem to me that two are of potential interest to you: STREAM_DTMF or, more likely, STREAM_VOICE_CALL. I haven't experimented personally, but if I was trying to do this, I would start by trying those two.

Upvotes: 4

Related Questions