Click or drag to resize

VoiceResourcePlayTTS Method (String)

Plays the text specified using the Text-To-Speech engine using the default voice.

Namespace:  VoiceElements.Client
Assembly:  VoiceElementsClient (in VoiceElementsClient.dll) Version: 8.6.1.1
Syntax
public TerminationCode PlayTTS(
	string ttsString
)

Parameters

ttsString
Type: SystemString
The string you would like the TTS engine to speak. For example: "Hello world"

Return Value

Type: TerminationCode
A Termination Code indicating how the play ended. Typically, you will use this to determine what to do next.
Remarks
This Method Uses the Default Voice

Note that this method will use the default Voice Defined in your Voice Elements Server. To see what voices you have available, you may check in the Windows control panel or look in the Voice Elements server log. If you would like to specify a voice other than the default, use the Play TSS with a Specific Voice Method.

Controlling TTS Playback Behavior

TTS engines allow you to format your string, use different formats for dates, currency, etc and will generall try to dtermine automatically the best way to speak what you pass to them. However, some advanced features are available. For example, this article on formatting for a TTS engine is typical. Test your application and if needed, determine your TTS engine and if it differ from the srticle shown here and your desired behavior, research its specific to tune your TTS output.

Examples
The following sample code sets up a Channel Resource, Dials a Call, retrieves a Voice Resource, and then waits for 2 seconds. After that, it plays a text string using the default voice of the TTS engine.
public void DialOutAndPlayTTS()
{
  // To get a channel, you must first get a link to a Telephony Server.  You may need to pass a username password here.
  TelephonyServer m_TelephonyServer = new TelephonyServer();

  // Get your channel resource from the server
  ChannelResource m_ChannelResource = m_TelephonyServer.GetChannel();

  // Example 1: Dial an oubound call
  string phoneNumber = "2135551212";
  m_ChannelResource.Dial(phoneNumber);

  // Get the voice resource and store in a variable for local use
  VoiceResource m_VoiceResource = m_ChannelResource.VoiceResource;

  // Wait 2 seconds
  Thread.Sleep(2000);

  // Play a string using the defaul TTS voice
  m_VoiceResource.PlayTTS("Hello, this is your code speaking.  How is you day going?");

  // Take your code from here ...
}
See Also