-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Electron App fails on MediaRecorder mimeType when using 'audio/wav' #649
Comments
Hi @fpassa, do you somewhere add the WAV codec? You need to call Maybe that is already enough to fix the problem. |
Thanks for your quick reply, however, I've no idea how to do it, because there is no documentation available around it. May you please provide documentation/code example? |
It's already part of the example code in the README. I know it's a bit cumbersome to call those functions but it was necessary to separate the In your case you could do it while you are waiting for the user media. Promise.all([
connect().then(register),
navigator.mediaDevices.getUserMedia({
audio: {deviceId: deviceA}
})
]).then(([, stream]) => {
const mediaRecorder = new MediaRecorder(stream, { mimeType: 'audio/wav' });
// ...
}) I hope that helps. |
Hi Chris, On the other hands, how should I insert that code snippet in below code?
Thanks in advance |
I was referring to the README of this repository. Does the code that you posted above not work? There are some things that could be tweaked but it looks alright to me. Do you get any error? |
Oh I see, sorry about it. Well, I changed a couple of things as I added a separated setup function like this:
The mimeType error is gone, it's like accepting the mimetype audio/wav. However, my issue now is that I'm not getting anything saved in the destination file, even though I've data in recordedChunks variable. Just wondering if I still need to call the new Blob or if the encoder returns it already. Any idea on that? |
I fixed the saveFile issue, but end results is a mono wav, instead of stereo. Should I add something else in the MediaRecorder(stream, {mimeType : "audio/wav"}) function? |
Never mind, fixed already by adding this:
|
Thanks for reporting back. I'm happy to hear that you solved the issue. |
I'm using the following code in my Electron App:
When attempting to open the mediaRecorder, I can see the following error in the console:
DOMException: Failed to construct 'MediaRecorder': Failed to initialize native MediaRecorder the type provided (audio/wav) is not supported.
at /Users/eapp/node_modules/extendable-media-recorder/build/es5/bundle.js:405:35
at new MediaRecorder (/Users/eapp/node_modules/extendable-media-recorder/build/es5/bundle.js:244:15)
at file:///Users/eapp/src/index.js:741:31
The text was updated successfully, but these errors were encountered: