diff --git a/app/build.gradle b/app/build.gradle index 34fe0c6..a5a8383 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -8,8 +8,8 @@ android { applicationId "com.github.axet.audiorecorder" minSdkVersion 9 targetSdkVersion 23 - versionCode 104 - versionName "1.4.2" + versionCode 105 + versionName "1.4.3" } signingConfigs { release { @@ -48,7 +48,7 @@ dependencies { compile 'com.android.support:design:25.1.1' compile 'com.google.android.gms:play-services-appindexing:9.8.0' compile 'org.apache.commons:commons-math3:3.6.1' - compile 'com.github.axet:android-library:1.9.5' // compile project(':android-library') + compile 'com.github.axet:android-library:1.9.7' //compile project(':android-library') compile 'com.github.axet:jebml:0.0.2' // compile project(':jebml') compile 'com.github.axet:vorbis:1.0.0' // compile project(':vorbis') } diff --git a/app/src/main/java/com/github/axet/audiorecorder/activities/RecordingActivity.java b/app/src/main/java/com/github/axet/audiorecorder/activities/RecordingActivity.java index d8699a8..cadd0a3 100644 --- a/app/src/main/java/com/github/axet/audiorecorder/activities/RecordingActivity.java +++ b/app/src/main/java/com/github/axet/audiorecorder/activities/RecordingActivity.java @@ -49,7 +49,6 @@ import com.github.axet.audiorecorder.services.RecordingService; import com.github.axet.audiorecorder.widgets.PitchView; import java.io.File; -import java.util.Arrays; public class RecordingActivity extends AppCompatActivity { public static final String TAG = RecordingActivity.class.getSimpleName(); @@ -186,7 +185,7 @@ public class RecordingActivity extends AppCompatActivity { WindowManager.LayoutParams.FLAG_TURN_SCREEN_ON); sampleRate = Integer.parseInt(shared.getString(MainApplication.PREFERENCE_RATE, "")); - sampleRate = Sound.getValidRecordRate(sampleRate); + sampleRate = Sound.getValidRecordRate(MainApplication.getMode(this), sampleRate); samplesUpdate = (int) (pitch.getPitchTime() * sampleRate / 1000.0); updateBufferSize(false); @@ -594,10 +593,7 @@ public class RecordingActivity extends AppCompatActivity { throw new RuntimeException("Unable to initialize AudioRecord: Bad audio values"); } - // min = 1 sec - min = Math.max(sampleRate * (MainApplication.getChannels(RecordingActivity.this)), min); - - recorder = new AudioRecord(MediaRecorder.AudioSource.MIC, sampleRate, MainApplication.getMode(RecordingActivity.this), RawSamples.AUDIO_FORMAT, min); + recorder = new AudioRecord(MediaRecorder.AudioSource.MIC, sampleRate, MainApplication.getMode(RecordingActivity.this), RawSamples.AUDIO_FORMAT, min * 2); if (recorder.getState() != AudioRecord.STATE_INITIALIZED) { throw new RuntimeException("Unable to initialize AudioRecord"); }