Skip to content

Memory leak #33

Description

@mifi

not sure if i'm doing something wrong, but i'm getting a memory leak when creating many FileWriters (event though ending them properly)

const path = require('path');
const WavFileWriter = require('wav').FileWriter;

const outDir= './audio-rec';

setInterval(() => {
  const fileName = `${new Date().getTime()}.wav`;
  const outPath = path.join(outDir, fileName);
  const writer = new WavFileWriter(outPath, {
    sampleRate: 16000,
    channels: 1
  });
  const buf = Buffer.alloc(10000);
  Buffer.from([255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255]).copy(buf);
  writer.write(buf);
  setTimeout(() => writer.end(), 100);
}, 1);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions