Skip to content

Commit

Permalink
p5.Effect: Fix drywet function bug (#606)
Browse files Browse the repository at this point in the history
  • Loading branch information
iRohitSingh authored Apr 25, 2021
1 parent 431d438 commit ae8867a
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 7 deletions.
9 changes: 7 additions & 2 deletions lib/p5.sound.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/** [p5.sound] Version: 1.0.0 - 2021-03-04 */
/** [p5.sound] Version: 1.0.0 - 2021-04-19 */
/**
* <p>p5.sound extends p5 with <a href="http://caniuse.com/audio-api"
* target="_blank">Web Audio</a> functionality including audio input,
Expand Down Expand Up @@ -1180,6 +1180,7 @@ var CustomError = function CustomError(name, errorTrace, failedPath) {

var moduleSources = [__webpack_require__(27)["default"], __webpack_require__(28)["default"], __webpack_require__(29)["default"]];
var audioWorklet_ac = master.audiocontext;
var initializedAudioWorklets = false;

function loadAudioWorkletModules() {
return Promise.all(moduleSources.map(function (moduleSrc) {
Expand All @@ -1192,6 +1193,8 @@ function loadAudioWorkletModules() {
}

p5.prototype.registerMethod('init', function () {
if (initializedAudioWorklets) return;

if (!this.preload && !window.preload) {
this.preload = function () {};
}
Expand All @@ -1200,6 +1203,8 @@ p5.prototype.registerMethod('init', function () {
this._incrementPreload();

var onWorkletModulesLoad = function () {
initializedAudioWorklets = true;

this._decrementPreload();
}.bind(this);

Expand Down Expand Up @@ -6527,7 +6532,7 @@ function () {

}, {
key: "drywet",
value: function drywet() {
value: function drywet(fade) {
if (typeof fade !== 'undefined') {
this._drywet.fade.value = fade;
}
Expand Down
2 changes: 1 addition & 1 deletion lib/p5.sound.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions lib/p5.sound.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion lib/p5.sound.min.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/effect.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ class Effect {
* @for p5.Effect
* @param {Number} [fade] The desired drywet value (0 - 1.0)
*/
drywet() {
drywet(fade) {
if (typeof fade !== 'undefined') {
this._drywet.fade.value = fade;
}
Expand Down

0 comments on commit ae8867a

Please sign in to comment.