我正计划为 android 开发我的特定 voip 应用程序。
场景如下:当有电话呼叫时,我想听到正在本地电脑扬声器上通话的人,并且我想通过我自己的电脑麦克风/耳机与他交谈。所以我需要通过 wlan 网络发送我和我正在与之交谈的人的音频流。
像这样的东西:
...
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
}
}
...
当前的Android API可以做到这一点吗?(实际上应该是因为市场上有 voip 应用程序)我在 Android API 中做了一些研究,我发现的只是 AudioManager,它有一个常量命名
public static final int STREAM_VOICE_CALL; //The audio stream for phone calls
但我不知道如何使用它,它应该如何让我访问我可以通过网络发送的实际音频流。我该如何做到这一点?
连接将通过 TCP 套接字实现。