import { Recording } from './recorder/index.ts'; import fs from 'fs'; const file = fs.createWriteStream('test.wav', { encoding: 'binary' }); const record = new Recording({ sampleRate: 16000, channels: 1, audioType: 'wav', threshold: 0, recorder: 'rec', silence: '1.0', endOnSilence: true, }); record.stream().pipe(file); setTimeout(() => { record.stop(); process.exit(0); }, 5000);