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

Interface: ISpeechVoiceStatus

InputSentencePosition Property


The InputSentencePosition property retrieves the position one character prior to the beginning of the sentence currently being spoken by the text-to-speech (TTS) engine.

The InputSentencePosition property of an ISpeechVoiceStatus object is valid only when its RunningState property is SRSEIsSpeaking.


Syntax

Set: (This property is read-only)
Get: Long = ISpeechVoiceStatus.InputSentencePosition

Parts

ISpeechVoiceStatus
The owning object.
Long
Set: (This property is read-only)
Get: A Long variable returning the character position.

Example

The following Visual Basic form code demonstrates the use of the InputSentenceLength and InputSentencePosition properties of an ISpeechVoiceStatus object. 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 creates a voice object and places a few sentences in the text box. The Command1_Click procedure speaks the contents of the text box asynchronously and loops until the voice finishes speaking. In this loop, the code uses InputSentencePosition and InputSentenceLength properties to highlight each sentence in the text box as it is spoken by the TTS engine. A RunningState property of SRSEDone indicates that the voice has finished speaking.


    Option Explicit
    
    Dim V As SpeechLib.SpVoice
    
    Private Sub Command1_Click()
    
        Dim ii As Integer
        Dim S As SpeechLib.ISpeechVoiceStatus
    
        V.Speak Text1.Text, SVSFlagsAsync   'Speak the user-editable text
        
        'Check status periodically
        Do
            For ii = 0 To 5000
                DoEvents
            Next ii
            
            Set S = V.Status    'Get status in an ISpeechVoiceStatus object
            
            'Text1.HideSelection must be False for this selection to be seen!
            
            Text1.SelStart = S.InputSentencePosition
            Text1.SelLength = S.InputSentenceLength
        
        Loop Until V.Status.RunningState = SRSEDone 'Exit when voice stops
            
        Text1.SelLength = 0
        
    End Sub
    
    Private Sub Form_Load()
    
        Set V = New SpVoice
        Text1.Text = "One sentence. Another sentence. Still one more sentence."
    
    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