Skip to content

Commit

Permalink
fix iteration bug
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisguttandin committed May 5, 2017
1 parent c5d552b commit 61145dd
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 18 deletions.
9 changes: 6 additions & 3 deletions src/factories/offline-audio-buffer-source-node.ts
Expand Up @@ -218,9 +218,12 @@ export class OfflineAudioBufferSourceNodeFaker implements IOfflineAudioNodeFaker

const promises = Array
.from(this._sources)
.map(([ source, { input, output } ]) => source
.render(offlineAudioContext)
.then((node) => node.connect(<AudioBufferSourceNode> this._node, output, input)));
.map(([ source, { input, output } ]) => {
// For some reason this currently needs to be a function body with a return statement. The shortcut syntax causes an error.
return source
.render(offlineAudioContext)
.then((node) => node.connect(<AudioBufferSourceNode> this._node, output, input));
});

return Promise
.all(promises)
Expand Down
9 changes: 6 additions & 3 deletions src/factories/offline-audio-destination-node.ts
Expand Up @@ -68,9 +68,12 @@ export class OfflineAudioDestinationNodeFaker implements IOfflineAudioNodeFaker

const promises = Array
.from(this._sources)
.map(([ source, { input, output } ]) => source
.render(offlineAudioContext)
.then((node) => node.connect(<AudioDestinationNode> this._node, output, input)));
.map(([ source, { input, output } ]) => {
// For some reason this currently needs to be a function body with a return statement. The shortcut syntax causes an error.
return source
.render(offlineAudioContext)
.then((node) => node.connect(<AudioDestinationNode> this._node, output, input));
});

return Promise
.all(promises)
Expand Down
9 changes: 6 additions & 3 deletions src/factories/offline-biquad-filter-node.ts
Expand Up @@ -275,9 +275,12 @@ export class OfflineBiquadFilterNodeFaker implements IOfflineAudioNodeFaker {

const promises = Array
.from(this._sources)
.map(([ source, { input, output } ]) => source
.render(offlineAudioContext)
.then((node) => node.connect(<BiquadFilterNode> this._node, output, input)));
.map(([ source, { input, output } ]) => {
// For some reason this currently needs to be a function body with a return statement. The shortcut syntax causes an error.
return source
.render(offlineAudioContext)
.then((node) => node.connect(<BiquadFilterNode> this._node, output, input));
});

return Promise
.all(promises)
Expand Down
9 changes: 6 additions & 3 deletions src/factories/offline-gain-node.ts
Expand Up @@ -109,9 +109,12 @@ export class OfflineGainNodeFaker implements IOfflineAudioNodeFaker {

const promises = Array
.from(this._sources)
.map(([ source, { input, output } ]) => source
.render(offlineAudioContext)
.then((node) => node.connect(<GainNode> this._node, output, input)));
.map(([ source, { input, output } ]) => {
// For some reason this currently needs to be a function body with a return statement. The shortcut syntax causes an error.
return source
.render(offlineAudioContext)
.then((node) => node.connect(<GainNode> this._node, output, input));
});

return Promise
.all(promises)
Expand Down
21 changes: 15 additions & 6 deletions src/factories/offline-iir-filter-node.ts
Expand Up @@ -327,9 +327,15 @@ export class OfflineIIRFilterNodeFaker implements IOfflineAudioNodeFaker {

const promises = Array
.from(this._sources)
.map(([ source, { input, output } ]) => source
.render(offlineAudioContext)
.then((node) => node.connect(<IIRFilterNode> this._node, output, input)));
.map(([ source, { input, output } ]) => {
/*
* For some reason this currently needs to be a function body with a return statement. The shortcut syntax causes an
* error.
*/
return source
.render(offlineAudioContext)
.then((node) => node.connect(<IIRFilterNode> this._node, output, input));
});

return Promise
.all(promises)
Expand All @@ -345,9 +351,12 @@ export class OfflineIIRFilterNodeFaker implements IOfflineAudioNodeFaker {

const promises = Array
.from(this._sources)
.map(([ source, { input, output } ]) => source
.render(partialOfflineAudioContext)
.then((node) => node.connect(partialOfflineAudioContext.destination, output, input)));
.map(([ source, { input, output } ]) => {
// For some reason this currently needs to be a function body with a return statement. The shortcut syntax causes an error.
return source
.render(partialOfflineAudioContext)
.then((node) => node.connect(partialOfflineAudioContext.destination, output, input));
});

return Promise
.all(promises)
Expand Down

0 comments on commit 61145dd

Please sign in to comment.