- From: Ehsan Akhgari <ehsan.akhgari@gmail.com>
- Date: Thu, 12 Sep 2013 10:10:24 +0200
- To: Marcus Geelnard <mage@opera.com>
- Cc: "Robert O'Callahan" <robert@ocallahan.org>, "public-audio@w3.org" <public-audio@w3.org>
- Message-ID: <CANTur_64jgGZk_czUw=91ZECKhHBUOn9o3aYGHKvmVXA-sEA+Q@mail.gmail.com>
I think in copyToChannel, start should indicate the offset in the channel data living inside the AudioBuffer to start writing into, as opposed to an offset into the source argument, since source can be a view into another ArrayBuffer if needed. With that correction, this seems fine to me. Cheers, -- Ehsan <http://ehsanakhgari.org/> On Fri, Sep 6, 2013 at 9:50 AM, Marcus Geelnard <mage@opera.com> wrote: > 2013-09-06 04:34, Robert O'Callahan skrev: > > This is what I proposed: > > partial interface AudioBuffer { > void copyChannelDataTo(long channelNumber, unsigned long start, unsigned > long length, Float32Array destination); > } > > I agree with Jer that it makes sense to have a corresponding method to > write into channel buffers. > > > Me too. > > > > We could call it copyChannelData>From but i think that might get a little > confusing. We can also make 'length' optional. So here's my revised > proposal: > > partial interface AudioBuffer { > void copyFromChannel(Float32Array destination, long channelNumber, > unsigned long start, optional unsigned long length); > void copyToChannel(Float32Array source, long channelNumber, unsigned > long start, optional unsigned long length); > } > > In both methods, 'length' defaults to the array's length. An exception > is thrown if start+length is greater than the ArrayBuffer's length or if > the array length is less than 'length'. I put the array first so that the > parameters identifying the channel and the channel data range are together. > > > This sounds perfectly OK to me. > > /Marcus > > > > I'd like to get this implemented in Gecko ASAP, so please bikeshed in a > timely manner :-). > > Rob > -- > Jtehsauts tshaei dS,o n" Wohfy Mdaon yhoaus eanuttehrotraiitny eovni > le atrhtohu gthot sf oirng iyvoeu rs ihnesa.r"t sS?o Whhei csha iids teoa > stiheer :p atroa lsyazye,d 'mYaonu,r "sGients uapr,e tfaokreg iyvoeunr, > 'm aotr atnod sgaoy ,h o'mGee.t" uTph eann dt hwea lmka'n? gBoutt uIp > waanndt wyeonut thoo mken.o w * > * > > > > -- > Marcus Geelnard > Technical Lead, Mobile Infrastructure > Opera Software > >
Received on Thursday, 12 September 2013 08:11:40 UTC