Recorder

Recorder

This is a simple Recorder class based on https://github.com/mattdiamond/Recorderjs
This class will only output a buffer while all the audio processing work will be down in the {AudioProcesser}

Inspired by the following blog post from the Lex team:
https://aws.amazon.com/blogs/machine-learning/capturing-voice-input-in-a-browser/

Constructor

new Recorder(source, cfg)

Construct a Recorder object

Parameters:
Name Type Description
source MediaStreamAudioSourceNode

The audio node acting as source whose media is from MediaStream

cfg string

Config object to override the default config which currently only has bufferLen defaults to 8192. For more info: https://developer.mozilla.org/en-US/docs/Web/API/BaseAudioContext/createScriptProcessor

Methods

clear()

Clear the Recorder buffer. This should be called before next recording.

getBuffer() → {Float32Array}

Merge buffers and get the result containing audio data.

start()

Start Recording

stop() → {Float32Array}

Stop Recording