Open Bug 1618225 Opened 7 months ago Updated 4 days ago

In AudioBufferSourceNode when loop is true, duration is not taken into account

Categories

(Core :: Web Audio, enhancement, P3)

73 Branch
enhancement

Tracking

()

REOPENED
Tracking Status
firefox79 --- wontfix

People

(Reporter: kai670, Assigned: padenot, NeedInfo)

References

Details

Attachments

(4 files, 6 obsolete files)

User Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.116 Safari/537.36

Steps to reproduce:

https://jsfiddle.net/kai670/h1ex5ky8/7/

Actual results:

The sound is played in an infinite loop that never ends.

Expected results:

The sound must be played in loop during 5 seconds.

That is the behaviour in Chrome and what I understand reading the spec:

The duration parameter describes the duration of sound to be played, expressed as seconds of total buffer content to be output, including any whole or partial loop iterations. The units of duration are independent of the effects of playbackRate. For example, a duration of 5 seconds with a playback rate of 0.5 will output 5 seconds of buffer content at half speed, producing 10 seconds of audible output. A RangeError exception MUST be thrown if duration is negative.

https://www.w3.org/TR/webaudio/

Component: Untriaged → Web Audio
Product: Firefox → Core

The specified behavior changed for https://github.com/WebAudio/web-audio-api/issues/421.
The regression from that has also been resolved now.

Status: UNCONFIRMED → NEW
Type: defect → enhancement
Ever confirmed: true
Priority: -- → P3

This sets the value of stop in all the cases.

Assignee: nobody → koalab1999
Status: NEW → ASSIGNED
Attachment #9156365 - Attachment is obsolete: true

The AudioBufferSourceNode can now be looping and stop after duration.

Depends on D79873

Depends on D79874

Pushed by padenot@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/f74c10d88304
Set stop time when using loop with duration. r=padenot
https://hg.mozilla.org/integration/autoland/rev/99ac03bfe9ce
Updated mochitest for loop with duration r=padenot
https://hg.mozilla.org/integration/autoland/rev/feff7b5ed5b1
Added wpt test for loop with duration r=padenot
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/24326 for changes under testing/web-platform/tests
Flags: needinfo?(koalab1999)
Status: ASSIGNED → RESOLVED
Closed: 3 months ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla79
Flags: needinfo?(koalab1999)
Regressions: 1650030

Reopening because of the above regression.

Status: RESOLVED → REOPENED
Resolution: FIXED → ---

Backed out from trunk and beta in bug 1650030.

Target Milestone: mozilla79 → ---
Upstream PR merged by jgraham
Attachment #9164013 - Attachment is obsolete: true
Attachment #9157057 - Attachment is obsolete: true
Attachment #9157054 - Attachment is obsolete: true
Attachment #9161595 - Attachment is obsolete: true
Attachment #9157056 - Attachment is obsolete: true

It allows simpler handling of duration, and it works on looping sources.
Also removed now unnecessary calculations ont mBufferEnd to handle duration.

Depends on D84402

Depends on D84403

Let me know if you want to change NS_lround() function call too.

Depends on D84481

Attachment #9165144 - Attachment description: Bug 1618225 - Added DURATION to AudioBufferSourceNode. r?padenot → Bug 1618225 - Added DURATION to AudioBufferSourceNode. r?karlt
Attachment #9165145 - Attachment description: Bug 1618225 - Update mochitest. r?padenot → Bug 1618225 - Update mochitest. r?karlt
Attachment #9165335 - Attachment description: Bug 1618225 - Added wpt. r?padenot → Bug 1618225 - Added wpt. r?karlt

There are some r+ patches which didn't land and no activity in this bug for 2 weeks.
:koalab1999, could you have a look please?
For more information, please visit auto_nag documentation.

Flags: needinfo?(koalab1999)

I've added some test jobs to https://treeherder.mozilla.org/#/jobs?repo=try&revision=92a62d9bfad13e8a17b8377e9385ee0d1a97ed30.
If those complete successfully (or with only unrelated failures) please add the "Check-in Needed" project "Tag" to https://phabricator.services.mozilla.com/differential/revision/edit/85583/

They don't, it's probably not too hard to fix them.

Assignee: koalab1999 → padenot
You need to log in before you can comment on or make changes to this bug.