【问题标题】:Media Recorder To record calls is sometime unable to Record other side voice媒体录音机录制通话有时无法录制对方的声音
【发布时间】:2018-02-03 11:27:53
【问题描述】:

在我的应用程序中,有一个可以录制语音通话的功能,而且效果很好。但是在 (Samsung s7, s8 ) 上进行测试时,效果不佳。该应用程序只能记录呼叫者的声音,而不是另一端的声音。以下是我要检查的代码,请提出解决方案

MediaRecd = new MediaRecorder();
            MediaRecd.setAudioSource(MediaRecorder.AudioSource.VOICE_CALL
            );

            MediaRecd.setAudioChannels(ConstantVariables.audioChannels);//monoRecording

   MediaRecd.setAudioEncodingBitRate(64);
            MediaRecd.setAudioSamplingRate(44100);


            MediaRecd.setOutputFormat(output_formats[pos]);//.mp3
            MediaRecd.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB);//I already try with all possible CAMCORDER , MIC , Default etc etc but none was working
            MediaRecd.setOutputFile(Currentfilename);

            try {
                MediaRecd.prepare();
                MediaRecd.start();


            } catch (Exception e) {
                MediaRecd.reset();
                MediaRecd.release();
                MediaRecd = null;

            }

请帮忙

【问题讨论】:

  • 我这边也一样...
  • 您为此尝试了什么解决方案?目前我陷入了这个问题。
  • 在哪个操作系统版本上不工作?
  • S7 和 S8 都有 OS 7 版本
  • 尝试使用我下面的答案方法并更新。

标签: android phone-call android-mediarecorder android-phone-call


【解决方案1】:

AudioSource.VOICE_CALL 在某些安卓设备上不工作,所以 而不是VOICE_CALL在下面使用

先试试MediaRecorder.AudioSource.CAMCORDER

 MediaRecd = new MediaRecorder();
        MediaRecd.setAudioSource(MediaRecorder.AudioSource.CAMCORDER
        );

如果上述方法不起作用,请使用MediaRecorder.AudioSource.MIC

MediaRecd = new MediaRecorder();
        MediaRecd.setAudioSource(MediaRecorder.AudioSource.MIC
        );

【讨论】:

  • 不,它不工作@Vishal 我已经这样做了,但三星 S7 和 S8 不能从这些工作
猜你喜欢
  • 1970-01-01
  • 2016-03-26
  • 2015-07-27
  • 1970-01-01
  • 1970-01-01
  • 2023-03-31
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多