W3C home > Mailing lists > Public > public-speech-api@w3.org > May 2012

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

From: Hans Wennborg <hwennborg@google.com>
Date: Fri, 25 May 2012 18:13:16 +0100
Message-ID: <CAB8jPhdXhDax66Q1+KpgLS+oZWa=Cr4q121N6x_NunaqsUBZpA@mail.gmail.com>
To: public-speech-api@w3.org
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 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Friday, 25 May 2012 17:14:52 GMT