From 0c808f1daae9b47f8d6b7b5932db35b5ac8c6abe Mon Sep 17 00:00:00 2001 From: Bastian Kohler Date: Fri, 23 Jun 2023 16:21:04 +0200 Subject: [PATCH] chnaged start dely to 2 seconds --- .../ueberwachungssystem/Detection/MicrophoneDetector.java | 2 +- .../ueberwachungssystem/Detection/VideoDetector.java | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/src/main/java/com/example/ueberwachungssystem/Detection/MicrophoneDetector.java b/app/src/main/java/com/example/ueberwachungssystem/Detection/MicrophoneDetector.java index 697a732..c005549 100644 --- a/app/src/main/java/com/example/ueberwachungssystem/Detection/MicrophoneDetector.java +++ b/app/src/main/java/com/example/ueberwachungssystem/Detection/MicrophoneDetector.java @@ -49,7 +49,7 @@ public class MicrophoneDetector extends Detector { private final int channelConfig = AudioFormat.CHANNEL_IN_MONO; private final int audioFormat = AudioFormat.ENCODING_PCM_16BIT; - private final int startDelay = 20000; + private final int startDelay = 2000; private final int threadSleeptime = 10; private int minPufferGroesseInBytes; private int pufferGroesseInBytes; diff --git a/app/src/main/java/com/example/ueberwachungssystem/Detection/VideoDetector.java b/app/src/main/java/com/example/ueberwachungssystem/Detection/VideoDetector.java index 5176505..f8a936b 100644 --- a/app/src/main/java/com/example/ueberwachungssystem/Detection/VideoDetector.java +++ b/app/src/main/java/com/example/ueberwachungssystem/Detection/VideoDetector.java @@ -76,7 +76,7 @@ public class VideoDetector extends Detector { private static final float ALARM_THRESHOLD = 0f; // Percent of pixels changed private static final float AREA_THRESHOLD = 10f; 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); @@ -134,7 +134,7 @@ public class VideoDetector extends Detector { if (isRecording){ return; } - Toast.makeText(context, "video recording started", Toast.LENGTH_SHORT).show(); + Toast.makeText(context, "Aufnahme gestartet", Toast.LENGTH_SHORT).show(); videoCapture = setupVideoCapture(); final ListenableFuture cameraProviderFuture = ProcessCameraProvider.getInstance(context); @@ -155,12 +155,12 @@ public class VideoDetector extends Detector { @Override public void onVideoSaved(@NonNull VideoCapture.OutputFileResults outputFileResults) { isRecording = false; - Toast.makeText(context, "video recording saved", Toast.LENGTH_SHORT).show(); + Toast.makeText(context, "Aufnahme gespeichert", Toast.LENGTH_SHORT).show(); } @Override public void onError(int videoCaptureError, @NonNull String message, @Nullable Throwable cause) { isRecording = false; - Toast.makeText(context, "video recording failed", Toast.LENGTH_SHORT).show(); + Toast.makeText(context, "Aufnahme fehlgeschlagen", Toast.LENGTH_SHORT).show(); } } );