npm install @yoonit/javascript-recorder
import YooRecorder from '@yoonit/javascript-recorder'
const recorder = await YooRecorder()
It's important to allow microphone, to audio capture be possible.
- It starts recording audio.
recorder.start()
- Pauses current audio record.
recorder.pause()
- It stops recording and clear it.
recorder.stop()
- It clears recorded data.
recorder.clear()
- Returns captured media.
const media = await recorder.getMedia()
sendAudio(media.audioBlob)
Returns:
| Property | Description | Type |
|---|---|---|
| audio | Audio file type | wmv |
| audioBlob | Audio blob | binary |
| audioUrl | Audio URL | string |
| file | Audio file object | File |
| play | Function to play recorded audio | Function |