Skip to content

Commit

Permalink
quick clean-up of logging on micsamplertask
Browse files Browse the repository at this point in the history
  • Loading branch information
n8fr8 committed Feb 28, 2019
1 parent 424d715 commit 2870d2b
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions src/main/java/org/havenapp/main/sensors/media/MicSamplerTask.java
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,13 @@ protected Void doInBackground(Void... params) {
while (true) {

if (listener != null) {
Log.i("MicSamplerTask", "Requesting amplitude");
Log.d("MicSamplerTask", "Requesting amplitude");
publishProgress(volumeMeter.getAmplitude());
}
try {
Thread.sleep(250);
} catch (InterruptedException e) {
//Nothing to do we exit next line

//Nothing to do we exit next line
}

boolean restartVolumeMeter = false;
Expand All @@ -72,22 +71,19 @@ protected Void doInBackground(Void... params) {
try {
Thread.sleep(500);
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
//Nothing to do we exit next line
}
}
if (restartVolumeMeter) {
try {
Log.i("MicSamplerTask", "Task restarted");
Log.d("MicSamplerTask", "Task restarted");
volumeMeter = new AudioCodec();
volumeMeter.start();
sampling = true;
} catch (IllegalStateException e) {
// TODO Auto-generated catch block
e.printStackTrace();
Log.d("MicSamplerTask","Failed to start",e);
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
Log.d("MicSamplerTask","Failed to start",e);
}
}
if (isCancelled()) { volumeMeter.stop(); sampling = false; return null; }
Expand Down

0 comments on commit 2870d2b

Please sign in to comment.