Skip to content

Conversation

@Kaiido
Copy link
Contributor

@Kaiido Kaiido commented Dec 8, 2025

Description

Fixes the description of the AudioBufferSourceNode start()'s duration parameter so it's not said to be similar to calling stop(duration).

Motivation

Since this specs change 1 (in 2018) the duration argument is specced 2 as being the duration of the buffer's content to be played, and not necessarily the one of the AudioContext's clock. So if the source node has a playbackRate that is not 1, using this parameter will not be the same as using stop(duration).

Additional details

I based the wordings on the specs text, but I don't mind another formulation altogether.

Might also be noted that there is an interop issue here, where only Firefox does follow the specs. I'll open issues to get this sorted out though.

Related issues and pull requests

N/A

Since WebAudio/web-audio-api#1681 (in 2018) the `duration` argument is specced [1] as being the duration of the buffer's content to be played, and not necessarily the one of the AudioContext's clock. So if the source node has a `playbackRate` that is not `1`, using this parameter will not be the same as using `stop(duration)`.  

I based the wordings on the specs text, but I don't mind another formulation altogether.

Might also be noted that there is an interop issue here, where on Firefox does follow the specs. I'll open issues to get this sorted out though.

[1]: https://webaudio.github.io/web-audio-api/#dom-audiobuffersourcenode-start-when-offset-duration-duration
@Kaiido Kaiido requested a review from a team as a code owner December 8, 2025 08:07
@Kaiido Kaiido requested review from wbamberg and removed request for a team December 8, 2025 08:07
@github-actions github-actions bot added Content:WebAPI Web API docs size/s [PR only] 6-50 LoC changed labels Dec 8, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Dec 8, 2025

Preview URLs

(comment last updated: 2025-12-08 08:13:00)

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@Kaiido
Copy link
Contributor Author

Kaiido commented Dec 9, 2025

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Content:WebAPI Web API docs size/s [PR only] 6-50 LoC changed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant