|
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
)
Public Function PlayTTS (
ttsString As String
) As TerminationCode
public:
TerminationCode PlayTTS(
String^ ttsString
)
member PlayTTS :
ttsString : string -> TerminationCode
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()
{
TelephonyServer m_TelephonyServer = new TelephonyServer();
ChannelResource m_ChannelResource = m_TelephonyServer.GetChannel();
string phoneNumber = "2135551212";
m_ChannelResource.Dial(phoneNumber);
VoiceResource m_VoiceResource = m_ChannelResource.VoiceResource;
Thread.Sleep(2000);
m_VoiceResource.PlayTTS("Hello, this is your code speaking. How is you day going?");
}
Public Sub DialOutAndPlayTTS()
Dim m_TelephonyServer As New TelephonyServer()
Dim m_ChannelResource As ChannelResource = m_TelephonyServer.GetChannel()
Dim phoneNumber As String = "2135551212"
m_ChannelResource.Dial(phoneNumber)
Dim m_VoiceResource As VoiceResource = m_ChannelResource.VoiceResource
Thread.Sleep(2000)
m_VoiceResource.PlayTTS("Hello, this is your code speaking. How is you day going?")
End Sub
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.
See Also