SpeechSynthesisRecorder
SpeechSynthesisRecorder copied to clipboard
recorderOptions 'appendTo' option w/ constructor reformatting
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