Click or drag to resize

TelephonyServerTtsToFile Method (String, String)

Converts the specified text string into speech and saves it as the designated file.

Namespace:  VoiceElements.Client
Assembly:  VoiceElementsClient (in VoiceElementsClient.dll) Version: 8.6.1.1
Syntax
public void TtsToFile(
	string ttsText,
	string outputFile
)

Parameters

ttsText
Type: SystemString
String

Description: This is the text that the TTS engine will speak into the output file.

Note: You can use parameters and tags to change the way the engine speaks and also specify currency, dates, etc. For more information on configuring TTS by adding paramters to this string, see Text-to-Speech Tips and Topics from Inventive Labs support.

outputFile
Type: SystemString
String of Path and File Name

This specifies the file for the wave output. See remarks below about file format.

Exceptions
ExceptionCondition
ElementsException Thrown when the file or text string are null or a file access exception occurs.
Remarks
Output File Format

The output file will usually be formatted as 8 kHz 8 bit mu-law wave file. Voice Elements uses native G.711 which determines the format. This is the codec used at the transport level for SIP, T1's and PRI's. This allows files to be played without any conversion overhead.


Default Voice

This method has an additional overload allowing the use of any available specific TTS voice. In this case, since no voice is specified, Voice Elements will use the voice specified in the Name setting of the [TTS] section of the CTI32.ini settings file in the root application directory of the Voice Elements server. For more information on TTS settings on the server, see TTS Settings on Voice Elements Server from Inventive Labs support.

Examples
This sample uses a passed Telphony Server object to record "Hello World from Mr TTS" to a file.
C#
class TestClass
{
    public void TestMethod(TelephonyServer telephonyServer)
    {
        // Record the string "Hello world from Mr TTS" to file "HelloWorld.wav"
        telephonyServer.TtsToFile("Hello world from Mr TTS", "C:\\Temp\\HelloWorld.wav");
        return;
    }
}
See Also