Browse Source

chnaged start dely to 2 seconds

master
Bastian Kohler 1 year ago
parent
commit
0c808f1daa

+ 1
- 1
app/src/main/java/com/example/ueberwachungssystem/Detection/MicrophoneDetector.java View File

private final int channelConfig = AudioFormat.CHANNEL_IN_MONO; private final int channelConfig = AudioFormat.CHANNEL_IN_MONO;
private final int audioFormat = AudioFormat.ENCODING_PCM_16BIT; private final int audioFormat = AudioFormat.ENCODING_PCM_16BIT;


private final int startDelay = 20000;
private final int startDelay = 2000;
private final int threadSleeptime = 10; private final int threadSleeptime = 10;
private int minPufferGroesseInBytes; private int minPufferGroesseInBytes;
private int pufferGroesseInBytes; private int pufferGroesseInBytes;

+ 4
- 4
app/src/main/java/com/example/ueberwachungssystem/Detection/VideoDetector.java View File

private static final float ALARM_THRESHOLD = 0f; // Percent of pixels changed private static final float ALARM_THRESHOLD = 0f; // Percent of pixels changed
private static final float AREA_THRESHOLD = 10f; private static final float AREA_THRESHOLD = 10f;
private static final int DILATE_ITERATIONS = 2; private static final int DILATE_ITERATIONS = 2;
private static final float START_DELAY = 20000; // milliseconds
private static final float START_DELAY = 2000; // milliseconds
private static final android.util.Size IMAGE_RES = new android.util.Size(640, 480); private static final android.util.Size IMAGE_RES = new android.util.Size(640, 480);




if (isRecording){ if (isRecording){
return; return;
} }
Toast.makeText(context, "video recording started", Toast.LENGTH_SHORT).show();
Toast.makeText(context, "Aufnahme gestartet", Toast.LENGTH_SHORT).show();
videoCapture = setupVideoCapture(); videoCapture = setupVideoCapture();


final ListenableFuture<ProcessCameraProvider> cameraProviderFuture = ProcessCameraProvider.getInstance(context); final ListenableFuture<ProcessCameraProvider> cameraProviderFuture = ProcessCameraProvider.getInstance(context);
@Override @Override
public void onVideoSaved(@NonNull VideoCapture.OutputFileResults outputFileResults) { public void onVideoSaved(@NonNull VideoCapture.OutputFileResults outputFileResults) {
isRecording = false; isRecording = false;
Toast.makeText(context, "video recording saved", Toast.LENGTH_SHORT).show();
Toast.makeText(context, "Aufnahme gespeichert", Toast.LENGTH_SHORT).show();
} }
@Override @Override
public void onError(int videoCaptureError, @NonNull String message, @Nullable Throwable cause) { public void onError(int videoCaptureError, @NonNull String message, @Nullable Throwable cause) {
isRecording = false; isRecording = false;
Toast.makeText(context, "video recording failed", Toast.LENGTH_SHORT).show();
Toast.makeText(context, "Aufnahme fehlgeschlagen", Toast.LENGTH_SHORT).show();
} }
} }
); );

Loading…
Cancel
Save