diff --git a/src/pipelines/text-to-audio.js b/src/pipelines/text-to-audio.js index f56d85d80..9bb6740cf 100644 --- a/src/pipelines/text-to-audio.js +++ b/src/pipelines/text-to-audio.js @@ -18,7 +18,7 @@ import { AutoModel } from '../models.js'; /** * @typedef {Object} TextToAudioOutput - * @property {Float32Array} audio The generated audio waveform. + * @property {Float32Array|Float32Array[]} audio The generated audio waveform. * @property {number} sampling_rate The sampling rate of the generated audio waveform. * * @typedef {Object} TextToAudioPipelineOptions Parameters specific to text-to-audio pipelines. diff --git a/src/utils/audio.js b/src/utils/audio.js index 66264ed7b..3e83fb35a 100644 --- a/src/utils/audio.js +++ b/src/utils/audio.js @@ -774,7 +774,6 @@ function encodeWAV(chunks, rate) { /* data chunk length */ view.setUint32(40, totalLength * 4, true); - // @ts-expect-error TS2322 return new Blob([buffer, ...chunks], { type: "audio/wav" }); } diff --git a/webpack.config.js b/webpack.config.js index 4d8edb24f..d1e264ac2 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -171,12 +171,14 @@ const NODE_EXTERNAL_MODULES = [ "node:fs", "node:path", "node:url", + "node:stream", + "node:stream/promises", ]; // Do not bundle node-only packages when bundling for the web. // NOTE: We can exclude the "node:" prefix for built-in modules here, // since we apply the `StripNodePrefixPlugin` to strip it. -const WEB_IGNORE_MODULES = ["onnxruntime-node", "sharp", "fs", "path", "url"]; +const WEB_IGNORE_MODULES = ["onnxruntime-node", "sharp", "fs", "path", "url", "stream", "stream/promises"]; // Do not bundle the following modules with webpack (mark as external) const WEB_EXTERNAL_MODULES = ["onnxruntime-common", "onnxruntime-web"];