void (@NotNull Notification notification) { if (!NotificationsConfigurationImpl.getSettings(notification.getGroupId()).isShouldReadAloud() || NotificationsAnnouncerKt.isNotificationAnnouncerEnabled()) { return; } String message = notification.getTitle(); if (message.isEmpty()) { message = notification.getContent(); } message = StringUtil.stripHtml(message, false); if (message.length() > MAX_MESSAGE_LENGTH) { String[] words = message.split("\\s"); StringBuilder sb = new StringBuilder(); for (String word : words) { if (sb.length() + word.length() >= MAX_MESSAGE_LENGTH - 1) { break; } if (!sb.isEmpty()) { sb.append(' '); } sb.append(word); } message = sb.toString(); } if (!message.isEmpty()) { String copy = message; ExecutorHolder.ourService.execute(() -> { try { Runtime.getRuntime().exec("say " + copy).waitFor(); } catch (IOException | InterruptedException e) { LOG.warn(e); } }); } }