- From: Glen Shires <gshires@google.com>
- Date: Tue, 16 Oct 2012 09:58:04 -0700
- To: public-speech-api@w3.org
- Message-ID: <CAEE5bcg7tw99wRGcds9MZOs+UZpVL4Cn5Mj4y==WBW2WFmYaKg@mail.gmail.com>
I've updated the spec with the changes proposed in this thread:
- Removed static from SpeechSynthesis interface.
- Changed speak method to not copy utterance.
- Fixed Speech Synthesis Example 2.
https://dvcs.w3.org/hg/speech-api/rev/cc2dddb63c8d
As always, the current draft spec is at:
http://dvcs.w3.org/hg/speech-api/raw-file/tip/speechapi.html
/Glen Shires
On Sun, Oct 14, 2012 at 11:21 AM, Glen Shires <gshires@google.com> wrote:
> Also, there's a syntax error in the first line of Speech Synthesis Example
> 2. (The Example section is non-normative.)
> SpeechSynthesisUtterance u;
> should be
> var u = new SpeechSynthesisUtterance();
>
> If no disagreement, I'll update the spec on Tuesday with this.
> Glen Shires
>
> On Sat, Oct 13, 2012 at 8:31 PM, Glen Shires <gshires@google.com> wrote:
>
>> OK, if no disagreement, I'll update the spec on Tuesday to remove
>> "static" from all elements in interface SpeechSynthesis.
>>
>> Glen Shires
>>
>>
>> On Sat, Oct 13, 2012 at 5:35 PM, Olli Pettay <Olli.Pettay@helsinki.fi>wrote:
>>
>>> On 10/14/2012 01:27 AM, Glen Shires wrote:
>>>
>>>> I agree.
>>>>
>>>> Also, is there any reason not to remove "static" from the following?
>>>> If not, I propose removing it here too.
>>>>
>>>> static readonly attribute boolean pending;
>>>> static readonly attribute boolean speaking;
>>>> static readonly attribute boolean paused;
>>>>
>>>> static SpeechSynthesisVoiceList getVoices();
>>>>
>>>>
>>> Right. I'd be surprised if anything needs to be 'static'
>>>
>>>
>>>
>>> Glen Shires
>>>>
>>>>
>>>> On Sat, Oct 13, 2012 at 7:56 AM, Olli Pettay <Olli.Pettay@helsinki.fi<mailto:
>>>> Olli.Pettay@helsinki.**fi <Olli.Pettay@helsinki.fi>>> wrote:
>>>>
>>>> static void speak(SpeechSynthesisUtterance utterance);
>>>> static void cancel();
>>>> static void pause();
>>>> static void resume();
>>>>
>>>> Those shouldn't be static.
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> On 10/12/2012 01:42 PM, Olli Pettay wrote:
>>>>
>>>> On 10/12/2012 04:41 AM, Glen Shires wrote:
>>>>
>>>> I propose the following change to the SpeechSynthesis IDL
>>>> to use a callback instead of events. It doesn't change functionality, but
>>>> does
>>>> make the IDL
>>>> more well-defined and conventional. (The current IDL breaks
>>>> platform conventions, because the speak() method makes a copy of utterance,
>>>> and thus
>>>> event.target cannot be properly defined, nor can
>>>> addEventListener be used in the conventional manner.) The
>>>> SpeechSynthesisEvent object is
>>>> renamed SpeechSynthesisUpdate (because it is no longer an
>>>> event, but rather a callback). If there's no disagreement, I'll update the
>>>> spec
>>>> with this
>>>> on Monday.
>>>>
>>>> callback SpeechSynthesisCallback = void
>>>> (SpeechSynthesisUpdate update);
>>>>
>>>> interface SpeechSynthesis {
>>>> ...
>>>> static void speak(SpeechSynthesisUtterance
>>>> utterance, SpeechSynthesisCallback callback);
>>>> };
>>>>
>>>> interface SpeechSynthesisUpdate {
>>>> enum UpdateType {
>>>> "start",
>>>> "end",
>>>> "pause",
>>>> "resume",
>>>> "mark",
>>>> "boundary",
>>>> "error"
>>>> };
>>>> readonly attribute UpdateType type;
>>>> readonly attribute unsigned long charIndex;
>>>> readonly attribute float elapsedTime;
>>>> readonly attribute DOMString name;
>>>> };
>>>>
>>>> /Glen Shires
>>>>
>>>>
>>>> Looks odd to me.
>>>>
>>>> Shouldn't it be
>>>> interface SpeechSynthesis : EventTarget
>>>> {
>>>> void speak(SpeechSynthesisUtterance utterance);
>>>> EventHandler onspeak;
>>>> }
>>>>
>>>> That way one doesn't need to pass callback to the speak method
>>>> all the time.
>>>> Just registering once is enough.
>>>>
>>>>
>>>>
>>>>
>>>> -Olli
>>>>
>>>>
>>>>
>>>>
>>>
>>
>
Received on Tuesday, 16 October 2012 16:59:16 UTC