• This project
    • Loading...
  • Sign in

천현우 / Voicoding

%ea%b7%b8%eb%a6%bc1
Go to a project
Toggle navigation Toggle navigation pinning
  • Projects
  • Groups
  • Snippets
  • Help
  • Project
  • Activity
  • Repository
  • Pipelines
  • Graphs
  • Issues 0
  • Merge Requests 0
  • Wiki
  • Snippets
  • Network
  • Create a new issue
  • Builds
  • Commits
  • Issue Boards
  • Files
  • Commits
  • Network
  • Compare
  • Branches
  • Tags
Switch branch/tag
  • Voicoding
  • node_modules
  • node-record-lpcm16
  • examples
  • pause-resume.js
  • 천현우's avatar
    add modules · 83582752
    83582752
    천현우 authored 2021-05-25 17:56:41 +0900
pause-resume.js 380 Bytes
Raw Blame History Permalink
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
'use strict'

const recorder = require('../')
const fs = require('fs')

const file = fs.createWriteStream('test.wav', { encoding: 'binary' })

const recording = recorder.record({
  sampleRate: 44100
})

recording.stream().pipe(file)

setTimeout(() => {
  recording.pause()
}, 1000)

setTimeout(() => {
  recording.resume()
}, 2000)

setTimeout(() => {
  recording.stop()
}, 3000)