重複の可能性:
Android でオーディオ録音の品質を向上させますか?
音声を 3gp ファイルに録音したい。問題なくできますし、声も聞こえます。しかし、私が聞くことができる声は非常に遅く、明確ではありません。音声品質を上げるためにプログラムを作成しましたが、java.lang.RuntimeException: start failed が発生します
public void onClick(View arg0)
{
root=Environment.getExternalStorageDirectory();
audiofile=new File(root,"sound.3gp");
if(!audiofile.exists())
{
Log.w(TAG, "File doesn't exists");
try
{
audiofile.createNewFile();
} catch (IOException e)
{
Log.w(TAG, "Unable to create audio file",e);
}
}
recorder.setAudioSource(MediaRecorder.AudioSource.MIC);
recorder.setOutputFormat(MediaRecorder.OutputFormat.DEFAULT);
recorder.setAudioEncoder(MediaRecorder.AudioEncoder.DEFAULT);
recorder.setOutputFile(audiofile.getAbsolutePath());
try
{
recorder.setAudioSamplingRate(10);
recorder.setAudioEncodingBitRate(20);
recorder.prepare();
} catch (IllegalStateException e)
{
Log.w(TAG, "This is IllegalStateException");
} catch (IOException e)
{
Log.w(TAG, "This is IoException");
}
recorder.start();
}
私のコードで何が間違っていますか? ありがとう。