diff --git a/src/main/java/org/jitsi/jigasi/transcription/AbstractTranscriptionService.java b/src/main/java/org/jitsi/jigasi/transcription/AbstractTranscriptionService.java index acb604a87..ba2505d4d 100644 --- a/src/main/java/org/jitsi/jigasi/transcription/AbstractTranscriptionService.java +++ b/src/main/java/org/jitsi/jigasi/transcription/AbstractTranscriptionService.java @@ -39,4 +39,13 @@ public AudioMixerMediaDevice getMediaDevice(ReceiveStreamBufferListener listener return this.mediaDevice; } + + /** + * Returns true if the SilenceFilter should be disabled for this + * TranscriptionService. + */ + public boolean disableSilenceFilter() + { + return false; + } } diff --git a/src/main/java/org/jitsi/jigasi/transcription/Transcriber.java b/src/main/java/org/jitsi/jigasi/transcription/Transcriber.java index afada3b38..9bf14ee49 100644 --- a/src/main/java/org/jitsi/jigasi/transcription/Transcriber.java +++ b/src/main/java/org/jitsi/jigasi/transcription/Transcriber.java @@ -194,7 +194,7 @@ private enum State * Whether silenced audio should be filtered out before sending audio to * a {@link TranscriptionService}. */ - private boolean filterSilence = shouldFilterSilence(); + private boolean filterSilence; /** * Create a transcription object which can be used to add and remove @@ -218,6 +218,7 @@ public Transcriber(String roomName, } this.transcriptionService = service; addTranscriptionListener(this.transcript); + this.filterSilence = shouldFilterSilence(); configureTranslationManager(); if (isTranslationEnabled()) @@ -958,6 +959,7 @@ private boolean isTranslationEnabled() private boolean shouldFilterSilence() { return JigasiBundleActivator.getConfigurationService() - .getBoolean(P_NAME_FILTER_SILENCE, FILTER_SILENCE_DEFAULT_VALUE); + .getBoolean(P_NAME_FILTER_SILENCE, FILTER_SILENCE_DEFAULT_VALUE) + && !this.transcriptionService.disableSilenceFilter(); } } diff --git a/src/main/java/org/jitsi/jigasi/transcription/WhisperTranscriptionService.java b/src/main/java/org/jitsi/jigasi/transcription/WhisperTranscriptionService.java index 1718badee..3769de844 100644 --- a/src/main/java/org/jitsi/jigasi/transcription/WhisperTranscriptionService.java +++ b/src/main/java/org/jitsi/jigasi/transcription/WhisperTranscriptionService.java @@ -17,7 +17,6 @@ */ package org.jitsi.jigasi.transcription; -import org.eclipse.jetty.websocket.api.*; import org.jitsi.impl.neomedia.device.*; import org.jitsi.utils.logging.*; @@ -52,6 +51,12 @@ public AudioMixerMediaDevice getMediaDevice(ReceiveStreamBufferListener listener return this.mediaDevice; } + @Override + public boolean disableSilenceFilter() + { + return true; + } + /** * No configuration required yet */