Skip to content

Commit

Permalink
ticket:9 better sound quality; START_STICKY flag in audio service
Browse files Browse the repository at this point in the history
  • Loading branch information
UncleVasya committed Jan 22, 2014
1 parent 5360418 commit baa523d
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public int onStartCommand(Intent intent, int flags, int startId) {
if (!mTimerOn) {
startRecording();
}
return super.onStartCommand(intent, flags, startId);
return START_STICKY;
}

private class AudioRecordTimer extends CountDownTimer {
Expand Down Expand Up @@ -90,11 +90,11 @@ private void prepareRecorder() throws IOException {
mRecordFile = File.createTempFile("sound", ".mp4", sampleDir);

mRecorder = new MediaRecorder();
mRecorder.setAudioSource(MediaRecorder.AudioSource.MIC);
mRecorder.setOutputFormat(MediaRecorder.OutputFormat.MPEG_4);
mRecorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB);
mRecorder.setAudioSource(MediaRecorder.getAudioSourceMax());
mRecorder.setOutputFormat(MediaRecorder.OutputFormat.DEFAULT);
mRecorder.setAudioEncoder(MediaRecorder.AudioEncoder.AAC);
mRecorder.setAudioEncodingBitRate(128000);
mRecorder.setAudioEncodingBitRate(44100);
mRecorder.setAudioSamplingRate(16000);
mRecorder.setOutputFile(mRecordFile.getAbsolutePath());
mRecorder.prepare();
}
Expand Down

0 comments on commit baa523d

Please sign in to comment.