mozmorris / react-webcam

Webcam component
https://codepen.io/mozmorris/pen/JLZdoP
MIT License
1.63k stars 281 forks source link

Sound is very low quality and cutting out no matter what mic even with professional equipment. #393

Closed vltmedia closed 7 months ago

vltmedia commented 7 months ago

Please follow the general troubleshooting steps first:

Tested OS/Browsers:

Bug reports:

No matter what OS we use (Mac, Windows, Linux) we get terrible audio quality, no matter the input device. We have tested with built-in mics, a UAD Apollo, and multiple webcams. The mics into the Apollo sound fine either way using other software. The audio sounds like it's at a low sample rate.

There also seems to be a denoising or something happening to the audio. It seems like it's dropping out.

Example Recorded Video

The code we tested was the minimal example:

import React from "react";

import Webcam from "react-webcam";

export default function App() {
  return (
    <div className="App">
      <Webcam />
    </div>

  );
}
vltmedia commented 7 months ago

Well we got it to a good place by using the audioContraints prop.

It'd be awesome if y'all had autoGainControl and noiseSuppression false by default or explicitly add it to the README.md so that other users are aware of the noiseSuppression.


import React from "react";

import Webcam from "react-webcam";

 const audioConstraints = {
      autoGainControl: false,
      channelCount: 1,
      echoCancellation: false,
      latency: 0,
      noiseSuppression: false,
      sampleRate: 48000,
      sampleSize: 16,
      volume: 1.0
    };

export default function App() {
  return (
    <div className="App">
      <Webcam audioConstraints={audioConstraints} />
    </div>

  );