cleanups
This commit is contained in:
parent
b506bc265e
commit
135818b793
1 changed files with 5 additions and 7 deletions
|
|
@ -181,8 +181,11 @@ public class RecordingActivity extends AppCompatActivity {
|
|||
|
||||
sampleRate = Integer.parseInt(shared.getString(MainApplication.PREFERENCE_RATE, ""));
|
||||
sampleRate = Sound.getValidRecordRate(MainApplication.getInMode(this), sampleRate);
|
||||
if (sampleRate == -1)
|
||||
throw new RuntimeException("Unable to initailze audio");
|
||||
if (sampleRate == -1) {
|
||||
Toast.makeText(this, "Unable to initailze audio", Toast.LENGTH_SHORT).show();
|
||||
finish();
|
||||
return;
|
||||
}
|
||||
samplesUpdate = (int) (pitch.getPitchTime() * sampleRate / 1000.0);
|
||||
|
||||
updateBufferSize(false);
|
||||
|
|
@ -292,10 +295,6 @@ public class RecordingActivity extends AppCompatActivity {
|
|||
updateSamples(samplesTime);
|
||||
}
|
||||
|
||||
boolean isEmulator() {
|
||||
return "goldfish".equals(Build.HARDWARE);
|
||||
}
|
||||
|
||||
void pauseButton() {
|
||||
if (thread != null) {
|
||||
stopRecording(getString(R.string.pause));
|
||||
|
|
@ -594,7 +593,6 @@ public class RecordingActivity extends AppCompatActivity {
|
|||
|
||||
rs.open(samplesTime);
|
||||
|
||||
|
||||
int c = MainApplication.getInMode(RecordingActivity.this);
|
||||
int min = AudioRecord.getMinBufferSize(sampleRate, c, Sound.DEFAULT_AUDIOFORMAT);
|
||||
if (min <= 0)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue