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

Re: decodeAudioData and resampling

From: Patrick Borgeat <patrick.borgeat@gmail.com>
Date: Wed, 5 Dec 2012 08:24:29 +0100
Message-ID: <CALGTrTuWCk7j_xiyUM+mDOO_hfo2siN=9q_xWnPU6A3uv3-LNA@mail.gmail.com>
To: Chris Rogers <crogers@google.com>
Cc: Ehsan Akhgari <ehsan@mozilla.com>, public-audio@w3.org
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.


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 07:33:28 UTC

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