how to record audio file with better quality in android?

后端 未结 2 1016
孤城傲影
孤城傲影 2021-01-02 00:08

I am creating one application which play recorded file on Android to iphone and vice-versa.

now I am using ,

        audioRecorder = new MediaRecorde         


        
相关标签:
2条回答
  • 2021-01-02 00:36

    Increase the recorder.setAudioEncodingBitRate(value) if you want to change the quality.

    recorder = new MediaRecorder();
    recorder.setAudioSource(MediaRecorder.AudioSource.MIC);
    recorder.setOutputFormat(MediaRecorder.OutputFormat.MPEG_4);
    recorder.setAudioEncoder(MediaRecorder.AudioEncoder.AAC);
    recorder.setAudioEncoder(MediaRecorder.getAudioSourceMax());
    recorder.setAudioEncodingBitRate(16);
    recorder.setAudioSamplingRate(44100);
    recorder.setOutputFile(path);
    recorder.prepare();
    recorder.start(); 
    

    EDIT:

    Another option is to add a converter to your app. Convert AMR to AAC.

    0 讨论(0)
  • 2021-01-02 00:48

    This link is very useful: Android supported media formats

    This section gives us more information about audio and video formats.

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