通过WLAN的Andr​​oid,电话音频流 [英] Android, phone call audio stream via wlan

查看:163
本文介绍了通过WLAN的Andr​​oid,电话音频流的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我就准备为Android开发我的具体的VoIP应用程序。

下面的情况: 当一个电话时我想听到谁在呼叫我的本地PC扬声器的人,我想通过我自己的电脑麦克风/耳机跟他说话。所以,我需要同时发送我的音频流和人,我通过WLAN网络交谈。

事情是这样的:

  ...
onCallStateChanged(INT状态,串phoneNumber的){
 而(州== PhoneListener.CALL_STATE_OFFHOOK){//当电话正在发生的事情
  //通过WLAN到PC机发送传入的讲话
  //从PC麦克风接收audiostream并引导其手机通话
 }
}
...
 

这可能与目前的Andr​​oid API? (其实应该是因为VoIP的应用程序都可以在市场上) 我在Android API中做了一些研究,我所发现的是已经定名为AudioManager

 公共静态最终诠释STREAM_VOICE_CALL; //音频流的电话
 

但我不知道如何使用它我们应该如何给我,我可以通过网络发送的实际audiostreams访问。我如何能做到这一点?

连接将通过TCP套接字来实现。

解决方案
  

下面的情景:当一个电话   发生我想听到的人谁的   呼吁本地PC音箱和我   想通过我自己的电脑和他说话   麦克风/耳机。所以,我需要   同时发送我的音频流和   这个人,我通过交谈   WLAN网络。

在什么混音有安卓的观点是?如果你有一个本地PC,并要使用本地PC的音频输入/输出,使用VOIP应用程序在本地计算机上。

  

事情是这样的:onCallStateChanged()...

这是对语音呼叫使用内置在电话子系统(3G,CDMA等)。这已无关,与VOIP。

  

与目前的Andr​​oid API,这可能吗?

这要看是什么这。如果这个是拦截传入的3G手机通话,并具有音频呼叫搭载Android code处理,则没有,这是不可能的。

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.

解决方案

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.

这篇关于通过WLAN的Andr​​oid,电话音频流的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆