Closed Bug 1012610 Opened 11 years ago Closed 9 years ago

Web Audio API: Panner Node glitches when position parameter cross 0 value.

Categories

(Core :: Web Audio, defect, P2)

29 Branch
x86
macOS
defect

Tracking

()

RESOLVED DUPLICATE of bug 957024

People

(Reporter: notthetup, Unassigned)

References

Details

(Whiteboard: [quality])

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/34.0.1847.137 Safari/537.36 Steps to reproduce: 1. Visit http://jsfiddle.net/notthetup/qWHAt/ 2. Click on "Play Tone" or "Play Ambience" 3. Drag the slider across the 0 value. Actual results: The audio glitches when the position parameter value changes from >0 to ==0. Expected results: The audio should crossfade smoothly between left and right audio channel.
The jsfiddle lets you switch between both HRTFPanner and EqualPowerPanner. The glitch is audible at various levels using either of the Panning Models. Also with HRTFPanner, at init (position set to 0), it seems to mute the sound, until the position parameter is changed for the first time.
(In reply to Chinmay Pendharkar from comment #1) > Also with HRTFPanner, at init (position set to 0), it seems to mute the > sound, until the position parameter is changed for the first time. I suspect that is due to the default distance model being "inverse" and so the distanceGain is infinite at 0. I don't know why equalpower is behaving differently at 0 with the mono source. There may still be glitches even if the rolloffFactor is set to zero to eliminate the effect of the distance model, but I think PannerNode was designed expecting sources to move around or in front of the listener rather than through the middle of the listener's head.
Priority: -- → P3
OK. distanceGain going to infinity makes sense mathematically. But making that completely silent if distanceGain is infinity might not be the best solution. I spent a good 5 minutes trying to figure out why there was no sound coming out of the panner. But maybe it's not something the platform needs to handle. Users will be able to work around it. (In reply to Karl Tomlinson (needinfo?:karlt) from comment #2) > PannerNode was designed expecting sources to move around or in front of the listener rather > than through the middle of the listener's head. Agreed. But there are two issues. Firstly the glitching doesn't go away completely if the x,y properties of the position are set to low non-zero values. I'm not sure if it's because of rolloffFactor being set to zero, but in the jsfiddle example, it's set to the default (1?). Secondly, in use cases like 3D gaming, it's hard to ensure that a source doesn't move through the listener's 'head'. Moving through the listener's 'head' can happen even in a full 3D environment depending on the way a player/source moves etc. Having the audio glitch at that moment would be a really bad experience. Also, for simple 2D panning (L-R), used in DAW, Studio type applications, the PannerNode is the only native functionality offered by the WebAudioAPI. I hope equalpower panning mode supports basic L-R panning without glitching for those type of applications.
Status: UNCONFIRMED → NEW
Ever confirmed: true
This may be a dup...
Whiteboard: [quality]
The spec has since changed so as not to amplify when the distance is closer than the reference distance: https://github.com/WebAudio/web-audio-api/pull/610/commits/31b9f642fd98a1888382df0da1a602f94f1bc8dc
Priority: P3 → P2
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.