Live data from Hacker News

Ask HN: How do browsers isolate internal audio from microphone input?

news.ycombinator.com

101–106 of 106 posts

Re: Ask HN: How do browsers isolate internal audio from microphone input?

#101

Earlier quoted context omitted.

It doesn't seem to me that module-echo-cancel in Pulseaudio completely meets the requirements here (only one source), but it looks close, and seems in general like where you would implement something like this. 1. https://www.freedesktop.org/wiki/Software/PulseAudio/Documen...

I think module-null-sink and module-loopback could be used to create a virtual source which combines multiple sources, though the source/sink thing makes my head spin. Or, more simply, I suppose using the loopback of whatever audio output device does the combination (and the same mixing) for you, if you play all audio through one output device (which is most likely)?

> though the source/sink thing makes my head spin

Wait, what other audio paradigms are there?

Re: Ask HN: How do browsers isolate internal audio from microphone input?

#102
post #99

Earlier quoted context omitted.

>a PID controller, which is a form of control that only really looks at error As the name implies the PID controller relies on proportional, integral and derivative information about the error. What you mean is a purely P controller, which just relies on the error. Missiles are also not guided by a PID controller, that would be silly. They (or the guidance computer in the airplane) has to take into account the trajec…

It wouldn’t surprise me at all if early heat seeking missiles used just a PID controller, since a big part of what makes PID attractive is the ability to implement it with electrical components. Take a pair of IR photodiodes and wire them such that their difference is the error of your PID control, wire the output of the PID to the steering on your missile, and suddenly you have a missile that points at the nearest I…

"Although proportional navigation was apparently known by the Germans during World War II at Peenemu¨nde, no applications on the Hs. 298 or R-1 mis- siles using proportional navigation were reported [2]. The Lark missile, which had its first successful test in December 1950, was the first missile to use pro- portional navigation. Since that time proportional navigation guidance has been used in virtually all of the world’s tactical radar, infrared (IR), and television (TV) guided missiles [3]. The popularity of this interceptor guidance law is based upon its simplicity, effectiveness, and ease of implementation. Apparently, proportional navigation was first studied by C. Yuan and others at the RCA Laboratories during World War II under the auspices of the U.S. Navy [4]."

From Tactical and Strategic Missile Guidance Sixth Edition.

(To preempt the confusion. Proportional navigation isn't a simple P controller, the missile is seeking an intercept path)

>Not silly at all if you haven’t invented microcontrollers yet.

Apparently the Germans did try that during WW2, but such a missile can not be effective, outside of e.g. bomber intercept.

The "magic" of the AIM-9 Series is that it could achieve this without micro controllers.

Re: Ask HN: How do browsers isolate internal audio from microphone input?

#103
post #7

The way this works (and I'm obviously taking a high level view here) is by comparing what is being played to what is being captured. There is an inherent latency in between what is called the capture stream (the mic) and the reverse stream (what is being output to the speakers, be it people taking or music or whatever), and by finding this latency and comparing, one can cancel the music from the speech captured. With…

At the lowest level its a fouriertransform over a systems (your room the echochambers response is know from some testsound )and the expected output going through that transform on its way to the mic is subtracted. Most socks and machines have dedicated systems for that. The very same chip produces the echo of the surroundings.

Re: Ask HN: How do browsers isolate internal audio from microphone input?

#104

Earlier quoted context omitted.

I think module-null-sink and module-loopback could be used to create a virtual source which combines multiple sources, though the source/sink thing makes my head spin. Or, more simply, I suppose using the loopback of whatever audio output device does the combination (and the same mixing) for you, if you play all audio through one output device (which is most likely)?

> though the source/sink thing makes my head spin Wait, what other audio paradigms are there?

Dunno, I meant more that it's an unintuitive way of thinking about a data-flow graph to me, moreso when introducing virtual sinks/sources.

Re: Ask HN: How do browsers isolate internal audio from microphone input?

#105
post #32

It's called Acoustic Echo Cancellation. An implementation is included in WebRTC included in Chrome. A FIR filter (1D convolution) is applied to what the browser knows is coming out of the speakers; and this filter is continually optimized to to cancel out as much as possible of what's coming into the microphone (this is a first approximation, the actual algorithm is more involved).

To spare a search: https://webrtc.googlesource.com/src/+/refs/heads/main/module...

[dead]

Re: Ask HN: How do browsers isolate internal audio from microphone input?

#106
post #99

Earlier quoted context omitted.

It wouldn’t surprise me at all if early heat seeking missiles used just a PID controller, since a big part of what makes PID attractive is the ability to implement it with electrical components. Take a pair of IR photodiodes and wire them such that their difference is the error of your PID control, wire the output of the PID to the steering on your missile, and suddenly you have a missile that points at the nearest I…

"Although proportional navigation was apparently known by the Germans during World War II at Peenemu¨nde, no applications on the Hs. 298 or R-1 mis- siles using proportional navigation were reported [2]. The Lark missile, which had its first successful test in December 1950, was the first missile to use pro- portional navigation. Since that time proportional navigation guidance has been used in virtually all of the w…

  >The "magic" of the AIM-9 Series is that it could achieve this without micro controllers. 

The real magic were the fearless carrier pigeons and self-less kamikaze fighter pigeons missileers.
Post reply on HN