如何调用启动时播放音频文件? [英] How to play audio file when call starts?

查看:92
本文介绍了如何调用启动时播放音频文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我开始从我的应用程序中的语音呼叫。现在我想,当另一侧的用户拿起电话,我想打一个录制的音频文件。

I am initiating a voice call from my application. Now i want that when the user on the other side picks up the call, i want to play a recorded audio file.

如何着手呢?请帮帮忙!

How to go about this? Please help!

推荐答案

我发现这个一个解决办法。我播放音频文件与完整的声音设备的扬声器的时候,手机状态改变为 TelephonyManager.CALL_STATE_OFFHOOK

I have found a workaround with this. I play an audio file on device's speakers with full sound when the phone state changes to TelephonyManager.CALL_STATE_OFFHOOK

这确保了在另一侧的用户能够听到在记录

This ensures that the user on the other side can hear the recording.

这篇关于如何调用启动时播放音频文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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