diff --git a/src/factories/offline-audio-buffer-source-node.ts b/src/factories/offline-audio-buffer-source-node.ts index a5807daa7..fc6efade6 100644 --- a/src/factories/offline-audio-buffer-source-node.ts +++ b/src/factories/offline-audio-buffer-source-node.ts @@ -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( 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( this._node, output, input)); + }); return Promise .all(promises) diff --git a/src/factories/offline-audio-destination-node.ts b/src/factories/offline-audio-destination-node.ts index 489017b37..bfef42e46 100644 --- a/src/factories/offline-audio-destination-node.ts +++ b/src/factories/offline-audio-destination-node.ts @@ -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( 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( this._node, output, input)); + }); return Promise .all(promises) diff --git a/src/factories/offline-biquad-filter-node.ts b/src/factories/offline-biquad-filter-node.ts index 2fa2191db..64de74e71 100644 --- a/src/factories/offline-biquad-filter-node.ts +++ b/src/factories/offline-biquad-filter-node.ts @@ -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( 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( this._node, output, input)); + }); return Promise .all(promises) diff --git a/src/factories/offline-gain-node.ts b/src/factories/offline-gain-node.ts index b3f64389e..048e7f7fd 100644 --- a/src/factories/offline-gain-node.ts +++ b/src/factories/offline-gain-node.ts @@ -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( 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( this._node, output, input)); + }); return Promise .all(promises) diff --git a/src/factories/offline-iir-filter-node.ts b/src/factories/offline-iir-filter-node.ts index d3c4fff65..9c99617c3 100644 --- a/src/factories/offline-iir-filter-node.ts +++ b/src/factories/offline-iir-filter-node.ts @@ -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( 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( this._node, output, input)); + }); return Promise .all(promises) @@ -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)