{"action":"created","issue":{"url":"https://api.github.com/repos/katspaugh/wavesurfer.js/issues/400","labels_url":"https://api.github.com/repos/katspaugh/wavesurfer.js/issues/400/labels{/name}","comments_url":"https://api.github.com/repos/katspaugh/wavesurfer.js/issues/400/comments","events_url":"https://api.github.com/repos/katspaugh/wavesurfer.js/issues/400/events","html_url":"https://github.com/katspaugh/wavesurfer.js/issues/400","id":61282367,"number":400,"title":"Straight-through connection retained when filters added with setFilters(filters)","user":{"login":"nmgtn","id":9980206,"avatar_url":"https://avatars.githubusercontent.com/u/9980206?v=3","gravatar_id":"","url":"https://api.github.com/users/nmgtn","html_url":"https://github.com/nmgtn","followers_url":"https://api.github.com/users/nmgtn/followers","following_url":"https://api.github.com/users/nmgtn/following{/other_user}","gists_url":"https://api.github.com/users/nmgtn/gists{/gist_id}","starred_url":"https://api.github.com/users/nmgtn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nmgtn/subscriptions","organizations_url":"https://api.github.com/users/nmgtn/orgs","repos_url":"https://api.github.com/users/nmgtn/repos","events_url":"https://api.github.com/users/nmgtn/events{/privacy}","received_events_url":"https://api.github.com/users/nmgtn/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-03-13T22:36:13Z","updated_at":"2015-03-30T18:40:23Z","closed_at":null,"body":"When you use `setFilters(filters)` to add some filters in the 'FX loop' kind of structure that wavesurfer seems to use, the analyser node at the start of the chain of filters remains directly connected to the gain node at the other end of the chain. This means that what you hear is the sum of the unprocessed sound and the sound going through the filter chain. Please excuse me if have misunderstood, and this is by design, but it looks to me like a bug!\r\n\r\n## Audio graph, without filters\r\nWithout any filters set, analyser is connected directly to gain node, which is sensible:\r\n\r\n![wavesurfer-fx-bypass_2](https://cloud.githubusercontent.com/assets/9980206/6648149/3edac49e-c9ce-11e4-8680-0178980b82b3.png)\r\n(picture is Firefox visualisation of the audio graph on the [wavesurfer.fm home page](http://www.wavesurfer.fm/))\r\n\r\n## Audio graph, with filters\r\nAdding filters using the `setFilters` method (or `setFilter`)\r\n\r\n### Expectation\r\nAnalyser node should be disconnected from gain node, and connected to first filter in the chain. Last filter in the chain should be connected to gain node. This means that audio is routed 100% wet through the filter chain.\r\n\r\n### Observation\r\nAnalyser node retains its direct connection to gain node, and a connection is added to first filter in the chain. Last filter in the chain is connected to gain node, so you get 100% wet + 100% dry signal:\r\n\r\n![wavesurfer-fx-bypass](https://cloud.githubusercontent.com/assets/9980206/6648148/3cd4e92c-c9ce-11e4-846f-5ce07301b9e7.png)\r\n(picture is Firefox visualisation of the audio graph on the [panner filter example](http://www.wavesurfer.fm/example/panner/))\r\n\r\n## A fix?\r\n\r\nI can't see anything in the definition of `setFilters` which is supposed to disconnect analyser node from gain node before connecting each filter in turn. I considered adding a line to `disconnectFilters` to do this, but that doesn't really make sense. Perhaps it's best to add `this.analyser.disconnect()` immediately after [line 79 of webaudio.js](https://github.com/katspaugh/wavesurfer.js/blob/master/src/webaudio.js#L79).\r\n\r\nI wanted to check with you that I've understood properly what is supposed to be happening, before I see about fixing the issue - please do let me know if I have misunderstood! If you agree that this is a bug, let me know any pointers you have for solving it and I'll put a pull request together."},"comment":{"url":"https://api.github.com/repos/katspaugh/wavesurfer.js/issues/comments/87785598","html_url":"https://github.com/katspaugh/wavesurfer.js/issues/400#issuecomment-87785598","issue_url":"https://api.github.com/repos/katspaugh/wavesurfer.js/issues/400","id":87785598,"user":{"login":"nmgtn","id":9980206,"avatar_url":"https://avatars.githubusercontent.com/u/9980206?v=3","gravatar_id":"","url":"https://api.github.com/users/nmgtn","html_url":"https://github.com/nmgtn","followers_url":"https://api.github.com/users/nmgtn/followers","following_url":"https://api.github.com/users/nmgtn/following{/other_user}","gists_url":"https://api.github.com/users/nmgtn/gists{/gist_id}","starred_url":"https://api.github.com/users/nmgtn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nmgtn/subscriptions","organizations_url":"https://api.github.com/users/nmgtn/orgs","repos_url":"https://api.github.com/users/nmgtn/repos","events_url":"https://api.github.com/users/nmgtn/events{/privacy}","received_events_url":"https://api.github.com/users/nmgtn/received_events","type":"User","site_admin":false},"created_at":"2015-03-30T18:40:23Z","updated_at":"2015-03-30T18:40:23Z","body":"Thanks, that works great. "}}