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

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?

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 20:17:52 UTC