CHMlib Logo Leading Translation Management System for Translation Agencies, Top Translation Management Software for Freelance Translators, Time Tracking Software, Word Count, Character Count and Line Count Software, Computer Assisted Translation Tool for Easy Word Count, Clipboard Character Count Software, User-Friendly Translation Memory Software, Terminology Management Software, Terminology Management Server, Microsoft Glossary Software, Dictionary of Acronyms, Social Network for Translators and Translation Agencies, Acronyms and Abbreviations Search Engine, Russian Translation Lab, Ukrainian Translation Lab.
You are reading help file online using chmlib.com
CrisisHelper - First Aid in Tough Times of World Economic Crisis


Intelligent Interface Technologies Home Page Microsoft Speech SDK

Speech Automation 5.1

Object: SpVoice

AlertBoundary Property


The AlertBoundary property gets and sets the alert boundary, which specifies how a speaking voice pauses for alerts.

Because a TTS application might operate without a graphical user interface (UI), it must be able to implement error handling with a TTS voice. The only capability needed for voice error messaging is the ability to interrupt another voice; this capability is assigned to a voice by setting the Priority property to SVPAlert. A voice with a priority setting of SVPAlert is referred to as an alert voice, or simply as an alert, because its purpose is identical to that of an alert box or message box.

When a speaking voice detects a pending alert interruption, it continues speaking until it arrives at a specific application-defined stopping point, such as a sentence or a word. This stopping point is called the alert boundary because it is the event boundary at which alerts can be processed.

The SpeechVoiceEvents enumeration contains the types of events that a voice object can receive. The AlertBoundary property consists of one of these constants. The default setting is SVEWordBoundary.


Syntax

Set: SpVoice.AlertBoundary = SpeechVoiceEvents
Get: SpeechVoiceEvents = SpVoice.AlertBoundary

Parts

SpVoice
The owning object.
SpeechVoiceEvents
Set: A SpeechVoiceEvents constant that sets the alert boundary.
Get: A SpeechVoiceEvents constant that gets the alert boundary.

Example

The following code demonstrates the use of the Priority, EventInterests and AlertBoundary properties. The code uses the GetVoices method to select a male voice and a female voice, and sets the Priority property of the female voice to SVPAlert, making it an alert voice. The Priority of the male voice remains SVPNormal.

The code sets the EventInterests of the normal voice to SVEBookmark, so that it can receive bookmark events, and then speak a text string containing bookmarks. The normal voice's Bookmark event uses the alert voice to speak the bookmark data. Because the alert voice interrupts the normal voice, the normal voice is essentially using its own events to interrupt itself.

Note that the interruption does not occur immediately; the alert voice must first enqueue its text stream, and then the normal voice must detect the pending alert and stop speaking at the next alert boundary. The normal voice might speak several words or phonemes past the bookmark before it pauses for the alert voice to speak.

In this example, the normal voice can be interrupted on a phoneme boundary, which may divide a word. Changing the AlertBoundary to word or sentence boundaries will noticeably change the interaction of the two voices.


Option Explicit

Dim WithEvents objHIM As SpeechLib.SpVoice  'Normal voice will receive events
Dim objHER As SpeechLib.SpVoice             'Alert voice will not

Private Sub Command1_Click()
    Dim strSpeak As String
    
    'Create an Alert Priority voice - female
    Set objHER = New SpVoice
    objHER.Priority = SVPAlert
    Set objHER.Voice = objHER.GetVoices("gender=female").Item(0)

    'Create a Normal Priority voice - male
    Set objHIM = New SpVoice
    Set objHIM.Voice = objHIM.GetVoices("gender=male").Item(0)
    
    objHER.Speak "the priority of this voice is S V P alert"
    objHIM.Speak "the priority of this voice is S V P normal"
    
    objHIM.EventInterests = SVEBookmark     'Receive bookmark events only
    objHIM.AlertBoundary = SVEPhoneme       'Let alert voices interrupt words
    
    'Normal voice speaks text which generates events.
    
    strSpeak = "This is text <BOOKMARK mark='first' /> that contains bookmarks " _
                & "for the <BOOKMARK mark='second' /> purpose of generating events."
                
    objHIM.Speak strSpeak, SVSFIsXML + SVSFlagsAsync
    
End Sub

Private Sub objHIM_Bookmark(ByVal StreamNumber As Long, ByVal StreamPosition As Variant, _
                            ByVal Bookmark As String, ByVal BookmarkId As Long)

    objHER.Speak Bookmark, SVSFlagsAsync

End Sub


You are reading help file online using chmlib.com

If you want your help file to be removed or added please send e-mail to chmlibcom@gmail.com
Partner sites: Logo Design, Simple Anti-Crisis Accounting Software, Voice Search for Web