[Web Audio API] copyFromChannel/copyToChannel error occurs
Categories
(Core :: Web Audio, defect, P3)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox68 | --- | fixed |
People
(Reporter: gaito, Assigned: valentin.millet39, NeedInfo)
References
()
Details
(Keywords: parity-chrome, parity-edge)
Attachments
(3 files)
User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:65.0) Gecko/20100101 Firefox/65.0
Steps to reproduce:
Call [WebAudioAPI] AudioBuffer.copyFromChannel() or AudioBuffer.copyToChannel(), with the end of the copy exceeds the size of the AudioBuffer.
const audiobuf = actx.createBuffer(1, 100, actx.sampleRate);
const buf = new Float32Array(50);
audiobuf.copyFromChannel(buf, 0, 90); // should copy from 90 to 140
audiobuf.copyToChannel(buf, 0, 90);
SampleCode is Here : https://www.g200kg.com/demo/test/copyfrom.html
Actual results:
"IndexSizeError: Index or size is negative or greater than the allowed amount"
error occurs. It is different from specification.
Expected results:
If the beginning of the copy is within the size of the AudioBuffer, no error occurs and copying until the end of the AudioBuffer should be executed.
https://webaudio.github.io/web-audio-api/#dom-audiobuffer-copyfromchannel
"1.4.3. Methods
copyFromChannel(destination, channelNumber, startInChannel)
Then the number of frames copied from buffer to destination is min(Nb-k,Nf). If this is less than Nf, then the remaining elements of destination are not modified."
Updated•6 years ago
|
Comment 1•6 years ago
|
||
Updated•6 years ago
|
Updated•6 years ago
|
| Assignee | ||
Comment 2•6 years ago
|
||
Updated•6 years ago
|
| Assignee | ||
Comment 3•6 years ago
|
||
Comment 4•6 years ago
|
||
There are some r+ patches which didn't land and no activity in this bug for 2 weeks.
:valentin.millet39, could you have a look please?
Comment 5•6 years ago
|
||
I'm going to pick this one up, this was part of a school project that is now done.
Updated•6 years ago
|
Updated•6 years ago
|
Comment 6•6 years ago
|
||
This is a no-op, but is allowed per spec:
An optional offset to copy the data to. If startInChannel is greater than the
length of the AudioBuffer, an IndexSizeError MUST be thrown.
If the numbers are equals, this shouldn't throw.
Comment 8•6 years ago
|
||
| bugherder | ||
https://hg.mozilla.org/mozilla-central/rev/fe9afae0f868
https://hg.mozilla.org/mozilla-central/rev/1c983b486cd0
https://hg.mozilla.org/mozilla-central/rev/bfebd4300498
Description
•