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:
public VoiceResource VoiceResource { get; set; }

Property Value

Type: VoiceResource
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:
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";

  // Next, use the voice resource of the channel to do some more things
  // First, play an audio file

  // 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
See Also