Android, wlan phone call audio stream

I plan to develop my specific voip application for Android.

Here's the scenario: when the phone rings, I want to hear the person who is calling the local speakers, and I want to talk to him through my own microphone / headset. Therefore, I need to send an audio stream of both me and the person I'm talking to through the wlan network.

Something like that:

... onCallStateChanged(int state, String phoneNumber){ while(state == PhoneListener.CALL_STATE_OFFHOOK){ //while phone call is happening //send incoming speech via wlan to pc //receive audiostream from pc microphone and direct it to the phone call } } ... 

Is this possible with the current Android API? (Actually, this should be, since voip applications are available on the market) I did some research on the Android API, and all I found was an AudioManager with a constant named

 public static final int STREAM_VOICE_CALL; //The audio stream for phone calls 

But I don’t know how to use it, how it should give me access to the actual audio streams that I can send through the network. How can I do it?

The connection will be implemented by TCP sockets.

+4
source share
1 answer

Here's the scenario: when the phone rings I want to hear the person who is calling my local speakers and I want to talk to him through my own microphone / headset computer. Therefore, I need to send an audio stream both to me and the person I'm talking to through wlan.

What is the meaning of Android in the mix? If you have a local PC and want to use a local PC to input / output audio, use the VOIP application on the local PC.

Something like this: onCallStateChanged () ...

That is, for voice calls using the integrated telephony subsystem (3G, CDMA, etc.). This has nothing to do with VOIP.

Is this possible with the current Android API?

It depends on what this is. If "this" is an "interception of an incoming 3G phone call and the audio signal for the call is processed by the Android code", then no, this is not possible.

+2
source

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


All Articles