0.0.4 • Published 4 years ago

@zonesoundcreative/web-recorder v0.0.4

Weekly downloads
-
License
ISC
Repository
-
Last release
4 years ago

Recorder

This is a recorder using Web Audio API.

(Still in Development)

Buffer Length is 1024, sample rate is using WebAudio default sample rate.

How to use

Import

import Recorder from 'recorder.min.js'

Usage

First, new an instance of Recorder with media streaming source.

let recorder = new Recorder(source)

One example of getting streaming source:

//init audio context
let AudioContext = window.AudioContext|| window.webkitAudioContext;
let context = new AudioContext();

var handleSuccess = function(stream) {
    // get source (put your own stream)
    let source = context.createMediaStreamSource(stream);
    ...
}

//ask for recording permission
navigator.mediaDevices.getUserMedia({ audio: true}).then(handleSuccess)

RECORD

//start a new record
recorder.record()

//or to resume your recording
recorder.record(false);

STOP

recorder.stop()

PLAY

play the recorded buffer.

recorder.play()

GET BUFFER

get the recorded buffer.

recorder.getBuffer()
0.0.4

4 years ago

0.0.3

4 years ago

0.0.2

4 years ago

0.0.1

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago