diff --git a/htroot/yacy/search.java b/htroot/yacy/search.java index ab12cfbdd..58dae90da 100644 --- a/htroot/yacy/search.java +++ b/htroot/yacy/search.java @@ -323,7 +323,7 @@ public final class search { ); Network.log.info("INIT HASH SEARCH (query-" + abstracts + "): " + QueryParams.anonymizedQueryHashes(theQuery.getQueryGoal().getIncludeHashes()) + " - " + theQuery.itemsPerPage() + " links"); EventChannel.channels(EventChannel.REMOTESEARCH).addMessage(new RSSMessage("Remote Search Request from " + ((remoteSeed == null) ? "unknown" : remoteSeed.getName()), QueryParams.anonymizedQueryHashes(theQuery.getQueryGoal().getIncludeHashes()), "")); - if (sb.getConfigBool(SwitchboardConstants.DECORATION_AUDIO, false)) Audio.Soundclip.remotesearch.play(); + if (sb.getConfigBool(SwitchboardConstants.DECORATION_AUDIO, false)) Audio.Soundclip.remotesearch.play(-10.0f); // make event theSearch = SearchEventCache.getEvent(theQuery, sb.peers, sb.tables, null, abstracts.length() > 0, sb.loader, count, maxtime); diff --git a/htroot/yacy/transferURL.java b/htroot/yacy/transferURL.java index 0c2ae58d2..a032c411d 100644 --- a/htroot/yacy/transferURL.java +++ b/htroot/yacy/transferURL.java @@ -176,7 +176,7 @@ public final class transferURL { // return rewrite properties Network.log.info("Received " + received + " URLs from peer " + otherPeerName + " in " + (System.currentTimeMillis() - start) + " ms, blocked " + blocked + " URLs"); EventChannel.channels(EventChannel.DHTRECEIVE).addMessage(new RSSMessage("Received " + received + ", blocked " + blocked + " URLs from peer " + otherPeerName, "", otherPeer.hash)); - if (sb.getConfigBool(SwitchboardConstants.DECORATION_AUDIO, false)) Audio.Soundclip.dhtin.play(); + if (sb.getConfigBool(SwitchboardConstants.DECORATION_AUDIO, false)) Audio.Soundclip.dhtin.play(-10.0f); if (doublecheck > 0) { Network.log.warn("Received " + doublecheck + "/" + urlc + " double URLs from peer " + otherPeerName); // double should not happen because we demanded only documents which we do not have yet diff --git a/source/net/yacy/gui/Audio.java b/source/net/yacy/gui/Audio.java index d05196208..871591b83 100644 --- a/source/net/yacy/gui/Audio.java +++ b/source/net/yacy/gui/Audio.java @@ -126,13 +126,17 @@ public class Audio { /** * play a soundclip once */ - public void play() { + public void play(float gain) { Clip clip; if ((clip = getClip()) == null) return; if (clip.isActive()) { Clip onetimeclip = getFreshClip(); + FloatControl gainControl = (FloatControl) onetimeclip.getControl(FloatControl.Type.MASTER_GAIN); + gainControl.setValue(gain); onetimeclip.start(); } else { + FloatControl gainControl = (FloatControl) clip.getControl(FloatControl.Type.MASTER_GAIN); + gainControl.setValue(gain); clip.setFramePosition(0); clip.start(); } @@ -179,9 +183,9 @@ public class Audio { public static void main(String[] args) { try { Soundclip.dhtin.playExperimental();Thread.sleep(100); - Soundclip.dhtin.play();Thread.sleep(500); - Soundclip.dhtin.play();Thread.sleep(500); - Soundclip.dhtin.play();Thread.sleep(500); + Soundclip.newdoc.play(-20.0f);Thread.sleep(500); + Soundclip.newdoc.play(-20.0f);Thread.sleep(500); + Soundclip.newdoc.play(-20.0f);Thread.sleep(500); Soundclip.remotesearch.start(); Thread.sleep(1000); Soundclip.remotesearch.stop(); Thread.sleep(1000); Soundclip.remotesearch.start(); Thread.sleep(1000); Soundclip.remotesearch.stop(); Thread.sleep(1000); Soundclip.remotesearch.start(); Thread.sleep(1000); Soundclip.remotesearch.stop(); Thread.sleep(1000); diff --git a/source/net/yacy/search/Switchboard.java b/source/net/yacy/search/Switchboard.java index 8d5a22589..e1a6bfcdf 100644 --- a/source/net/yacy/search/Switchboard.java +++ b/source/net/yacy/search/Switchboard.java @@ -2848,7 +2848,7 @@ public final class Switchboard extends serverSwitch { ? EventChannel.LOCALINDEXING : EventChannel.REMOTEINDEXING); feed.addMessage(new RSSMessage("Indexed web page", dc_title, queueEntry.url(), ASCII.String(queueEntry.url().hash()))); - if (this.getConfigBool(SwitchboardConstants.DECORATION_AUDIO, false)) Audio.Soundclip.newdoc.play(); + if (this.getConfigBool(SwitchboardConstants.DECORATION_AUDIO, false)) Audio.Soundclip.newdoc.play(-20.0f); // store rss feeds in document into rss table for ( final Map.Entry rssEntry : document.getRSS().entrySet() ) {