在免提通话期间通过电话扬声器播放声音 [英] Play sound via phone speaker during handsfree phone call

查看:41
本文介绍了在免提通话期间通过电话扬声器播放声音的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在通话过程中在手机扬声器中播放声音(免提)?

How to play sound in phone speaker during phone call (in handsfree)?

我试试这个:

audio.setMode(AudioManager.MODE_IN_CALL);
audio.setSpeakerphoneOn(true);

audio.setStreamVolume(AudioManager.MODE_IN_CALL, 20, 0);
mediaplayer.setStreamType(AudioManager.STREAM_VOICE_CALL);

但以这种方式 - 开始从电话扬声器播放响亮的声音,但免提通话已终止,并且电话也在电话扬声器中播放.

But in this way - starts playing loud sound from the phone speaker, but the call is terminated in handfree and call is also playing in the phone speaker.

如何在不影响免提通话的情况下播放声音?谢谢.

How is it possible to play a sound without affecting the call in handsfree? Thanks.

推荐答案

使用 另一个流以不中断通话音频:

Use another stream to not interrupt the call audio:

mediaplayer.setStreamType(AudioManager.STREAM_MUSIC);

如果您只是想通过通话本身发送简单的提示音,那么可能:

If you're just trying to send simple tones over the call itself then maybe:

mediaplayer.setStreamType(AudioManager.STREAM_DTMF);

这篇关于在免提通话期间通过电话扬声器播放声音的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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