Re: Calling start() on an already started SpeechRecognition object

On Thu, May 24, 2012 at 1:55 PM, Hans Wennborg <hwennborg@google.com> wrote:
> On Wed, May 16, 2012 at 2:37 PM, Hans Wennborg <hwennborg@google.com> wrote:
>> Hi all,
>>
>> The spec should say what happens when calling start() on an already
>> started SpeechRecognition object, and calling stop() or abort() on a
>> non-started object.
>>
>> Do we want to throw an exception? Fire an error event? Do nothing?
>
> If there are no objections, I'll update the draft tomorrow to say that
> calling start() on an already started SpeechRecognition object causes
> an InvalidStateError [1] exception to be thrown, and the same for
> stop() and abort() on a non-started object.

I've updated the spec: http://dvcs.w3.org/hg/speech-api/rev/386b0c5dd555

I changed my mind about throwing exceptions for calling stop() or
abort() on already stopped (or non-started) objects. I think we should
just ignore such calls instead. This way, web pages can call these
functions as part of clean-up code without worrying about catching an
exception or trying to keep track of whether the object was started or
not.

Thanks,
Hans

Received on Friday, 25 May 2012 17:14:50 UTC