Skip to content

Commit ebe890d

Browse files
committed
Clamp loopStart, loopEnd and offset
Fixes #363.
1 parent df81f9d commit ebe890d

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

index.html

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2009,14 +2009,18 @@ <h2 id="AudioBufferSourceNode">The AudioBufferSourceNode Interface</h2>
20092009
An optional value in seconds where looping should begin if the
20102010
<code>loop</code> attribute is true. Its default <code>value</code> is 0,
20112011
and it may usefully be set to any value between 0 and the duration of the
2012-
buffer.
2012+
buffer. If loopStart is less than 0, looping will begin at 0. If
2013+
loopStart is greater than the duration of the buffer, looping will begin
2014+
at the end of the buffer.
20132015
</dd>
20142016
<dt>attribute double loopEnd</dt>
20152017
<dd>
20162018
An optional value in seconds where looping should end if the
20172019
<code>loop</code> attribute is true. Its default <code>value</code> is 0,
20182020
and it may usefully be set to any value between 0 and the duration of the
2019-
buffer.
2021+
buffer. If loopEnd is less than 0, looping will end at 0. If
2022+
loopEnd is greater than the duration of the buffer, looping will end
2023+
at the end of the buffer.
20202024
</dd>
20212025

20222026
<dt>
@@ -2042,7 +2046,11 @@ <h2 id="AudioBufferSourceNode">The AudioBufferSourceNode Interface</h2>
20422046
time in the buffer (in seconds) where playback will begin. If 0 is
20432047
passed in for this value, then playback will start from the beginning of
20442048
the buffer. An InvalidAccessError exception MUST be thrown if
2045-
<code>offset</code> is negative or is not a finite number.
2049+
<code>offset</code> is negative or is not a finite number. If
2050+
<code>offset</code> is less than zero, playback will begin at the
2051+
beginning of the buffer. If <code>offset</code> is greater than
2052+
<code>loopEnd</code>, playback will begin at <code>loopEnd</code>
2053+
(and immediately loop to <code>loopStart</code>).
20462054
</dd>
20472055
<dt>optional double duration</dt>
20482056
<dd>

0 commit comments

Comments
 (0)