|
From: Reece D. <ms...@go...> - 2009-05-19 11:43:00
|
2009/5/19 Jonathan Duddington <jo...@js...>: > On 19 May, Reece Dunn <ms...@go...> wrote: > >> The eSpeak engine is using the speak_lib.h API. At the moment, there >> are a few issues with the eSpeak engine: >> * the speak_lib.h API does not report the sentence length, so >> cannot correctly highlight the sentences being read. > > The events list which eSpeak passes to your SynthCallback() callback > function includes events which indicate the start of each word and > sentence (espeakEVENT_WORD and espeakEVENT_SENTENCE). So you can > highlight each word or each sentence as it is being read. If I handle espeakEVENT_WORD, the espeak_EVENT.length contains the length of the word being spoken, but espeakEVENT_SENTENCE returns 0. I am using espeak_EVENT.text_position to get the offset (which works for both events). How do I determine how long the sentence is? Even from the API docs: > int text_position; // the number of characters from the start of the text > int length; // word length, in characters (for espeakEVENT_WORD) >> * the speak_lib.h API does not support phrase events, so the UI >> treats them the same as sentences. > > Please explain what you mean by a "phrase event". How do you define a > "phrase"? You should be able to use the espeakEVENT_WORD events to > match the current speaking position with words on your text, and > therefore determine which phrase is being spoken. When using the phrase event in Cepstral, it returns the range between the current speaking position and any commas, semi-colons, etc. E.g. "Hello, how are you?" would be split into "Hello," and "how are you?" phrases. >> * there is no pause functionality available in speak_lib.h, so this >> option is disabled. > > You could implement pause by either of two methods: > > 1. Stop speaking, and note the position of the last word that was > spoken (using the espeakEVENT_WORD event). To resume, start speaking > from the next word in the text. > > or > > 2. Don't let your SynthCallback() function return until you want to > resume speaking text. The first method would probably be easiest to implement. Thanks for the feedback, - Reece |