The following Patent Application is hereby fully incorporated by reference, and priority is claimed therefrom; MIDDLEWARE LAYER BETWEEN SPEECH RELATED APPLICATIONS AND ENGINES, filed on Dec. 29, 2000, Ser. No. 09/751,836.
The Present invention deals with services for enabling speech recognition and speech synthesis technology. In particular, the present invention relates to an event notification system in a middleware layer which lies between speech related applications and speech related engines.
Speech synthesis engines typically include a decoder which receives textual information and converts it to audio information which can be synthesized into speech on an audio device. Speech recognition engines typically include a decoder which receives audio information in the form of a speech signal and identifies a sequence of words from the speech signal.
In the past, applications which invoked these engines communicated directly with the engines. Because the engines from each vendor interacted with applications directly, the behavior of that interaction was unpredictable and inconsistent. This made it virtually impossible to change synthesis or recognition engines without inducing errors in the application. It is believed that, because of these difficulties, speech recognition technology and speech synthesis technology have not quickly gained wide acceptance.
In an effort to make such technology more readily available, an interface between engines and applications was specified by a set of application programming interfaces (API's) referred to as the Microsoft Speech API version 4.0 (SAPI4). Though the set of API's in SAPI4 specified direct interaction between applications and engines, and although this was a significant step forward in making speech recognition and speech synthesis technology more widely available, some of these API's were cumbersome to use, required the application to be apartment threaded, and did not support all languages.
The process of making speech recognition and speech synthesis more widely available has encountered other obstacles as well. For example, the vendors of applications and engines have been required to write an enormous amount of code simply to implement the different interfaces for the different applications and engines that can be used together. In such systems, event notification is very cumbersome. The engines are required to notify the applications directly of events, such as word boundaries, visemes, bookmarks, etc. This has required engines to know exactly how the application wished to be notified of such events. Similarly, output devices (such as audio devices in a text-to-speech system) have also been required to know when events are occurring and how an application wishes to be notified of the events. Since applications traditionally can be notified of events in one of a number of different ways, this required specific code to be written to interface to specific applications.
The present invention is directed to a system and method of notifying a speech related application of events generated by a speech related engine. A middleware layer receives a notification selection from the application. The notification selection is indicative of a selected notification mechanism for notifying the application of the events. The middleware component receives an event indication from the engine. The event indication is indicative of an event generated by the engine. The event indication is transferred to the application according to the selected notification mechanism.
In one embodiment, the event indication is first transferred to an output device, from the middleware component, which notifies the middleware component when it has reached the event in an output data stream. The middleware component then retrieves the event indication from the output device and transmits it to the application.
In another embodiment, prior to transferring the event indication to the application, the middleware component receives an interest indication from the application indicative of events that the application is interested in. When the middleware component receives an event notification from the output device, it first determines whether the application is interested in the event by comparing the event to the interest indication received from the application.
In another embodiment, the middleware component initializes a notification assistance component based on the notification selection made by the application. The notification assistance component notifies the application of the event according to the selected notification mechanism.
The present invention can also be embodied as a method and apparatus for synchronizing a speech related output with processing within an application. A speech related data stream to be processed is received at a middleware component between the engine and the application. The speech related data stream is transferred from the application to the speech related engine and is processed by the engine. Event indications from the engine are received at the middleware component. The event indications contain information that identifies an event and a position of the event in the data stream. The middleware component transmits the event and position to the application.
The invention is operational with numerous other general purpose or special purpose computing system environments or configurations. Examples of well known computing systems, environments, and/or configurations that may be suitable for use with the invention include, but are not limited to, personal computers, server computers, hand-held or laptop devices, multiprocessor systems, microprocessor-based systems, set top boxes, programmable consumer electronics, network PCs, minicomputers, mainframe computers, distributed computing environments that include any of the above systems or devices, and the like.
The invention may be described in the general context of computer-executable instructions, such as program modules, being executed by a computer. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform particular tasks or implement particular abstract data types. The invention may also be practiced in distributed computing environments where tasks are performed by remote processing devices that are linked through a communications network. In a distributed computing environment, program modules may be located in both local and remote computer storage media including memory storage devices.
With reference to
Computer 110 typically includes a variety of computer readable media. Computer readable media can be any available media that can be accessed by computer 110 and includes both volatile and nonvolatile media, removable and non-removable media. By way of example, and not limitation, computer readable media may comprise computer storage media and communication media. Computer storage media includes both volatile and nonvolatile, removable and non-removable media implemented in any method or technology for storage of information such as computer readable instructions, data structures, program modules or other data. Computer storage media includes, but is not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, digital versatile disks (DVD) or other optical disk storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other medium which can be used to store the desired information and which can be accessed by computer 100. Communication media typically embodies computer readable instructions, data structures, program modules or other data in a modulated data signal such as a carrier WAV or other transport mechanism and includes any information delivery media. The term “modulated data signal” means a signal that has one or more of its characteristics set or changed in such a manner as to encode information in the signal. By way of example, and not limitation, communication media includes wired media such as a wired network or direct-wired connection, and wireless media such as acoustic, FR, infrared and other wireless media. Combinations of any of the above should also be included within the scope of computer readable media.
The system memory 130 includes computer storage media in the form of volatile and/or nonvolatile memory such as read only memory (ROM) 131 and random access memory (RAM) 132. A basic input/output system 133 (BIOS), containing the basic routines that help to transfer information between elements within computer 110, such as during start-up, is typically stored in ROM 131. RAM 132 typically contains data and/or program modules that are immediately accessible to and/or presently being operated on by processing unit 120. By way o example, and not limitation,
The computer 110 may also include other removable/non-removable volatile/nonvolatile computer storage media. By way of example only,
The drives and their associated computer storage media discussed above and illustrated in
A user may enter commands and information into the computer 110 through input devices such as a keyboard 162, a microphone 163, and a pointing device 161, such as a mouse, trackball or touch pad. Other input devices (not shown) may include a joystick, game pad, satellite dish, scanner, or the like. These and other input devices are often connected to the processing unit 120 through a user input interface 160 that is coupled to the system bus, but may be connected by other interface and bus structures, such as a parallel port, game port or a universal serial bus (USB). A monitor 191 or other type of display device is also connected to the system bus 121 via an interface, such as a video interface 190. In addition to the monitor, computers may also include other peripheral output devices such as speakers 197 and printer 196, which may be connected through an output peripheral interface 190.
The computer 110 may operate in a networked environment using logical connections to one or more remote computers, such as a remote computer 180. The remote computer 180 may be a personal computer, a hand-held device, a server, a router, a network PC, a peer device or other common network node, and typically includes many or all of the elements described above relative to the computer 110. The logical connections depicted in
When used in a LAN networking environment, the computer 110 is connected to the LAN 171 through a network interface or adapter 170. When used in a WAN networking environment, the computer 110 typically includes a modem 172 or other means for establishing communications over the WAN 173, such as the Internet. The modem 172, which may be internal or external, may be connected to the system bus 121 via the user input interface 160, or other appropriate mechanism. In a networked environment, program modules depicted relative to the computer 110, or portions thereof, may be stored in the remote memory storage device. By way of example, and not limitation,
In one illustrative embodiment, speech middleware component 204 is implemented in the operating system 134 illustrated in
Briefly, in operation, speech middleware component 204 resides between applications 202 and engines 206 and 208. Applications 202 can be speech recognition and speech synthesis applications which desire to invoke engines 206 and 208. In doing so, applications 202 make calls to speech middleware component 204 which, in turn, makes calls to the appropriate engines 206 and 208 in order to have speech recognized or synthesized.
For example, applications 202 may provide the source of audio data for speech recognition. Speech middleware component 204 passes that information to speech recognition engine 206 which simply recognizes the speech and returns a recognition result to speech recognition middleware component 210. Speech recognition middleware component 210 places the result in a desired format and returns it to the application 202 which requested it or to another desired location specified by the application 202.
Similarly, an application 202 can provide a source of textual data to be synthesized. TTS middleware component 214 assembles that data, and provides it to TTS engine 208, for synthesis. TTS engine 208 simply synthesizes the data and returns audio information, along with associated event information, to TTS middleware component 214, which handles spooling of that information to an audio device, writing that information to memory, or placing that information in any other desired location, as specified by the application 202 which requested it.
CFG engine 212, briefly, assembles and maintains grammars that are to be used by speech recognition engine 206. This allows multiple applications and multiple grammars to be used with a single speech recognition engine 206.
A general discussion of the operation of TTS middleware component 214, with applications 202 and engine 208, is illustrated by the flow diagram in
Next, application 202 can specify the attributes of TTS engine 208, such as whether the engine which is the synthesizer exhibits male or female voice qualities, the language of the synthesis, etc. This is done, for example, by calling the SetVoice method on the SpVoice object 216. This is indicated by optional block 236 in
The application 202 can set other attributes associated with the voice speaking, such as the rate and volume of speech, using for example, the SetRate and the SetVolume methods exposed by the SpVoice object 216. These are optional as well.
It should be noted that specifying the attributes of the engine 208 and audio output object 224 are optional. If the application does not specify these items, the first call to the SpVoice object 216 requiring synthesis results in the SpVoice object 216 choosing and initializing the default voice (i.e., the default TTS engine 208) and the default audio output object 224.
Application 202 must then indicated to SpVoice object 216 which particular events it is interested in, and how it wishes to be notified of those events. This will be discussed in greater detail below. Suffice it to say that application 202 will likely be interested in a variety of different events and will wish to be notified when those events are occurring (or prior to the occurrence) at audio output object 224. Similarly, application 202 may wish to be notified of the events in one of a variety of different manners. Therefore application 202 provides this information to SpVoice object 216. This is indicated by block 239.
Once these items are configured properly, application 202 can call the SpVoice object 216 and request that textual information be synthesized. This can be done, for example, by calling the Speak or the SpeakStream methods on the SpVoice object 216. This is indicated by block 240.
The SpVoice object 216 then performs format negotiation. This does not form part of the present invention and is only optional. Briefly, the SpVoice object 216 attempts to optimize the format of data created by TTS engine 208 and that accepted by audio output object 224 for optimal synthesis. Format negotiation is indicated by block 242 in
The SpVoice object 216 then breaks the textual information provided by application 202 into text fragments. For example, if the textual information is in XML, the SpVoice object 216 invokes the XML parser 228 to parse the XML input into text fragments. While the textual information can come from a variety of sources (such as a text buffer, straight textual information, XML, etc.) that information is broken into text fragments by SpVoice object 216, as indicated by block 244 in
The SpVoice object 216 then calls a speak method on TTS engine 208, passing in the information to be synthesized. This is indicated by block 246. In doing this, the SpVoice object 216 also specifies a Site object 218 to be used by the TTS engine for returning the synthesized information.
TTS engine 208 receives the text fragments, synthesizes the text into PCM (pulse code modulation) data (or other suitable audio data) and provides an indication of where events occur in the PCM data. For example, TTS engine 208 can illustratively provide an indication of where word and phoneme boundaries occur in the PCM data. This information is all provided from TTS engine 208 to SpVoice object 216 through the Site object 218.
It should be noted that, in performing the synthesis, TTS engine 208 can access the lexicon object 220 contained in TTS middleware component 214. The lexicon container object also forms no part of the present invention and is mentioned only for the sake of completeness. Briefly, the lexicon container object 220 contains all lexicons of interest and the TTS engine 208 simply needs to access object 220 as if it were a single lexicon.
Synthesizing the actual fragments and writing them and the events to the Site object are indicated by blocks 248 and 250 in
During the format negotiation step 242, the SpVoice object 216 determines whether the format of the audio output object 224 or the format of the information provided by TTS engine 208 need to be converted. If conversion is required, information is provided to a format converter object, such as through the ISpAudio or ISpStream interfaces, where the information is converted into a desired format for the audio output object 224. The format converter object then manages the process of spooling out the audio information to audio output object 224 and also manages returning events noticed by the audio output object 224 to the Site object 218 and the SpVoice object 216 for transmission back to the application 202. Where no format conversion is desired, the information from the Site object 218 is spooled out to the audio output object 224 by the SpVoice object 216, through a suitable interface such as the ISpStream interface, and the audio output object 224 returns events to the SpVoice object. This is indicated by blocks 256 and 258.
Of course, it should also be noted that rather than providing the information directly to an audio output object 224, the information can be written to memory, or provided at some other specified output or location.
In notifying the SpVoice object 216 of events, audio output object 224 can do one of any number of things. For example, audio output object 224 can provide a notification that an event has occurred, or is occurring, as audio output object 224 is playing the data containing the event. However, it may well be that application 202 wishes to be notified of the event prior to the occurrence of the event at the audio object. For example, if the event is a viseme, application 202 may desire to be notified of the viseme so that it can animate a character on a computer screen, as the audio information is being played. In that instance, or in any instance where application 202 desires to be notified of the event prior to it occurring, audio output object 224 can be configured to notify the SpVoice object 216 that an event is about to occur at any predetermined offset prior to the event in the data stream. This simply requires audio output object 224 to look forward in the data stream by the offset amount and notify the SpVoice object 216 when an event is encountered.
As will be described later with respect to
Assuming that application 202 is interested in the event which has been notified, then SpVoice object 216 may notify application 202 directly of the event, using the specific notification mechanism selected by the application in step 239 of
For example, if the application 202 calls SetNotifySink that indicates that the application is implementing an ISpNotifySink which exposes a Notify method that can simply be called by notification assistance object 304 to notify application 202 of an event.
If the application invokes SetNotifyCallBackFunction that indicates that application 202 simply wishes to be notified using a callback function, such as those common in the C or C++ programming languages.
If application 202 invokes SetNotifyWindowMessage that indicates that application 202 wishes to be notified using a window callback function to receive notifications by having a window message posted.
If the application calls SetNotifyWin32Event this simply sets up a Win32 event object and indicates that the application supports Win32 event notification and can be notified according to that mechanism.
These are but a few of the possible notification mechanisms that can be selected. The application 202 notifying SpVoice 216 of its selected notification mechanism is indicated by block 306.
Application 202 then provides an indication as to the particular types of events it is interested in to SpVoice Object 216. This is indicated by block 308. In doing so, the application may illustratively invoke the SetInterests method on the ISpEventSource interface 310 on SpVoice object 216. This method allows the application 202 to specify the different event types which it wishes to be notified of.
Once SpVoice object 216 has received the selected notification mechanism from application 202, it initializes notification assistance object 304 according to the notification mechanism selected by the application. This is indicated by block 312. This can be done, for example, by initializing assistance object 304 by invoking the Initxxxx method on the ISpNotifyTranslator interface. Notification assistance object 304 is thus initialized such that, when SpVoice object 216 invokes the Notify method on the ISpNotifySink interface 314 supported by notification assistance object 304 notifies application 202 according to the selected method. In one illustrative embodiment, notification assistance object 304 supports an interface 318 which makes the events available for retrieval and examination by application 202. In another embodiment, notification assistance object 304 simply notifies application 302 of the event and application 202 retrieves or examines the event from the SpVoice object 216.
TTS engine 208 invokes the AddEvents method on interface 352 of the Site object 218. This adds the event identified at block 350 by the TTS engine to the Site object 218. This is indicated by block 354 in
The SpVoice object 216 then transfers the event and its offset in the audio stream to audio object 204. The event and its offset are placed in event queue 300 in audio object 204. Of course, transferring of this event can be accomplished through appropriate interfaces as well. Transferring the event and its offset to event queue 300 in audio object 204 is indicated by block 356 in
Audio object 204 begins playing the data. As it plays the data, it looks a predetermined offset distance ahead in the data stream to determine whether any events are upcoming in event queue 300. When the audio object encounters an event in the data stream, it transfers the event and its offset from the event queue 300 to its completed queue 302. After this is accomplished it invokes the Notify method on the ISpNotifySink interface 358 on the SpVoice object 216. This is indicated by block 360 in
After being notified of an event, SpVoice object 216 invokes the GetEvents method on the ISpEventSource interface 362 of audio object 204. This is indicated by block 364 in
Upon receiving the event information indicative of the particular event about which SpVoice object 216 was notified, SpVoice object 216 determines whether an application 202 is even interested in being notified of this event. Recall that application 202 indicated the events in which it was interested to SpVoice object 216 by invoking the SetIntersts method on the ISpEventSource interface 310. Therefore, SpVoice object 216 simply needs to compare the event type which was returned from audio object 204 with those specified as being of interest to application 202. This is indicated by blocks 368 and 370 in
If SpVoice object 216 determines that application 202 is interested in this event, then what happens next depends on whether the notification system is an embodiment in which the notification assistance object 304 is implemented. If not, the processing simply proceeds at block 376 and SpVoice object 216 simply notifies application 202 according to the notification mechanism which it selected at the outset.
However, if notification assistance object 304 is implemented (as shown in
SpRecoContext object 400 is the counterpart to the SpVoice object 216 in TTS middleware component 214 in that it generally manages data flow and performs services within SR middleware component 210. The SpRecoContext object 400 exposes one or more interfaces that can be used with application 202. SpRecoContext object 400 also calls interface methods exposed by SR engine object 206. A more detailed discussion of the SpRecoContext object 400 can be found in the above-identified and related patent application. However, no further explanation is needed for the sake of the present invention.
Processing events is highly similar to that with respect to the TTS systems shown in
In the embodiment shown in
Appendix A illustrates a number of the interfaces discussed herein in greater detail, simply for the sake of completeness. They can be implemented in other ways as well and still comport with the inventive features of the present invention.
It can thus be seen that the present invention is directed to a middleware layer that is arranged between the applications and engines. The middleware layer supports interfaces that allow the applications to select one of a variety of different types of notification mechanisms. The middleware layer then configures itself to provide event notification from the engine to the application in the selected manner. In addition, the present invention allows an output device to simply notify the middleware layer when it has encountered the location in the output data stream which coincides with an event. The middleware layer then takes care of notifying the application, and the output device need not even be aware of the type of the event for which notification was sent. This also significantly simplifies the coding required to make output devices consistent with the other components in the system.
Although the present invention has been described with reference to preferred embodiments, workers skilled in the art will recognize that changes may be made in form and detail without departing from the spirit and scope of the invention.
The present application is a divisional of and claims priority of U.S. patent application Ser. No. 09/881,518, filed Jun. 14, 2001 now U.S. Pat. No. 6,931,376, and is based on and claims the benefit of U.S. provisional patent application Ser. No. 60/219,861, filed Jul. 20, 2000, the content of which is hereby incorporated by reference in its entirety.
Number | Name | Date | Kind |
---|---|---|---|
4771401 | Kaufman et al. | Sep 1988 | A |
4914590 | Loatman et al. | Apr 1990 | A |
5621859 | Schwartz et al. | Apr 1997 | A |
5748974 | Johnson | May 1998 | A |
5799273 | Mitchell et al. | Aug 1998 | A |
5864863 | Burrows | Jan 1999 | A |
5865626 | Beattie et al. | Feb 1999 | A |
5913192 | Parthasarathy et al. | Jun 1999 | A |
5933525 | Makhoul et al. | Aug 1999 | A |
5991720 | Galler et al. | Nov 1999 | A |
5995928 | Nguyen et al. | Nov 1999 | A |
6018708 | Dahan et al. | Jan 2000 | A |
6021409 | Burrows | Feb 2000 | A |
6044347 | Abella et al. | Mar 2000 | A |
6064959 | Young et al. | May 2000 | A |
6076056 | Huang et al. | Jun 2000 | A |
6138098 | Shieber et al. | Oct 2000 | A |
6212546 | Starkovich et al. | Apr 2001 | B1 |
6243678 | Erhart et al. | Jun 2001 | B1 |
6314399 | Deligne et al. | Nov 2001 | B1 |
6374226 | Hunt et al. | Apr 2002 | B1 |
6377913 | Coffman et al. | Apr 2002 | B1 |
6377925 | Greene, et al. | Apr 2002 | B1 |
6456974 | Baker et al. | Sep 2002 | B1 |
6466909 | Didcock | Oct 2002 | B1 |
6487533 | Hyde-Thompson et al. | Nov 2002 | B1 |
6513009 | Comerford et al. | Jan 2003 | B1 |
6526381 | Wilson | Feb 2003 | B1 |
6535886 | Koontz | Mar 2003 | B1 |
6618703 | Peres et al. | Sep 2003 | B1 |
6636831 | Profit et al. | Oct 2003 | B1 |
6757655 | Besling et al. | Jun 2004 | B1 |
20020138265 | Stevens et al. | Sep 2002 | A1 |
Number | Date | Country | |
---|---|---|---|
20050125231 A1 | Jun 2005 | US |
Number | Date | Country | |
---|---|---|---|
60219861 | Jul 2000 | US |
Number | Date | Country | |
---|---|---|---|
Parent | 09881518 | Jun 2001 | US |
Child | 10991612 | US |