some dictionary (such as DSL) supports sound files.
When supporting <a href="file://bra.wav">
tag to play sound, it would be better.
It can be realized with LinkActionLIstener for dictionary pane.
The issue is related with [bugs:#1065]
public static class LinkActionListener implements HyperlinkListener { @Override public void hyperlinkUpdate(final HyperlinkEvent hyperlinkEvent) { if (hyperlinkEvent.getEventType().equals(HyperlinkEvent.EventType.ACTIVATED)) { URL url = hyperlinkEvent.getURL(); if (url.getProtocol().equals("file")) { try { String path = url.toURI().getPath(); if (path.endsWith(".wav")) { playSound(new File(path)); } } catch (URISyntaxException e) { e.printStackTrace(); } } } } } public static synchronized void playSound(final File file) { new Thread(() -> { try { Clip clip = AudioSystem.getClip(); AudioInputStream inputStream = AudioSystem.getAudioInputStream(file); clip.open(inputStream); clip.start(); } catch (Exception e) { System.err.println(e.getMessage()); } }).start(); }
Diff:
Related
Feature Requests:
#1594This was implemented in [91d272] on
master
.Related
Commit: [91d272]
Implemented in OmegaT 5.7.0.