TTS.append() (Was: Re: Speech API: first editor's draft posted)

On Fri, Apr 13, 2012 at 14:58, Jim Barnett <Jim.Barnett@genesyslab.com> wrote:
> A couple of quick comments:
> 1) The current TTS API sets the string to be played as a single action.
> Could it be useful to add an 'append' function, allowing the programmer
> to append text to the string that is already playing?  I'm thinking of
> the case where the page wants to play out a large document, possibly one
> that's being streamed from another source.  We'd have to handle the edge
> cases, of course.  For example, I think that doing an append after the
> play had stopped (when 'ended'==true) would simply set the text field
> and a new start() would be required before play would resume.

I think the web page could achieve the same effect as having an
'append' function by using the 'onend' handler on the TTS object, and
start playing the new text as soon as the old playback finishes.

Thanks,
Hans

Received on Tuesday, 24 April 2012 15:37:02 UTC