Re: [web-audio-api] Loop event (#267)

On Thu, Oct 24, 2013 at 1:17 PM, Douglas Gore <notifications@github.com>wrote:

> For the defined number of loops use case Karl suggests using start() with
> a when offset is a feasible solution. However if I wanted to specify 100
> loops up front, I assume I have to create 100 nodes. Would that carry much
> overhead?
>

Can't you do what you want using something like

source.loop = true;
source.start(start_time);
source.stop(start_time + 100*buffer_length);

(I didn't actually try this.)

--
Ray


>
The correct solution of course would probably be to create n loops ahead
> using the onended event as a check point for creating more.
>
> Chris you make a very valid point that the loop could be extremely short
> and therefore a loop event could generate an overwhelming amount of
> activity. This would probably bring a browser / tab to its knees.
>
> I'm not sure what the impact is of creating new buffer nodes is vs being
> able to loop a single buffer node for as long as needed.
>
> Another possible solution would be if the optional duration parameter of
> start() accepted a value greater than the length of the buffer when loop is
> enabled allowing you to loop for as long as necessary. E.g. I could
> specifiy buffer.duration * 3 to get 3 loops or even 3.25 to get 3 and
> quarter loops. If the loopStart and loopEnd properties are set then this
> can be accommodated in the calculation.
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/WebAudio/web-audio-api/issues/267#issuecomment-27026097>
> .
>

Received on Thursday, 24 October 2013 23:48:29 UTC