Playing

The Voice Message service provides two types of playing functions:

Use the ADI service function adiPlayAsync or adiStartPlaying for direct access to buffers. Refer to the ADI Service Developer's Reference Manual for more information on ADI functions.

The vceplay demonstration program demonstrates playing messages from one or more voice files.

This topic presents an overview of:

Play functions

 

To...

Use...

Start playing from the current position in the current message

vcePlay

Start playing from the beginning of the first message in a list of messages

vcePlayList

Play one message from a specified voice object

vcePlayMessage

Change the current play speed to a specified rate

vceSetPlaySpeed

Change the volume (loudness) of message playback by adjusting the amplification, or gain, applied to the message being played

vceSetPlayGain


Playing a sequence of messages

A list is one or more messages. Use vcePlayList to play a sequence of messages with no delays between each message. vcePlayList enables you to play a prompt string that vceBuildPromptList converted to a sequence of message numbers. All messages in the list must have the same encoding. If the messages are in different files, use vceSetCurrentList followed by vcePlay.

Play completion reasons

The following table lists the Voice Message service reason codes returned when play terminates. The value field of the VCEEVN_PLAY_DONE event states the reason.

Note: If play fails, the value field contains an error code.

If...

The DONE event contains...

The end of the current message or list is reached

CTA_REASON_FINISHED

The time limit in vcePlay is reached

CTA_REASON_TIMEOUT

Play is stopped by calling vceStop

CTA_REASON_STOPPED

A touch tone digit is received and the corresponding bit in the DTMF abort parameter is set

CTA_REASON_DIGIT

The call is ended

CTA_REASON_RELEASED

The attached device service does not support the encoding format of the playing object

CTAERR_FUNCTION_NOT_AVAIL


Adjusting volume and speed

You can set the volume (vceSetPlayGain) and speed (vceSetPlaySpeed) of play at any time. The new volume (gain or amplification) and the new speed are stored in the current context. If play is currently active, the change takes effect immediately. If you want a gain or speed change to carry over to the next play function, set the play gain or speed parameter on the next play to VCE_CURRENT_VALUE. The PacketMedia HMP process does not support play speed control.

You can also adjust the playing speed for some encoding formats. Speed control is available for the NMS ADPCM (VCE_ENCODE_NMS_xx) and the OKI ADPCM encoding formats (VCE_ENCODE_OKI_xx).

To increase the playing speed, increase the value of the maxspeed play parameter from a default value of 100. When play is started with a higher value of maxspeed, the necessary DSP resources are allocated to support increased speed. You can start play with a fast speed (up to the value of the maxspeed play parameter) by changing the value of the speed parameter.

Note: Starting play with maxspeed greater than 100 requires more DSP resources than required for playing at normal speed. To determine whether the AG boards and the configuration can support the increased speed, refer to the NMS OAM System User's Manual or the board-specific installation and developer's manual.

Use vceGetContextInfo to get the current gain and speed values.

Play parameters

The play functions take an optional pointer to a parameter structure. If you pass NULL, the parameters take default values. Refer to VCE_PLAY_PARMS for more information about the play parameters.