W3C home > Mailing lists > Public > public-audio@w3.org > April to June 2012

Re: About AudioPannerNode

From: Chris Rogers <crogers@google.com>
Date: Wed, 20 Jun 2012 14:37:12 -0700
Message-ID: <CA+EzO0kX+DSXHtAmEoRAL0obcXT7OiEKx8vNEZs7-JAe-rH1nQ@mail.gmail.com>
To: Marcus Geelnard <mage@opera.com>
Cc: public-audio@w3.org
On Wed, Jun 20, 2012 at 2:40 AM, Marcus Geelnard <mage@opera.com> wrote:

> Just realized one more thing:
>
> How is the doppler effect supposed to work? I see that there is a section
> in the spec for that too [1], but it obviously needs more detail.
>
> I guess that it would be implemented using some sort of FFT-based
> pitch-shift algorithm (?).
>

Hi Marcus, I'll definitely need to add the detail in there.  The approach
I've taken so far isn't nearly as complicated as implementing a
pitch-shifting algorithm (which is hard to do well, has artifacts, and
incurs latency).  Instead, the AudioPannerNode simply keeps track of all
"up-stream" AudioBufferSourceNodes connected to it, and modifies the
internal playback rate according to the pitch-shift calculated for the
Doppler-shift.  Presumably this should also apply to Oscillator too.
 Unfortunately, this approach may not work so well for other source nodes
such as MediaElementAudioSourceNode.  I'm happy to simply spec that it only
works with AudioBufferSourceNode (and Oscillator) which I think will cover
the main use cases for games.  I'd be glad to hear your thoughts...

Cheers,
Chris


>
>
> [1] https://dvcs.w3.org/hg/audio/**raw-file/tip/webaudio/**
> specification.html#**Spatialization-doppler-shift<https://dvcs.w3.org/hg/audio/raw-file/tip/webaudio/specification.html#Spatialization-doppler-shift>
>
>
> --
> Marcus Geelnard
> Core Graphics Developer
> Opera Software ASA
>
>
Received on Wednesday, 20 June 2012 21:37:41 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 20 June 2012 21:37:42 GMT