diff --git a/src/main/java/uk/gov/hmcts/darts/audio/component/impl/OutboundFileProcessorImpl.java b/src/main/java/uk/gov/hmcts/darts/audio/component/impl/OutboundFileProcessorImpl.java index cc7580ac8c..c9d69872b3 100644 --- a/src/main/java/uk/gov/hmcts/darts/audio/component/impl/OutboundFileProcessorImpl.java +++ b/src/main/java/uk/gov/hmcts/darts/audio/component/impl/OutboundFileProcessorImpl.java @@ -101,10 +101,13 @@ public List processAudioForPlaybacks(Map media List concatenatedAndMergedAudioFileInfos = new ArrayList<>(); if (isNotEmpty(audioFileInfos)) { // Used for logging only - String audioFilenames = audioFileInfos.stream().map(AudioFileInfo::getMediaFile).collect(Collectors.joining(", ")); + String audioFilenames = null; + if (log.isDebugEnabled()) { + audioFileInfos.stream().map(AudioFileInfo::getMediaFile).collect(Collectors.joining(", ")); + } List concatenationsList = new ArrayList<>(); - + if (isWellFormedAudio(audioFileInfos)) { log.debug("Audio files {} are well formed", audioFilenames); List concatenatedAudios = concatenateByChannelWithGaps(audioFileInfos);