Android, phone call audio stream via wlan

元气小坏坏 提交于 2019-12-22 07:58:41

问题


I am planning on developing my specific voip app for android.

Here's the scenario: when a phone call occurs I want to hear the person who's calling on my local pc speakers and I want to speak to him via my own pc microphone / headset. So I need to send the audio stream of both me and the person I am talking to via the wlan network.

Something like this:

...
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 it should be since voip apps are available in the market) I did some research in the Android API and all I found was the AudioManager which has constant named

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

But I don't know how to use it our how it should give me access to the actual audiostreams which I can send via network. How do I manage to do this?

The connection would be realised by TCP sockets.


回答1:


Here's the scenario: when a phone call occurs I want to hear the person who's calling on my local pc speakers and I want to speak to him via my own pc microphone / headset. So I need to send the audio stream of both me and the person I am talking to via the wlan network.

What is the point of having Android in the mix? If you have a local PC, and you want to use the local PC for audio in/out, use a VOIP app on the local PC.

Something like this: onCallStateChanged()...

That is for voice calls using the built-in 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 "intercept the incoming 3G phone call and have the audio for the call be handled by Android code", then no, it is not possible.



来源:https://stackoverflow.com/questions/2492457/android-phone-call-audio-stream-via-wlan

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!