Reputation: 322
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
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
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 alarmsSTREAM_DTMF
The audio stream for DTMF TonesSTREAM_MUSIC
The audio stream for music playbackSTREAM_NOTIFICATION
The audio stream for notificationsSTREAM_RING
The audio stream for the phone ringSTREAM_SYSTEM
The audio stream for system soundsSTREAM_VOICE_CALL
The audio stream for phone callsThese 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