Re: Corner cases on start/stop exceptions

On Wed, Oct 30, 2013 at 2:52 PM, Karl Tomlinson <
karlt+public-audio@karlt.net> wrote:

> Raymond Toy writes:
>
> > A few questions on corner cases when start or stop is called too many
> > times. The spec currently says exceptions are thrown when start or stop
> is
> > called more than once.  But what should happen to the audio in the
> > following cases?
> >
> > Let c be the context and s be an oscillator
> >
> > s.start(10); s.start(0)
> >
> > The second start must throw an error, but does the oscillator start
> playing
> > after 10 sec?
> >
> > s.start(); s.stop(c.currentTime + 10); s.stop(c.currentTime + 5)
> >
> > The second stop() must throw an error, but what happens to the audio?
> Does
> > it stop at currentTime+10? Stop immediately? Something else?
>
> It think it is best if methods that throw exceptions leave no side
> effects, but, as pointed out in [1], the spec could clarify.
>
> I would expect the audio to start at 10 sec and stop at currentTime + 10.
>

This was my expectation too, but it's not clear what should happen.

--
Ray

Received on Thursday, 31 October 2013 21:07:10 UTC