Media Recorder Save In Wav Format Across Browsers
The Media Recorder Was working fantastically for me to do a fairly complicated process along with the rest of Web Audio API documented on Mozilla. However. It is useless to me unle
Solution 1:
I built a package which should do exactly what you want. It's called extendable-media-recorder. It offers the same interface as the native MediaRecorder
but allows to "extend" it with custom codecs. The example codec is wav.
Here is how you could use it to record a stream coming from getUserMedia()
:
import { MediaRecorder, register } from'extendable-media-recorder';
import { connect } from'extendable-media-recorder-wav-encoder';
awaitregister(awaitconnect());
const stream = await navigator.mediaDevices.getUserMedia({ audio: true });
const mediaRecoder = newMediaRecorder(stream, { mimeType: 'audio/wav' });
It will use the built-in MediaRecorder
to record pcm data in Chrome. In Firefox and Safari the Web Audio API is used to get the pcm data. Once the data has been retrieved it gets send to a worker which decodes it as wav.
Post a Comment for "Media Recorder Save In Wav Format Across Browsers"