audio-effects
Advanced tools
Comparing version 1.0.12 to 1.0.13
{ | ||
"name": "audio-effects", | ||
"version": "1.0.12", | ||
"version": "1.0.13", | ||
"description": "A javascript library to create audio effects using the web-audio-api", | ||
@@ -5,0 +5,0 @@ "main": "src/index.js", |
@@ -134,3 +134,3 @@ # Audio-effects | ||
irf.then(buffer => { | ||
const reverb = new Reverb(audioContextbuffer); | ||
const reverb = new Reverb(audioContext, buffer); | ||
}); | ||
@@ -215,2 +215,9 @@ | ||
# Todo | ||
- [ ] Write tests! | ||
- [ ] Add tuner | ||
- [ ] Add chorus | ||
- [ ] Add auto-wah | ||
- [ ] ... | ||
# License | ||
@@ -217,0 +224,0 @@ |
@@ -13,2 +13,3 @@ import _ from 'lodash'; | ||
this._deferredConnects = []; | ||
this._hasPermissions = false; | ||
@@ -50,2 +51,7 @@ } | ||
// Connect the deffered connects | ||
this._deferredConnects.forEach(node => { | ||
this.connect(node); | ||
}); | ||
resolve(stream); | ||
@@ -62,2 +68,26 @@ }, error => { | ||
/** | ||
* Connect the effect to other effects or native audio-nodes. | ||
* @param {Native AudioNode | Audio-effects AudioNode} node | ||
* @return {Native AudioNode | Audio-effects AudioNode} | ||
*/ | ||
connect(node) { | ||
// If there is no input node yet, connect when there is a node | ||
if (typeof this._node === 'undefined') { | ||
this._deferredConnects.push(node); | ||
return; | ||
} | ||
// Check if the node is a Audio-effects AudioNode, | ||
// otherwise assume it's a native one. | ||
if (node.node) { | ||
this.node.connect(node.node); | ||
} else { | ||
this.node.connect(node); | ||
} | ||
return node; | ||
} | ||
/** | ||
* Get a list of audio in-and-output devices devices. | ||
@@ -64,0 +94,0 @@ * @return {Array} A list of the available audio in-and-output devices. |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
68091
822
247