SeekAndPlay

Metreos.MediaControl.SeekAndPlay

Asynchronous Callbacks

Summary

Initiates playback of the specified audio file from the specified location of the file.

Usage

The SeekAndPlay action allows one to specify the name of WAV file, the sampling rate and sample size.

The SeekAndPlay command will fire SeekAndPlay_Complete once playing of the prompt is finished, if a termination condition is satisfied, or if CommandTimeout is reached. If the action fails for any reason, prompts playing is cancelled and SeekAndPlay_Failed is fired.

The termination condition parameters on the action are a means to create a matrix of reasons that the action should cease playing. In the SeekAndPlay_Complete event, one can use TerminationCondition to determine why the command stopped playing. To see a list of all possible termination conditions, reference the SeekAndPlay_Complete TerminationCondition action parameter.

Remarks

Media Engine currently supports playing of a single wav file. It does not support vox file or playing of multiple prompts or text-to-speech prompt.

If one plays to a connection while it is in conference, the connection is temporarily taken out of the conference for the duration of the Play.

The following properties cover most audio file types that can be played by the media engine: sample rate of 6, 8, 11, sample size of 4, 8, 16, and 2 bit, and encoding types of ulaw, alaw, pcm, adpcm, and g726. Only mono vox and wav files are allowed.

If the command play the prompt successfully to completion, the SeekAndPlay command will result in the SeekAndPlay_Complete event with a TerminationCondition of eod.

A SeekAndPlay to a connection or a conference results in a voice resource being utilized until the action results in the SeekAndPlay_Complete or SeekAndPlay_Failed event.

A SeekAndPlay action should not use text-to-speech instead of a wav file.

Action Parameters
Parameter Name.NET TypeDefaultDescription
AudioFileSampleSizeSystem.UInt32The sample size used in the audio file (in bits). Valid values are 4, 8, or 16. 4 and 16 should be avoided as both have a higher impact on the media engine. If not specified, the media engine configuration file defines the sample size to use, which by default is 8.
AudioPlayPositionSystem.UInt32The AudioPlayPosition property specifies the position from where to start playing the media file. The value must be a literal value in seconds.
StateSystem.StringArbitrary, user-defined state information which is passed back as the State event parameter in SeekAndPlay_Complete or SeekAndPlay_Failed.
ConferenceIdSystem.StringThe conference to perform the SeekAndPlay on. If specified, ConnectionId must not be specified.
AudioFileEncodingSystem.StringThe encoding of the audio file: ulaw, alaw, pcm, or adpcm. Pcm and adpcm should be avoided as each has a higher impact on the media engine. If not specified, the media engine configuration file defines the file encoding to use, which by default is ulaw.
Prompt *System.StringA prompt field should be the name of an audio file. It can be specified as a string.
CommandTimeoutSystem.UInt32Indicates a command timeout value (in milliseconds). If this condition is met, the SeekAndPlay command will result in the SeekAndPlay_Complete event with a TerminationCondition of timeout.
ConnectionIdSystem.StringThe connection to perform the SeekAndPlay on. If specified, ConferenceId must not be specified.
TermCondDigitListSystem.StringA list of digits that will cause the SeekAndPlay operation to terminate, if any one of the digits in the list is inputted. The list has no delimiters. If this condition is met, the SeekAndPlay command will result in the Play_Complete event with a TerminationCondition of digitlist. Note that this termination condition is only valid if one is playing to a ConnectionId.
TimeoutSystem.Int32The Timeout property specifies to the Application Runtime Environment how long to wait for a response from the provider for the current action. The ReturnValue returned in this case is Timeout. The value must be a literal value in milliseconds.
TermCondMaxDigitsSystem.UInt32The number of digits that will cause the SeekAndPlay operation to terminate. If this condition is met, the SeekAndPlay command will result in the SeekAndPlay_Complete event with a TerminationCondition of maxdigits. Note that this termination condition is only valid if one is playing to a ConnectionId.
TermCondDigitSystem.StringA specific digit that will cause the SeekAndPlay operation to terminate. If this condition is met, the SeekAndPlay command will result in the SeekAndPlay_Complete event with a TerminationCondition of digit. If you wish to know what digit or digits were pushed, use GatherDigits after SeekAndPlay_Complete, which will process the digits collected into the digit buffer as the SeekAndPlay command was executing. Note that this termination condition is only valid if one is playing to a ConnectionId.
TermCondMaxTimeSystem.UInt32The amount of time (in milliseconds) that can elapse before terminating the SeekAndPlay operation. If this condition is met, the SeekAndPlay command will result in the SeekAndPlay_Complete event with a TerminationCondition of maxtime.
TermCondSilenceSystem.UInt32The amount of silence (in milliseconds) to observe before terminating the SeekAndPlay operation. If this condition is met, the SeekAndPlay command will result in the SeekAndPlay_Complete event with a TerminationCondition of silence.
TermCondNonSilenceSystem.UInt32The amount of non-silence (in milliseconds) to observe before terminating the SeekAndPlay operation. If this condition is met, the SeekAndPlay command will result in the SeekAndPlay_Complete event with a TerminationCondition of nonsilence.
AudioFileSampleRateSystem.UInt32The sample rate of the audio file (in kHz). Valid values are 6, 8, or 11. 11 should be avoided as it has a higher impact on the media engine. If not specified, the media engine configuration file defines the sample rate to use, which by default is 8.
Result Data
Parameter Name.NET TypeDescription
ConnectionIdSystem.StringIn the case of a SeekAndPlay to a connection, the value of the ConnectionId result data is the same as that specified as an action parameter. In the case of a SeekAndPlay to a conference, the value of the ConnectionId result data is the value of the new connection added to conference. In either case, this ConnectionId is what one would later specify in StopMediaOperation if one were to abort the command programmatically.
OperationIdSystem.StringA unique identifier to this SeekAndPlay operation. This identifier can later be used by the StopMediaOperation action to stop just this particular operation on a connection, even if multiple media operations are concurrently executing on that connection. In the case that the SeekAndPlay was specified to a conference, there is no reason to store OperationId, since the ConnectionId returned as a result data will only ever have this SeekAndPlay action operating on it.
ResultCodeSystem.StringA numeric code indicating the result status of the operation. A '0' indicates success; a positive number indicates an error. Please reference the Media Control Error Codes table for descriptions on specific error codes.

Branch Conditions 

Success

No description.

Failure

No description.

Timeout

No description.