2016-01-13 7 views
6

काम नहीं कर रहा है मुझे एंड्रॉइड लॉलीपॉप और उच्च संस्करण में वॉयस कॉल रिकॉर्ड करने में समस्या हो रही है। इस कोड से मैं अपनी आवाज रिकॉर्ड करने में सक्षम हूं, लेकिन अन्य व्यक्ति की आवाज रिकॉर्ड करने में सक्षम नहीं हूं।एंड्रॉइड लॉलीपॉप पर वॉयस कॉल रिकॉर्डिंग और उच्च संस्करण

public void startRecording() { 
    if (recording == false) { 


     Log.e("here", "--------Recorder_Sarted------" + fname); 
     SimpleDateFormat sdf = new SimpleDateFormat("ddMMyyyy"); 
     int randomPIN = (int) (Math.random() * 9000) + 1000; 
     recorder.setAudioSource(MediaRecorder.AudioSource.VOICE_COMMUNICATION); 
     recorder.setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP); 
     recorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB); 
     String file = Environment.getExternalStorageDirectory().toString(); 
     String filepath = file + "/Aeris/Recording"; 
     File dir = new File(filepath); 
     dir.mkdirs(); 
     Log.e("here ", "----------------" + sdf.format(Calendar.getInstance().getTime()) + " " + fname + " " + type); 
     filepath += "/" + type + "-" + fname + "-" + sdf.format(Calendar.getInstance().getTime()) + "-" + randomPIN + ".3gp"; 
     recorder.setOutputFile(filepath); 

     try { 
      recorder.prepare(); 
     } catch (IllegalStateException e) { 
      // TODO Auto-generated catch block 
      e.printStackTrace(); 
     } catch (IOException e) { 
      // TODO Auto-generated catch block 
      e.printStackTrace(); 
     } 
     recorder.start(); 
     recording = true; 
    } 
} 

यह कोड एंड्रॉइड लॉलीपॉप संस्करण के नीचे ठीक काम कर रहा है। कृपया मुझे इस समस्या

उत्तर

0

चने AudioSource VOICE_COMMUNICATIONMIC (माइक्रोफोन) को

recorder.setAudioSource(MediaRecorder.AudioSource.VOICE_COMMUNICATION); 

परीक्षण मोटो G2 में (एंड्रॉयड 6.0), लेनोवो (एंड्रॉयड 5.0), अपने काम कर ठीक हल करने के लिए मदद करते हैं।

संबंधित मुद्दे