Bug 180388 - Starting a looped AudioBufferSourceNode with offset > duration throws InvalidStateError
Summary: Starting a looped AudioBufferSourceNode with offset > duration throws Invalid...
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Audio (show other bugs)
Version: WebKit Nightly Build
Hardware: Mac macOS 10.12
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-12-04 17:44 PST by Márton Salomváry
Modified: 2017-12-05 09:54 PST (History)
1 user (show)

See Also:


Attachments
Simple test.html demonstrating the bug (738 bytes, text/plain)
2017-12-04 17:44 PST, Márton Salomváry
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Márton Salomváry 2017-12-04 17:44:37 PST
Created attachment 328418 [details]
Simple test.html demonstrating the bug

Given a buffer of 15 seconds start() on the last line in this example throws InvalidStateError: The object is in an invalid state.

    const source = context.createBufferSource()
    source.buffer = buffer
    source.loop = true
    source.connect(context.destination)
    source.start(0, 20)

Note: it does not throw when the offset is less than the length of the buffer. 

Expected: start the looped playback with 5 seconds initial offset. My understanding of the standard and the behavior in Chrome and Firefox suggest that this is a bug. See:
https://webaudio.github.io/web-audio-api/#dom-audiobuffersourcenode-start