Disable all audio processing

4,722 views
Skip to first unread message

Patrick

unread,
Apr 28, 2015, 2:47:04 PM4/28/15
to discuss...@googlegroups.com
I'm currently trying to get a clean as possible audio channel via webrtc. Via the getUserMedia mediaconstraints object, I've set the following options:

constraints: {
        audio
: {
            mandatory
: {
                googEchoCancellation
: false,
                googAutoGainControl
: false,
                googAutoGainControl2
: false,
                googNoiseSuppression
: false,
                googHighpassFilter
: false,
                googTypingNoiseDetection
: false,
               
//googAudioMirroring: false // For some reason setting googAudioMirroring causes a navigator.getUserMedia error:  NavigatorUserMediaError
           
}
       
},
        video
: false
   
},

This greatly improves the audio quality, but there still seems to be audio processing present which causes the mutilation of the audio in the form of high frequency noise with some of the test samples. There is also a Chrome flag --use-file-for-fake-audio-capture http://peter.sh/experiments/chromium-command-line-switches/#use-file-for-fake-audio-capture which allows input via file for testing. As mentioned in the description of the flag, all audio processing has to be disabled or the audio will be distorted - so there seems to be additional options for this purpose. I also tried the --disable-audio-track-processing --audio-buffer-size=16 --enable-exclusive-audio flags, but still there seems to be some audio processing.

Is there any way to disable the still present audio processing (preferably via JS API)?

Christoffer Jansson

unread,
Apr 29, 2015, 3:08:46 AM4/29/15
to discuss...@googlegroups.com
Certainly, you only need to pass in the echoCancellation: false  (not googEchoCancellation) constraint in order to turn off all audio processing.

--

---
You received this message because you are subscribed to the Google Groups "discuss-webrtc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to discuss-webrt...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Patrick

unread,
Apr 29, 2015, 10:08:11 AM4/29/15
to discuss...@googlegroups.com
Thanks for the quick response. I've just tried the same only setting echoCancellation: false as the sole constraint and unfortunately the same behavior still shows. I think it is some kind of voice audio optimization. Always kicks in with after x amount of time a sample has been playing.


On Wednesday, April 29, 2015 at 9:08:46 AM UTC+2, Christoffer Jansson wrote:
Certainly, you only need to pass in the echoCancellation: false  (not googEchoCancellation) constraint in order to turn off all audio processing.

Message has been deleted

Christoffer Jansson

unread,
Apr 29, 2015, 10:13:24 AM4/29/15
to discuss...@googlegroups.com
Sorry forgot to mention you need to pass it in as an optional constraint:
audio: {
      optional: [
        {echoCancellation: false}
      ]
    }

Patrick

unread,
Apr 29, 2015, 10:15:32 AM4/29/15
to discuss...@googlegroups.com
Capture.PNG

Christoffer Jansson

unread,
Apr 29, 2015, 10:18:27 AM4/29/15
to discuss...@googlegroups.com
See my latest answer about optional constraints.

Also do note that some drivers for microphones apply audio processing as well, most notably are the Logitech drivers for their cameras. "True sound" or something I believe they call it. Same is true for the built in Mic on Macbook (ambient noise suppression I believe it's called).

--

Phil

unread,
Apr 30, 2015, 2:11:06 PM4/30/15
to discuss...@googlegroups.com
@Christoffer Jansson
Ok, but lets say one uses an external audio recording device, that produces clean audio when recording an original analog signal in Adobe Audition:
That signal is passed through to a browser like Chrome the same way it is passed through to Audition (given one doesn't use any special ASIO drivers), right?

What is the difference between mandatory and optional constraints? Shouldn't the final audio connection simply fail if the constraints are impossinle to meet but stated as mandatory?

Christoffer Jansson

unread,
May 4, 2015, 5:05:21 AM5/4/15
to discuss...@googlegroups.com
On Thu, Apr 30, 2015 at 8:11 PM Phil <ph...@smart-coordination.com> wrote:
@Christoffer Jansson
Ok, but lets say one uses an external audio recording device, that produces clean audio when recording an original analog signal in Adobe Audition:
That signal is passed through to a browser like Chrome the same way it is passed through to Audition (given one doesn't use any special ASIO drivers), right?
Yes that sounds correct. 

What is the difference between mandatory and optional constraints? Shouldn't the final audio connection simply fail if the constraints are impossinle to meet but stated as mandatory?
Yes that is correct, I had a vague memory of some constraints not working with mandatory but that was not one of them or it was a long time ago. Sorry for the confusion, so yes, you could pass 
{
 "audio": {
  "mandatory": { "echoCancellation": false}
 }

or 

{
 "audio": {
  "optional": [{ "echoCancellation": false}]
 }

as audio constraints to turn off audio processing completely.

If you still think Chrome is applying some kind of processing (eliminating all other sources such as drivers, hardware and OS enhancements), please file a bug @ https://crbug.com.
Message has been deleted

Patrick

unread,
May 11, 2015, 4:47:46 AM5/11/15
to discuss...@googlegroups.com
The optional constraint dose not seem to work, when passed to the getUserMedia as constraint getUserMedia fails without giving an error output. When just passing the mandatory constraint, getUserMedia works just fine but the audio processing as described above still persists. I've created an Chrome Issue now and keep this discussion updated.

constraints: {
        audio: {
            mandatory: {
                echoCancellation: false
            },
            optional: {
                echoCancellation: false
            }
        },
        video: false
    },


On Tuesday, April 28, 2015 at 8:47:04 PM UTC+2, Patrick wrote:

Peter Boström

unread,
May 11, 2015, 4:50:32 AM5/11/15
to discuss...@googlegroups.com
(If this is "optinal:" and not "optional:" as quoted that might be your issue.)

--

Phil

unread,
May 11, 2015, 5:07:21 AM5/11/15
to discuss...@googlegroups.com
Yes, this was a typo. We fixed it, see corrected message above. 

Gio Maschio

unread,
Mar 29, 2018, 4:53:51 AM3/29/18
to discuss-webrtc
HI All,

I'm not a programmer of any sort, but also would like to remove as much noise suppression as possible from a webinar provider I use (the bits when we don't talk are useful, at the moment they are cut off). They operate on Chrome and told me I might be able to remove the processing done through Webrtc, and the webinar platform still work. 

Would any of you be able very kindly to send me an idiots guide to doing this? Hopefully I'm not a total idiot....

Many thanks

Gio
Reply all
Reply to author
Forward
0 new messages