SpeechSynthesisRecorder icon indicating copy to clipboard operation
SpeechSynthesisRecorder copied to clipboard

recorderOptions 'appendTo' option w/ constructor reformatting

Open sebscholl opened this issue 6 years ago • 2 comments

Hey guest271314 -

I've been using you're npm package for a project and thought I'd help make some improvements.

I added a new option to the recorderOptions keyword argument. The user can specify a dom selector to which the audio node element will be appended. It defaults to body.

Also, I did a little bit of organizing in the constructor and moved certain code into three prototype methods:

createAudioNode()
setMediaRecorder(stream, mime)
setMimeType()

This is simply to clean up the constructor a bit, as well as give the option in the future of cleanly allowing the user to specify options for the recorder or audio node and pass them as options.

best - S

sebscholl avatar Jul 23 '18 22:07 sebscholl