简体   繁体   English

在Android上接收来电时的DTMF检测

[英]DTMF detection on receiving an incoming call on android

I would like to know whether we could receive the DTMF tones in android.Suppose,i am getting a call,and once i accept the call,is it possible to detect the keys that the other person is pressing during our call.I have go through many stack overflow questions regarding this,but most of them were not providing a solution. 我想知道我们是否可以在android.Suppose中收到DTMF音,我正在接听电话,一旦我接听电话,是否有可能在通话过程中检测到对方正在按下的键。我已经去了通过许多关于此的堆栈溢出问题,但大多数都没有提供解决方案。

How about implementing it through java reflection or something like that.?All the earlier post were for 2.2 and 3.0 versions.Presently we are in the 4.0 and above,so is it possible in the 4 or above versions? 如何通过java反射或类似的方式实现它。所有早期的帖子都是2.2和3.0版本。目前我们在4.0及以上,所以它可能在4或以上的版本?

Thanks in advance 提前致谢

There is no packages to do this in SDK. SDK中没有可以执行此操作的程序包。

FIRST, you need to listen the speaker voice, because you can not record voice call : 首先,你需要听讲话者的声音,因为你不能录制语音电话:

AudioManager mAudioManager = (AudioManager) Sos.getContext().getSystemService(Context.AUDIO_SERVICE);
int maxVolume = mAudioManager.getStreamMaxVolume(AudioManager.STREAM_VOICE_CALL);
mAudioManager.setStreamVolume(AudioManager.STREAM_VOICE_CALL, maxVolume, AudioManager.FLAG_REMOVE_SOUND_AND_VIBRATE);
mAudioManager.setSpeakerphoneOn(true);

AND, this project may help you : 并且,这个项目可以帮助您:

http://code.google.com/p/dtmf-decoder/source/checkout http://code.google.com/p/dtmf-decoder/source/checkout

I've done this, so i know it is possible this way. 我已经这样做了,所以我知道这是可能的。

Good luck 祝好运

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM