Closed
Bug 956489
Opened 11 years ago
Closed 11 years ago
AudioBufferSourceNode.start treats the 'when' parameter as relative to source creation time
Categories
(Core :: Web Audio, defect, P2)
Tracking
()
RESOLVED
DUPLICATE
of bug 943461
mozilla29
People
(Reporter: cwiiis, Assigned: rfw)
References
Details
Attachments
(2 files, 1 obsolete file)
When calling start on an AudioBufferSourceNode with the context's currentTime, it seems that this parameter is treated as relative and it will start currentTime seconds in the future.
This contradicts the specification[1], which says that the 'when' parameter is in the same coordinate system as currentTime, and that any time less than currentTime indicates immediate start, which strongly infers that calling start with currentTime is equivalent to calling start with 0.
In my testing, calling start with the context's currentTime causes the sound to play approximately currentTime seconds in the future.
[1] https://dvcs.w3.org/hg/audio/raw-file/tip/webaudio/specification.html#methodsandparams-AudioBufferSourceNode
I haven't quite figured out how 'stop' interprets its 'when' parameter, but I've not managed to get it to behave in any consistent way :(
Comment 1•11 years ago
|
||
This plays as expected for me, with pulseaudio.
Does each button start a tone more or less immediately on your system?
Reporter | ||
Comment 2•11 years ago
|
||
(In reply to Karl Tomlinson (:karlt) from comment #1)
> Created attachment 8355965 [details]
> testcase
>
> This plays as expected for me, with pulseaudio.
>
> Does each button start a tone more or less immediately on your system?
This is odd, your example works, but my code does not. My code works correctly in Chrome. Perhaps because my buffers are created from oggs?
I'll see if I can make a small test-case.
Reporter | ||
Comment 3•11 years ago
|
||
Also worth noting, I'm using looping audio when I experience this problem, that also may affect results.
Reporter | ||
Comment 4•11 years ago
|
||
(In reply to Chris Lord [:cwiiis] from comment #3)
> Also worth noting, I'm using looping audio when I experience this problem,
> that also may affect results.
disregard this, I see you are in your code too.
Reporter | ||
Comment 5•11 years ago
|
||
This is attachment #8355965 [details], modified slightly to better represent how I'm using web audio, that exhibits the error I mention.
Reporter | ||
Comment 6•11 years ago
|
||
It seems the issue is that the source's treatment of currentTime is frozen to its creation time? Chrome behaves correctly in this situation.
Reporter | ||
Comment 7•11 years ago
|
||
Changing bug title to better describe the bug.
Summary: AudioBufferSourceNode.start treats the 'when' parameter as relative → AudioBufferSourceNode.start treats the 'when' parameter as relative to source creation time
Updated•11 years ago
|
Attachment #8355965 -
Attachment description: testcase → testcase that works as expected
Attachment #8355965 -
Attachment is obsolete: true
Comment 8•11 years ago
|
||
It's as if (time_of_start_call - time_of_node_creation) is added to the |when| parameters.
OS: Windows 8.1 → All
Reporter | ||
Comment 9•11 years ago
|
||
Another note, even employing the work-around of not creating the source until it's needed, I'm getting odd treatments of 'when' on Android Nightly (but working fine in Android release).
I've yet to pinpoint what this issue is, but if it's sufficiently different, I'll file a new bug for it.
Comment 10•11 years ago
|
||
Is this WebKit bug relevant here? https://bugs.webkit.org/show_bug.cgi?id=114923
Reporter | ||
Comment 11•11 years ago
|
||
(In reply to :Ehsan Akhgari (needinfo? me!) from comment #10)
> Is this WebKit bug relevant here?
> https://bugs.webkit.org/show_bug.cgi?id=114923
No, I don't think so.
Comment 12•11 years ago
|
||
Karl -- This sounds like a high P2 to me, but if you and/or Paul think this is an important use case (especially for games), please re-prioritize higher. Thanks.
Assignee: nobody → karlt
Priority: -- → P2
Comment 14•11 years ago
|
||
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → DUPLICATE
Target Milestone: --- → mozilla29
Updated•11 years ago
|
Flags: in-testsuite?
Assignee | ||
Comment 15•11 years ago
|
||
Here is a Mochitest test case that tests for this bug.
Comment 16•11 years ago
|
||
Assignee: karlt → tony
Flags: in-testsuite? → in-testsuite+
Comment 17•11 years ago
|
||
You need to log in
before you can comment on or make changes to this bug.
Description
•