DeltaCircuit / react-media-recorder

react-media-recorder is a react component with render prop that can be used to record audio/video streams using MediaRecorder API.
https://npmjs.com/react-media-recorder
MIT License
468 stars 123 forks source link

Using audio/wav is throwing an error #100

Open AsemKakhi opened 2 years ago

AsemKakhi commented 2 years ago

You already using the extendable-media-recorder library as a dependency, which adds the support of using "audio/wav" for audio recording. but this line of code is throwing an error when I set the { mimeType: "audio/wav"}

if (!MediaRecorder.isTypeSupported(mediaRecorderOptions.mimeType)) {
  console.error(
    `The specified MIME type you supplied for MediaRecorder doesn't support this browser`,
  );
}

because "audio/wav" is not natively a supported format by the browser

Please consider fixing this I would suggest something like:

if (!MediaRecorder.isTypeSupported(mediaRecorderOptions.mimeType) && mediaRecorderOptions.mimeType.toLowerCase() !== "audio/wav") {
  console.error(
    `The specified MIME type you supplied for MediaRecorder doesn't support this browser`,
  );
}
StianHaugland1 commented 2 years ago

We have the same issue

santiarr commented 5 months ago

Facing this issue as well