SpeakToFile
(VoiceTalk Module)
| Description: | Executes on the speech thread to speak the supplied text to a .wav format audio file. |
| Returns: | Nothing |
Usage: ![]() |
Script Only. |
| Function Groups: | Speech and Sound, File I/O |
| Related to: | Configure | GetDevices | GetVoices | Reset | ShowLexicon | Speak | VoiceTalk |
Format: ![]() |
VoiceTalkStream\SpeakToFile(Phrase, Flags, Filename, Quality[, Result]) |
| Parameters: |
| VoiceTalkStream | ||||||||||||||||||
| Required. A speech stream returned from VoiceTalk that you wish to speak the given phrase. | ||||||||||||||||||
| Phrase | ||||||||||||||||||
| Required. Any text expression that will be spoken on a specified stream. This is limited to the number of characters specified by MaxSpeakToFileLength, defaulting to 1000. |
||||||||||||||||||
| Flags | ||||||||||||||||||
Required. A parameter to specify speaking flags to the stream. All text will be spoken asynchronously (i.e. the function will not wait for the speech to complete speaking). Flags can be used to specify other parsing of the text. The values for Flags can be any combination of the following
As indicated above, an Invalid value, or a value of "0" or "1" for the Flags parameter will have the same result. |
| Filename | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Required. The name of the .wav file to speak into (e.g. "c:\folder\file.wav") | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Quality | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Required. The format quality to use, as defined by the following table:
|
| Result |
| Required. A pointer to a flag to set when done. This should be 0 for OK or 1 for an error. |
| Comments: | The text may include embedded XML tags as described in the documentation for the SAPI speech engine being used. Multiple calls to this function will be queued. Calls to this module will fail if the VoiceTalk instance was not configured for VTSFileOutput. |
This function is session non-aware, meaning it works on the server's file system even with an active remote connection established.This function is also blocking. All concurrent thread operations will be paused until its execution has concluded. Avoid using this function to access a network file path ("\\server1\share\file.txt", for example). If the network location is unavailable while a blocking File I/O function is attempted, it will block indefinitely. It is recommended that a target file be copied to the local file system for access rather than over the network from VTScada.
