https://github.com/progfay/voice-recorder
JavaScript library for recording with microphone using Web Audio API
https://github.com/progfay/voice-recorder
javascript recorder webaudio-api
Last synced: 3 months ago
JSON representation
JavaScript library for recording with microphone using Web Audio API
- Host: GitHub
- URL: https://github.com/progfay/voice-recorder
- Owner: progfay
- Created: 2019-04-09T14:42:38.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2019-07-29T09:46:14.000Z (almost 6 years ago)
- Last Synced: 2025-01-30T20:15:58.748Z (5 months ago)
- Topics: javascript, recorder, webaudio-api
- Language: JavaScript
- Homepage:
- Size: 2.93 KB
- Stars: 1
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# voice-recorder
JavaScript dictation library with Web Audio API
## Usage
```js
const sleep = (ms) => new Promise(resolve => setTimeout(resolve, ms))navigator.mediaDevices.getUserMedia({ audio: true })
.then(async (stream) => {
const results = []
const voiceRecorder = new voiceRecorder(stream)
voiceRecorder.addEventListener('dataavailable', ({ data }) => results.push(data))
voiceRecorder.start()
await sleep(2000)
voiceRecorder.stop()
const buffer = Buffer.from(results)
})
.catch(console.error)
```