|
VoiceResourcePlayNumber Method |
Plays the specified string as a number using the specified
Format Spoken and the voice resource's
VAP file.
Namespace:
VoiceElements.Client
Assembly:
VoiceElementsClient (in VoiceElementsClient.dll) Version: 8.6.1.1
Syntax public TerminationCode PlayNumber(
string numberString
)
Public Function PlayNumber (
numberString As String
) As TerminationCode
public:
TerminationCode PlayNumber(
String^ numberString
)
member PlayNumber :
numberString : string -> TerminationCode
Parameters
- numberString
- Type: SystemString
The string to play as a number using the Format Spoken.
Return Value
Type:
TerminationCode
A
Termination Code indicating how the play ended. Typically, you will use this to determine what to do next.
Remarks
Make Sure to Set The VAP File
This method compiles pieces from an indexed sound file or
VAP File. You must specify the file to use
in the
Voice Resource'sVAP File Property prior to using this method or it may play silence.
Format Spoken and Effect on Playback
You may set
Format Spoken to the following and the number will be played in different ways.
-
Standard - 1026.6 will be played as "one zero two six point six".
-
Intelligently - 1026.6 will be played as "one thousand twenty six point six".
-
Currency - 1026.6 will be played as "one thousand twenty six dollars and sixty cents".
Examples
The following sample code firstly code sets up a
Channel Resource,
Dials a Call, retrieves a
Voice Resource,
sets the
VAP File Property of the Voice Rescource, waits for a second and then plays the number string "1026.6" in all three different ways by switching the
Format Spoken.
public void DialOutAndPlayNumbers()
{
TelephonyServer m_TelephonyServer = new TelephonyServer();
ChannelResource m_ChannelResource = m_TelephonyServer.GetChannel();
string phoneNumber = "2135551212";
m_ChannelResource.Dial(phoneNumber);
VoiceResource m_VoiceResource = m_ChannelResource.VoiceResource;
m_VoiceResource.VapFile = "English.vap";
m_VoiceResource.FormatSpoken = FormatSpoken.Standard;
m_VoiceResource.PlayNumber("1026.6");
m_VoiceResource.FormatSpoken = FormatSpoken.Intelligently;
m_VoiceResource.PlayNumber("1026.6");
m_VoiceResource.FormatSpoken = FormatSpoken.Currency;
m_VoiceResource.PlayNumber("1026.6");
}
Public Sub DialOutAndPlayNumbers()
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
m_VoiceResource.VapFile = "English.vap"
m_VoiceResource.FormatSpoken = FormatSpoken.Standard
m_VoiceResource.PlayNumber("1026.6")
m_VoiceResource.FormatSpoken = FormatSpoken.Intelligently
m_VoiceResource.PlayNumber("1026.6")
m_VoiceResource.FormatSpoken = FormatSpoken.Currency
m_VoiceResource.PlayNumber("1026.6")
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