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

AudioOutputStream Property


The AudioOutputStream property gets and sets the current audio stream object used by the voice.

Setting the voice's AudioOutputStream property may cause its audio output format to be automatically changed to match the text-to-speech (TTS) engine's preferred audio output format. If the voice's AllowAudioOutputFormatChangesOnNextSet property is True, the format change takes place; if False, the format remains unchanged. In order to set the AudioOutputStream property of a voice to a specific format, its AllowOutputFormatChangesOnNextSet should be False.


Syntax

Set: SpVoice.AudioOutputStream = ISpeechBaseStream
Get: ISpeechBaseStream = SpVoice.AudioOutputStream

Parts

SpVoice
The owning object.
ISpeechBaseStream
Get: An ISpeechBaseStream object that gets the current audio output stream.
Set: An ISpeechBaseStream object that sets the audio output stream.

Remarks

Voice status and voice events are closely associated with the status of the audio output device. A voice speaking to a file stream produces no audio output, generates no events, and has no audio output status. As a result, the ISpeechVoiceStatus data returned by that voice will always indicate that it is inactive.


Example

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

  • A textbox called Text1
  • Two command buttons called Command1 and Command2
  • Paste the this code into the Declarations section of the form.

    The Command1_Click procedure sets the AudioOutputStream property of the voice to a file called AudioOutputStream.wav and speaks the contents of the text box into a wave file. It then sets the voice's AudioOutputStream property to Nothing, so that subsequent voice output will be directed to the audio system rather than to a file.

    The Command2_Click procedure plays back the wave file that created by the Command1_Click procedure.


    Option Explicit
    
    Dim objVOICE As SpeechLib.SpVoice
    Dim objFSTRM As SpeechLib.SpFileStream
    
    Const strFName = "C:\AudioOutputStream.wav"
    
    Private Sub Command1_Click()
    
        'Build a local file path and open it as a stream
        Call objFSTRM.Open(strFName, SSFMCreateForWrite, False)
        
        'Set voice AudioOutputStream to the stream and speak
        Set objVOICE.AudioOutputStream = objFSTRM
        objVOICE.Speak Text1.Text
        
        'Close the stream and set voice back to speaking
        Call objFSTRM.Close
        Set objVOICE.AudioOutputStream = Nothing
        
        Command2.Enabled = True
    
    End Sub
    
    Private Sub Command2_Click()
        objVOICE.Speak Text1.Text, SVSFIsXML
    End Sub
    
    Private Sub Form_Load()
        Set objVOICE = New SpVoice
        Set objFSTRM = New SpFileStream
        Command2.Enabled = False    'Force create file before playback
        Text1.Text = "The TTS voice will speak this text into a file."
    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