在android 7的录音通话中无法听到呼入声音吗? [英] Couldn't hear incoming voice in recorded calls in android 7?

查看:328
本文介绍了在android 7的录音通话中无法听到呼入声音吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个用于记录通话的Android应用程序. 这是我的代码段.

I am developing an Android app for recording calls. This is my code snippet.

    recorder = new MediaRecorder();
    recorder.setAudioSource(MediaRecorder.AudioSource.DEFAULT);
    recorder.setOutputFormat(MediaRecorder.OutputFormat.DEFAULT);
    recorder.setAudioEncoder(MediaRecorder.AudioEncoder.AAC);
    recorder.setOutputFile(file_path);

这对于以下 android 7的设备来说是完美的,但是当我使用Android 7移动设备时,我只能听到传出的声音,但听不到传入的声音.

This is working perfectly for devices below android 7, but when I use Android 7 mobile devices I can hear only outgoing voice but cannot hear incoming voice.

有人可以帮助我修复它吗?

Can anyone help me in fixing it?

推荐答案

按原样使用VOICE_COMMUNICATION作为AudioSource 麦克风音频源已针对VoIP等语音通信进行了调整,如Android开发人员网站所述.

Use VOICE_COMMUNICATION as AudioSource as it is microphone audio source tuned for voice communications such as VoIP, as described on Android Developers site.

我尝试使用VOICE_CALL(使用音频上下行录制),但是它只能由系统组件使用,因此mic是录制音频的唯一选择.

I tried using VOICE_CALL(Uses audio uplink and downlink recording) but it can be used only by system components only, So mic is only option to record audio.

尝试:
1:在通话期间调高音量.
2.请勿使用耳机,因为在某些情况下麦克风不会录制音频[没有尝试过此操作]. 3.可以在Android版本7.1.1的Moto G4 Play上使用(大多数摩托罗拉手机带有两个麦克风):

TRY:
1: Sliding up the volume during call.
2. DO NOT use headphones as audio will not be recorded by mic in some cases[Haven't tried this]. 3. Works on Moto G4 Play, Android version 7.1.1(most of Motorola phones have two mics):

recorder.setAudioSource(MediaRecorder.AudioSource.VOICE_COMMUNICATION); recorder.setOutputFormat(MediaRecorder.OutputFormat.AMR_NB); recorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB);

recorder.setAudioSource(MediaRecorder.AudioSource.VOICE_COMMUNICATION); recorder.setOutputFormat(MediaRecorder.OutputFormat.AMR_NB); recorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB);

这篇关于在android 7的录音通话中无法听到呼入声音吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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