Play a File

⌘K
  1. Home
  2. Programmable Voice
  3. How do I
  4. Play a File

Play a File

 

It’s easy to play a file in Voice Elements.

When you get a new call event, you are given a reference to the Channel Resource that the call came in on. By default, the Channel Resource is routed to a Voice Resource.

Channel Resource

The Channel Resource contains methods for answering the line, disconnecting from a line, and getting information about the call.

Voice Resource

While the Voice Resource contains most of the functionality that you will need to be able to give information to and receive information from a user.

To play a file, you call the Play function and can pass in any file reference (both relative and absolute references work!)

VoiceResource.Play("C:\Test\Test.wav");

Alternatively, a relative reference if you are running from the “Test” directory will work as well:

VoiceResource.Play("Test.wav");

 

 

Was this article helpful to you? No Yes 18

How can we help?