title: How to save audio recording with PlaybackParams in Android?
body: <p>I am working on an audio recorder app which has some effects. I am getting a problem that I cannot save audio files with effects. As soon as I stop recording it saves recording. But I want to save the recording when I click on the Save button with effects. I am using Seekbar for changing pitch.</p>
  
  <p><strong>Note:</strong> I am using AudioRecorder to record audio and AudioPLayer to play recorded audio and PlaybackParams for effects.</p>
  
  <p><strong>Code for MediaRecorder</strong></p>
  
  <pre><code>mediaRecorder=new MediaRecorder(); mediaRecorder.setAudioSource(MediaRecorder.AudioSource.MIC);             
  mediaRecorder.setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP);             
  mediaRecorder.setAudioEncoder(MediaRecorder.OutputFormat.AMR_NB);             
  mediaRecorder.setOutputFile(mFileName);
  </code></pre>
  
  <p>If I try to remove setOutputFile than the app crash.</p>
  
  <p><strong>Here is code for PlayRecording</strong></p>
  
  <pre><code>mediaPlayer = new MediaPlayer();
      try {
          mediaPlayer.setDataSource(AudioSavePathInDevice);
          mediaPlayer.prepare();
      } catch (IOException e) {
          e.printStackTrace();
      }
  
      params.setPitch(0.5f);
      mediaPlayer.setPlaybackParams(params);
      mediaPlayer.start();
  
      Toast.makeText(MainActivity.this, "Recording Playing",
              Toast.LENGTH_LONG).show();
  
  }
  </code></pre>
  
  <p>I am able to play it with the effect but unable to save it. Any Ideas how can I save recording with effects??</p>