You are reading help file online using chmlib.com
|
Object: SpFileStream
The Open method opens a filestream object for reading or writing.
SpFileStream.Open(
FileName As String,
[FileMode As SpeechStreamFileMode = SSFMOpenForRead],
[DoEvents As Boolean = False]
)
None.
When the SpFileStream object is used with audio data, the FileMode parameter controls access strictly. That is, the FileMode parameter SFMOpenForRead prevents write access, and the FileMode parameter SSFMCreateForWrite prevents read access. When the SpFileStream object is used with text data, only the SFMOpenForRead FileMode parameter controls access strictly. The FileMode parameter SFMOpenForRead prevents write access, but the SSFMCreateForWrite parameter allows text data to be read as well as written.
When an SpVoice object creates an SPFileStream object, the engine may embed event data in the stream. In order to embed these events in the file stream, it must be opened for writing with the DoEvents parameter set to True. In order to receive these events when the stream is played back, it must be opened for reading with the DoEvents parameter set to True. Several other factors are involved. Please see SpVoice events for further details.
The following code snippet demonstrates the use of an SpFileStream object to capture the output of a voice in a file.
The ISpeechPhraseElement code example demonstrates further use of the SpFileStream object. This example uses a text-to-speech voice to speak into an SpFileStream object, and uses the resulting file as the input for speech recognition.
Dim objVOICE As SpeechLib.SpVoice
Dim objFSTRM As SpeechLib.SpFileStream
Set objVOICE = New SpVoice
Set objFSTRM = New SpFileStream
'Open file path as a stream
Call objFSTRM.Open("c:\VoiceToFile.wav", SSFMCreateForWrite, False)
'Set voice output to the stream and speak
Set objVOICE.AudioOutputStream = objFSTRM
objVOICE.Speak "cee : \ voice to file dot wave", SVSFNLPSpeakPunc
Call objFSTRM.Close
You are reading help file online using chmlib.com
|