Record Call in Android 2.2

前端 未结 2 1264
无人及你
无人及你 2020-12-28 11:38

I have written this code for recording Calls. It works fine in Android 2.1. In Android 2.2, it creates an output file with 0 bytes.

How I can solve this?

<         


        
相关标签:
2条回答
  • 2020-12-28 12:15

    Use this snippet

    _recorder.setAudioSource(MediaRecorder.AudioSource.VOICE_DOWNLINK 
    | MediaRecorder.AudioSource.VOICE_UPLINK );
    

    instead of

    _recorder.setAudioSource(android.media.MediaRecorder.AudioSource.VOICE_CALL);
    
    0 讨论(0)
  • 2020-12-28 12:16

    Call recording only works on some Android phones. It might work on one phone running 2.1, but not on a different model running 2.2. Although the API will compile and run on all architectures, some devices have disabled this feature in the hardware.

    See How can I record voice and record Call in Android? for more details.

    0 讨论(0)
提交回复
热议问题