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 (Events)

Sentence Event


The Sentence event when the text-to-speech (TTS) engine detects a sentence boundary while speaking a stream for the SpVoice object.


SpVoice.Sentence(
     StreamNumber As Long,
     StreamPosition As Variant,
     CharacterPosition As Long,
     Length As Long
)

Parameters

StreamNumber
The stream number which generated the event. When a voice enqueues more than one stream by speaking asynchronously, the stream number is necessary to associate an event with the appropriate stream.
StreamPosition
The character position in the output stream at which the sentence begins.
CharacterPosition
The character position in the input stream one character before the start of the sentence. In the case of the first sentence in a stream, this parameter is zero.
Length
The length of the sentence.

Example

The following Visual Basic form code demonstrates the use of the Sentence event. To run this code, create a form with the following controls:

  • A command button called Command1
  • A text box called Text1
  • Set the HideSelection property of Text1 to False
  • Paste this code into the Declarations section of the form.

    The Form_Load procedure puts a text string in Text1 and creates a voice object. The command1_Click procedure calls the Speak method. This will cause the TTS engine to send the Sentence event to the voice. The Sentence event code uses the event parameters to highlight the sentence associated with the event.


    Option Explicit
    
    Public WithEvents vox As SpeechLib.SpVoice
    
    Private Sub Command1_Click()
    
        vox.Speak Text1.Text, SVSFlagsAsync
        
    End Sub
    
    Private Sub Form_Load()
    
        Set vox = New SpVoice
        Text1.Text = "a short sentence. another sentence. one more."
    
    End Sub
    
    Private Sub vox_Sentence(ByVal StreamNumber As Long, ByVal StreamPosition As Variant, _
                             ByVal CharacterPosition As Long, ByVal Length As Long)
    
        ' In order to show this selection, 
        ' the Text1.HideSelection property must be False
    
        Text1.SelStart = CharacterPosition
        Text1.SelLength = Length
    
    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