API Documentation (Beta)

prompt

Description

string prompt ( string $text [, int $barge_in [, int $time_out [, string $grammar]] )

prompt ouputs the synthesized text-to-speech of text.

Parameters

text

The string that needs to be processed and output.

barge_in

This controls whether or not the caller will be able to interrupt the speech output with a DTMF keypress or voice utterance.By default, this value is set to 0. i.e. it forces the caller to listen to entire prompt_text before being allowed to give input.

If you wish to enable it, following options can be set.

Pre-defined barge_in() bit options
name description
Bit 0 When this bit is set, the caller can interrupt the speech output.
Bit 1 When set, it specifies that DTMF keypresses can be used for interruption
Bit 2 When set, it specifies that Voice utterance can be used for interruption.
Bit 3 When set, it enables conditional interruption. Only if the voice utterance or DTMF keypress matches the specified grammar (prompt_grammar), the interruption will be successful.

time_out

This specifies the amount of time in seconds that VoicePHP will attempt to wait for receiving inputs from the user before returning. This timeout starts after the text has been played. By default, timeout is set to 5 sec.

grammar

This specifies the grammar to be used. Grammar can be either DTMF or Speech. This is required if the barge_in parameter is set to to 2. If this is not set, barge_in will defaults to DTMF.

Return Values

Returns user input.