Primary eng (and PM) emails
rt...@chromium.org, hong...@chromium.org, cwi...@google.com
Summary
Remove the doppler effect
Motivation
The doppler effect in WebAudio is an interesting effect implemented in the PannerNode but was never implemented in a general way that allows for smooth changes of position and velocity.
Compatibility Risk
Compatibility risk is large. Chrome, Firefox, and Safari have implemented the doppler effect from the very beginning of the WebAudio implementation. It is unknown how many websites actually use the doppler effect, but suspect it is relatively small. However, some of the WebAudio demos (http://googlechrome.github.io/web-audio-samples/samples/audio/doppler.html) use it.
Alternative implementation suggestion for web developers
There is no built-in alternative. Developers will need to implement the doppler effect tehmselves, perhaps using a DelayNode to model the delay caused by the relative motion between the source and destination.
Usage information from UseCounter
There are no metrics on the usage, but we will add counters for this.
Entry on chromestatus.com, crbug.com, or MDN
There is no entry currently for chromestatus.com, but one will be added shortly. crbug.com/439644 tracks the status of the deprecation and removal fo the doppler effect
Requesting approval to remove too?
No, but we plan on removing it in about 6 mo (M45). The deprecation messages will say removal in M45. This, of course, depends on the actual use metrics.
LGTM
Setting a time for removal (M45) is a bit atypical, as you say it also
must depend on actual usage. Unless the 6 month timeframe is something
already agreed to by Mozilla and/or Apple, I'd suggest not mentioning
it in the deprecation message, to potentially allow earlier removal.
If it turns out that usage is currently very low, then waiting risks
usage rising to a point where removal is more difficult. (A bit of
code being copied into a more popular Web site is all it takes.)
Raymond, do you know of any fleshed-out code example replacing the
doppler effect?
Not to down-play the trouble caused to developers, but the use counter
has now reached stable and usage is very, very low:
https://www.chromestatus.com/metrics/feature/timeline/popularity/620
Philip
Note that the way Doppler was defined in the Web Audio spec, it was simply not possible to implement generically; it was originally defined and implemented when the only source types available were BufferSourceNodes. The Doppler effect that we had implemented worked purely by walking back up a chain to the sources and changing their playbackRates; once other source types were implemented (e.g. streaming audio from <audio> elements or user media input) this was no longer tenable, since you can't "change the playback rate" on live input. In fact, we did not even implement it on OscillatorNodes, so it really does ONLY work on buffer sources.If all you have are buffer sources (all that Doppler works on today) you can just do the math to determine how fast the object is moving toward/away from you, divide by the speed of sound, add 1 and set that factor as the playbackRate (if I've done my back-of-napkin-with-no-napkin-handy) calculations correct. Additionally, the smoothing inherent by changing the playbackRate should make this sound pretty good - definitely tweakably better than the zippering caused by the Doppler effect today.The delay-node-based way is much more physically accurate, but I realized as I was mentally calculating it would be harder in practice to get the delayTime to smooth well if your framerate was inconsistent.