Play audio from an active phone call so that you can hear it at the other end

A and B are talking on the phone. During a conversation, A presses a button that draws sound from a resource and plays it over the telephone to B.

Is this possible using the Android platform? The goal is for the person at the other end of the call to hear a sound.

If this is not possible, is it a hardware limitation or an Android framework limit?

+6
source share
2 answers

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

Note. You can play audio data only on a standard output device. This is currently a mobile device speaker or a Bluetooth headset. You cannot play sound files during a conversation during a conversation.

+7
source

According to http://developer.android.com/reference/android/media/AudioManager.html there are several channels, although sound can be played:

  • STREAM_ALARM stream for alarms
  • STREAM_DTMF stream for DTMF tones
  • STREAM_MUSIC stream for playing music
  • STREAM_NOTIFICATION stream for notifications
  • STREAM_RING stream for a phone call
  • STREAM_SYSTEM stream for system sounds
  • STREAM_VOICE_CALL Stream for Phone Calls

This is what the Android infrastructure allows. It seems to me that two of them are of potential interest to you: STREAM_DTMF or, more likely, STREAM_VOICE_CALL . I did not experiment personally, but if I tried to do this, I would start with these two.

+4
source

Source: https://habr.com/ru/post/945132/


All Articles