0

在播放、背景、阅读中,我们可以将音频文件&file1&file2.
在 PHPAgi 而不是 Read 中,我使用$agi->get_data,但它看起来只接受一个文件!

在调用 get_data 之前,我还尝试使用背景播放音频:

$multipleAudioPath = 'file1&file2';
$agi->exec('Background', $multipleAudioPath);
$rawInput = $agi->get_data('blankAudioFile', $timeout, $digits);

但是第一个字符用于破坏背景音频并且没有在 get_data 中捕获。

我能做些什么?我可以单独做 $agi->get_data吗?或者还有其他解决方案吗?

4

1 回答 1

0

您可以使用读取星号命令来使用多个文件。

$agi->exec("Read","variable,filename&filename2")

[Syntax]
Read(variable[,filename[&filename2[&...]][,maxdigits[,options[,attempts[,timeout]]]]])

[Arguments]
variable
    The input digits will be stored in the given <variable> name.
filename
    file(s) to play before reading digits or tone with option i
maxdigits
    Maximum acceptable number of digits. Stops reading after <maxdigits> have
    been entered (without requiring the user to press the '#' key).
    Defaults to '0' - no limit - wait for the user press the '#' key. Any value
    below '0' means the same. Max accepted value is '255'.
options
    s: to return immediately if the line is not up.

    i: to play  filename as an indication tone from your "indications.conf".

    n: to read digits even if the line is not up.

attempts
    If greater than '1', that many <attempts> will be made in the event no data
    is entered.
timeout
    The number of seconds to wait for a digit response. If greater than '0',
    that value will override the default timeout. Can be floating point.

[See Also]
SendDTMF()

其他选项是通过 SOX 或通过 libsox 将其混合在一起。

于 2019-05-15T17:01:20.553 回答