Skip to content

Commit

Permalink
Fix ArrayBuffer detach issue for noise suppression samples (#217)
Browse files Browse the repository at this point in the history
  • Loading branch information
miaobin authored Apr 1, 2024
1 parent 65e6b2b commit cf2d47a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions nsnet2/nsnet2.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,9 @@ export class NSNet2 {
'initialState155': initialState155Buffer,
};
const outputs = {
'output': outputBuffer,
'gru94': gru94Buffer,
'gru157': gru157Buffer,
'output': outputBuffer.slice(),
'gru94': gru94Buffer.slice(),
'gru157': gru157Buffer.slice(),
};
const results = await this.context_.compute(this.graph_, inputs, outputs);
return results.outputs;
Expand Down
6 changes: 3 additions & 3 deletions rnnoise/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -146,9 +146,9 @@ async function denoise() {
start = performance.now();
outputs = await rnnoise.compute(inputs, outputs);
const executionTime = (performance.now() - start).toFixed(2);
inputs.vadGruInitialH = outputs.vadGruYH;
inputs.noiseGruInitialH = outputs.noiseGruYH;
inputs.denoiseGruInitialH = outputs.denoiseGruYH;
inputs.vadGruInitialH = outputs.vadGruYH.slice();
inputs.noiseGruInitialH = outputs.noiseGruYH.slice();
inputs.denoiseGruInitialH = outputs.denoiseGruYH.slice();

start = performance.now();
const output = analyser.postProcessing(outputs.denoiseOutput);
Expand Down

0 comments on commit cf2d47a

Please sign in to comment.