doutuoben6908 2019-05-15 09:21
浏览 105

如何将$ agi-> get_data与多个音频文件一起使用

In Playback, Background, Read we can combine audio files with &, like file1&file2.
In PHPAgi instead of Read, I use $agi->get_data, but its look like accept only one file!

I also tried to play audio with Background before calling get_data:

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

But first character goes for breaking Background audio and didn't catch in get_data.

What can I do? Can I do it alone with $agi->get_data ? Or is there any other solution ?

  • 写回答

1条回答 默认 最新

  • 普通网友 2019-05-15 17:01
    关注

    You can use multiple files using Read asterisk command.

    $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()
    

    Other option is mix it together by SOX or via libsox.

    评论

报告相同问题?

悬赏问题

  • ¥20 怎么用dlib库的算法识别小麦病虫害
  • ¥15 华为ensp模拟器中S5700交换机在配置过程中老是反复重启
  • ¥15 java写代码遇到问题,求帮助
  • ¥15 uniapp uview http 如何实现统一的请求异常信息提示?
  • ¥15 有了解d3和topogram.js库的吗?有偿请教
  • ¥100 任意维数的K均值聚类
  • ¥15 stamps做sbas-insar,时序沉降图怎么画
  • ¥15 买了个传感器,根据商家发的代码和步骤使用但是代码报错了不会改,有没有人可以看看
  • ¥15 关于#Java#的问题,如何解决?
  • ¥15 加热介质是液体,换热器壳侧导热系数和总的导热系数怎么算