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

SpeakStream Method

The Speakstream method initiates speaking of a sound file by the voice.


SpVoice.SpeakStream(
     Stream As ISpeechBaseStream,
     [Flags As SpeechVoiceSpeakFlags = SVSFDefault]
) As Long

Parameters

Stream
Specifies an ISpeechBaseStream object containing the stream.
Flags
[Optional] Specifies the Flags. Default value is SVSFDefault.

Return Value

A Long variable containing the stream number. When a voice enqueues more than one stream by speaking asynchronously, the stream number is necessary to associate events with the appropriate stream.


Example

The following code snippet demonstrates the use of the SpeakStream method. To run this code, create a form with the following control:

  • A command button called Command1
  • Paste this code into the Declarations section of the form.

    The Form_Load procedure creates a male and a female voice. The Command1_Click procedure causes the female voice to speak text into a file, and the male voice to play that file using the SpeakStream method.


    Option Explicit
    
    Private M As SpeechLib.SpVoice      'M is a male voice
    Private F As SpeechLib.SpVoice      'F is a female voice
    Private S As SpeechLib.SpFileStream
    
    Private Sub Command1_Click()
    
        'Build a local file path and open it as a stream
        Set S = New SpFileStream
        Call S.Open("C:\SpeakStream.wav", SSFMCreateForWrite, False)
        
        'Female voice speaks into the file stream and creates a WAV file
        Set F.AudioOutputStream = S
        F.Speak "cee : \ speak stream dot wave", SVSFNLPSpeakPunc
        S.Close
        
        'Male voice speaks female voice's stream
        Call S.Open("C:\SpeakStream.wav", , False)
        M.Speak "i will now demonstrate the speak stream method."
        M.SpeakStream S
        M.Speak "that sounded like " & F.Voice.GetDescription & ", but it was me."
        
    End Sub
    
    Private Sub Form_Load()
    
        'Create voices
        Set F = New SpVoice
        Set F.Voice = F.GetVoices("gender=female").Item(0)
        Set M = New SpVoice
        Set M.Voice = M.GetVoices("gender=male").Item(0)
        
    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