|
VoiceResourcePlayTTS Method (String, String) |
Plays the text specified using the Text-To-Speech engine and using the voice selected.
Namespace:
VoiceElements.Client
Assembly:
VoiceElementsClient (in VoiceElementsClient.dll) Version: 8.6.1.1
Syntax public TerminationCode PlayTTS(
string ttsString,
string voice
)
Public Function PlayTTS (
ttsString As String,
voice As String
) As TerminationCode
public:
TerminationCode PlayTTS(
String^ ttsString,
String^ voice
)
member PlayTTS :
ttsString : string *
voice : string -> TerminationCode
Parameters
- ttsString
- Type: SystemString
The string you would like the TTS engine to speak. For example: "Hello world" - voice
- Type: SystemString
The exact string name of the voice you would like to use. For example: "Microsoft Sam"
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 a SpecificVoice
Note that this method will use the exact voice name you specify. To see what voices you have available, you
may
check in the Windows control panel or
look in the Voice Elements server log.
Note that you specify in the string
exactly the name of the voice as it appears in control panel or the log. If you would like to simply use the default, use the
Play TSS with Default 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 "Microsoft Sam" 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?", "Microsoft Sam");
}
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?", "Microsoft Sam")
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