W3C home > Mailing lists > Public > public-audio@w3.org > October to December 2012

Re: decodeAudioData and resampling

From: Chris Rogers <crogers@google.com>
Date: Wed, 5 Dec 2012 08:54:08 -0800
Message-ID: <CA+EzO0=1Zco0O2-aiJBzgpNzjUtpXux31Z7pw2-rsn7xOKBfFw@mail.gmail.com>
To: Patrick Borgeat <patrick.borgeat@gmail.com>
Cc: Ehsan Akhgari <ehsan@mozilla.com>, public-audio@w3.org
On Tue, Dec 4, 2012 at 11:24 PM, Patrick Borgeat

> Is there a way to circumvent this? For example if I don't want to decode
> an audio file for playback but just to get the channelData to do some
> calculations or something. createBuffer does sample rate conversion as well.

Not currently, but we could add an extra optional parameter to these

> cheers,
> Patrick
> 2012/12/4 Chris Rogers <crogers@google.com>
>> Hi Ehsan, sorry the spec isn't clear about this.  The intended behavior
>> is for the implementation to resample the decoded audio data to the
>> AudioContext sample-rate as part of the decodeAudioData() operation.  This
>> is so that we don't have to resample the data at playback time, which can
>> get very expensive especially with several sources playing back at the same
>> time.  Sample-rate converting up-front allows us to use higher-quality
>> sample-rate conversion algorithms, since it's easier to afford the
>> expensive algorithms.
Received on Wednesday, 5 December 2012 16:54:36 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 19:03:14 UTC