{"id":27314620,"url":"https://github.com/sambego/audio-effects","last_synced_at":"2026-03-12T14:17:44.652Z","repository":{"id":57186579,"uuid":"49720046","full_name":"Sambego/audio-effects","owner":"Sambego","description":"A javascript library to create audio effects using the web-audio-api","archived":false,"fork":false,"pushed_at":"2017-03-15T12:04:25.000Z","size":223,"stargazers_count":142,"open_issues_count":2,"forks_count":21,"subscribers_count":11,"default_branch":"master","last_synced_at":"2025-04-12T07:59:22.596Z","etag":null,"topics":["audio-effects","typescript","web-audio-api"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Sambego.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-01-15T13:22:05.000Z","updated_at":"2025-03-26T03:38:38.000Z","dependencies_parsed_at":"2022-08-25T22:41:27.599Z","dependency_job_id":null,"html_url":"https://github.com/Sambego/audio-effects","commit_stats":null,"previous_names":["sambego/pedalboard.js"],"tags_count":32,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sambego%2Faudio-effects","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sambego%2Faudio-effects/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sambego%2Faudio-effects/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sambego%2Faudio-effects/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Sambego","download_url":"https://codeload.github.com/Sambego/audio-effects/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248537090,"owners_count":21120701,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["audio-effects","typescript","web-audio-api"],"created_at":"2025-04-12T07:59:27.362Z","updated_at":"2026-03-12T14:17:44.585Z","avatar_url":"https://github.com/Sambego.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Audio-effects\n\nA javascript library to create audio effects using the web-audio-api. This library contains the following effects:\n- Volume\n- Distortion\n- Delay\n- Flanger\n- Reverb\n- Tremolo\n\nI will try to add more effects in the future.\n\n# Install\n```\nnpm install --save audio-effects\n```\n\n# API\n\n## Audio context\nTo start, we need an audio-context, the audio-effect library has a useful helper function to check if the current browser supports the web-audio-api.\n\n```javascript\nimport {HasAudioContext} from 'audio-effects';\n\nlet audioContext = null;\n\nif (HasAudioContext) {\n    audioContext = new AudioContext();\n}\n```\n\n## Input\nAn input node manages the audio input.\nYou can either supply an audio stream.\n\n```javascript\nimport {Input} from 'audio-effects';\n\nconst stream = createAnAudioStream(); // Some audio stream\nconst input = new Input(audioContext);\n      input.input = stream;\n```\n\nOr use the `getUserMedia` method to access the devices microphone.\n\n```javascript\nimport {Input} from 'audio-effects';\n\nconst input = new Input(audioContext);\n      input.getUserMedia();\n```\n\n## Output\nThis is the audio node which should be at the end of the chain, this connects our audio to the device's speakers.\n\n```javascript\nimport {Output} from 'audio-effects';\n\nconst output = new Output(audioContext);\n```\n\n## Volume\nControl the volume of your audio or mute it.\n\n```javascript\nimport {Volume} from 'audio-effects';\n\nconst volume = new Volume(audioContext);\n      volume.level = 0.5; // Change the volume to 50%\n      volume.mute = true; // Mute the volume\n```\n\n## Distortion\nAdd a distortion effect\n\n```javascript\nimport {Distortion} from 'audio-effects';\n\nconst distortion = new Distortion(audioContext);\n      distortion.intensity = 200; // Set the intensity to 200\n      distortion.gain = 100; // Set the gain to 100\n      distortion.lowPassFilter = true; // Enable the lowpass filter\n```\n\n## Delay\nAdd a delay effect\n\n```javascript\nimport {Delay} from 'audio-effects';\n\nconst delay = new Delay(audioContext);\n      delay.wet = 1; // Set the wetness to 100%\n      delay.speed = 1; // Set the speed to 1 second\n      delay.duration = 0.4; // Set the delay duration to 40%\n```\n\n## Flanger\nAdd a Flanger effect\n\n```javascript\nimport {Flanger} from 'audio-effects';\n\nconst flanger = new Flanger(audioContext);\n      flanger.delay = 0.005; // Set the delay to 0.005 seconds\n      flanger.depth = 0.002; // Set the depth to 0.002\n      flanger.feedback = 0.5; // Set the feedback to 50%\n      flanger.speed = 0.25; // Set the speed to 0.25 Hz\n```\n\n## Reverb\nAdd a Reverb effect\n\n```javascript\nimport {Reverb} from 'audio-effects';\n\nconst reverb = new Reverb(audioContext)\n      reverb.wet = 0.5; // Set the wetness to 50%\n      reverb.level = 1; // Set the level to 100%\n      ReverbNode.getInputResponseFile('path/to/input-response-file').then(buffer =\u003e {\n        reverb.buffer = buffer;\n      });\n```\n\n## Tremolo\nAdd a Tremolo effect\n\n```javascript\nimport {Tremolo} from 'audio-effects';\n\nconst tremolo = new Tremolo(audioContext);\n      tremolo.speed = 1; // Set the speed to 1Hz\n```\n\n## Chaining\nLike regular audio nodes, these nodes need to be chained together to connect the input to effects and the output.\nThe api is the same as with normal audio nodes.\n\n```javascript\ninput.connect(output);\n```\n\nUnlike their native counterparts, audio-effects' audio nodes can also be chained together.\n\n```javascript\ninput.connect(volume).connect(distortion).connect(output);\n```\n## Helper functions\nThe audio-effects library has some built-in helper functions.\n\n```javascript\nimport {HasAudioContext, HasGetUserMedia} from 'audio-effects';\n\nif (HasAudioContext) {\n    // The current browser supports the web-audio-api.\n}\n\nif (HasGetUserMedia) {\n    // The current browser supports getUserMedia.\n}\n```\n## Create your own effects\nIt is possible to create your own effects.\n\n```javascript\nimport {SingleAudioNode} from 'audio-effects';\n\nclass CustomEffect extends SingleAudioNode {\n    constructor(audioContext) {\n        super(audioContext);\n\n        // All audio nodes needed for the effect should be kept in the nodes object.\n        this.nodes = {\n            node1: audioContext.createGain(),\n            node2: audioContext.createGain(),\n            node3: audioContext.createGain(),\n        };\n\n        // Connect all nodes\n        // [node 1]--\u003e\u003e--[node 2]--\u003e\u003e--[node 3]\n        this.nodes.node1.connect(this.nodes.node2);\n        this.nodes.node2.connect(this.nodes.node3);\n\n        // Set the  input-node, this is the first node in the effect's chain.\n        this._node = this.nodes.node1;\n\n        // Set the output-node, this is the last node in the effect's chain.\n        this._outputNode = this.nodes.node3;\n    }\n\n    // Create getters and setters for the parameters you want to be customizable.\n    get gain() {\n        return this.nodes.node1.gain.value;\n    }\n\n    set gain(gain) {\n        this.nodes.node1.gain.value = parseFloat(gain);\n    }\n\n    ...\n}\n```\n\n# Todo\n- [ ] Write tests!\n- [ ] Add tuner\n- [ ] Add chorus\n- [ ] Add auto-wah\n- [ ] ...\n\n# License\n\n## The MIT License (MIT)\n\nCopyright © `2016` `Sam Bellen`\n\nPermission is hereby granted, free of charge, to any person\nobtaining a copy of this software and associated documentation\nfiles (the “Software”), to deal in the Software without\nrestriction, including without limitation the rights to use,\ncopy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the\nSoftware is furnished to do so, subject to the following\nconditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\nOF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\nNONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\nHOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\nWHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\nFROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\nOTHER DEALINGS IN THE SOFTWARE.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsambego%2Faudio-effects","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsambego%2Faudio-effects","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsambego%2Faudio-effects/lists"}