Click or drag to resize

VoiceResourcePlayDate Method

Plays a Date using the voice resource's specified VAP file.

Namespace:  VoiceElements.Client
Assembly:  VoiceElementsClient (in VoiceElementsClient.dll) Version: 8.6.1.1
Syntax
public TerminationCode PlayDate(
	DateTime date
)

Parameters

date
Type: SystemDateTime
This is a specified Date Time value you wish to be 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 Does Not Effect Playback

You may set Format Spoken to any setting and date playback will always remain the same. For example, 10-26-06 (as a Date Time, not a string) will be spoken as "October Twenty Sixth Two Thousand Six".

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 current Date.
public void DialOutAndPlayCurrentDate()
{
    // 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;

    // Set the vap file property to the one included with Voice Elements
    m_VoiceResource.VapFile = "English.vap";

    // Play the current date
    m_VoiceResource.PlayDate(DateTime.Now);

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