Android Record Audio
<p>i found that code to record, but I always get:</p>

<p>The method setOutputFile(FileDescriptor) in the type MediaRecorder is not applicable for the arguments (Uri)</p>

<p>So how would I need to describe the filepath that it works?
thx</p>

<pre><code>// Prepare recorder source and type
MediaRecorder recorder = new MediaRecorder();
recorder.setAudioSource(MediaRecorder.AudioSource.MIC);
recorder.setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP);
recorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB);

// File to which audio should be recorded
File outputFile = getFileStreamPath("output.amr");
Uri target = Uri.parse(outputFile.getAbsolutePath());
recorder.setOutputFile(target);

// Get ready!
recorder.prepare();

// Start recording
recorder.start();

// Stop and tidy up
recorder.stop();
recorder.release();
</code></pre>
