Click or drag to resize

ChannelResourceVoiceResource Property

The Voice Resource associated with this channel. Use this for audio functions like play, record and getting digits.

Namespace:  VoiceElements.Client
Assembly:  VoiceElementsClient (in VoiceElementsClient.dll) Version: 8.6.4.0
Syntax
public VoiceResource VoiceResource { get; set; }

Property Value

Type: VoiceResource
Remarks
Every Channel Resource is accompanied by a Voice Resource through which many of the most common voice functions are executed. By accessing this object, you can do the following and more:
Examples
The code snippets below illustrate basic and trimmed down executions of the common uses in the lists above.
public void ExecuteChannelMethods()
{
  // 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);

  // Next, use the voice resource of the channel to do some more things
  // First, play an audio file
  m_ChannelResource.VoiceResource.Play(@"C:\Audio\Sample.wav");

  // Get digits from the caller
  TerminationCode terminationCode = m_ChannelResource.VoiceResource.GetDigits();
  string m_Digits = m_ChannelResource.VoiceResource.DigitBuffer;

  // Play text to speech to the caller
  m_ChannelResource.VoiceResource.PlayTTS("Hello, this is your application speaking.  Please say whatever you like.");

  // Record the callers response to the file specified
  m_ChannelResource.VoiceResource.Record(@"C:\Audio\RecordedCall.wav");
}
See Also