PHP code example of 365taofang / iflytek-asr

1. Go to this page and download the library: Download 365taofang/iflytek-asr library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

365taofang / iflytek-asr example snippets


$file = './audio/lfasr.wav';
$lfasrClient->upload_via_stream(file_get_contents($file), '测试1.wav', 3136940, 200, $roleType=0, $callbackUrl='http://callbacUrl.com');

/**
 *
 * @param $orderId string 订单id
 * @param $resultType string 查询结果类型:默认返回转写结果
 * 转写结果:transfer;
 * 翻译结果:translate;
 * 质检结果:predict;
 * 组合结果查询:多个类型结果使用”,”隔开,目前只支持转写和质检结果一起返回(如果任务有失败则只返回处理成功的结果)
 * 转写和质检结果组合返回:transfer,predict
 */
$lfasrClient->get_result('DKHJQ202212291654390770002600038F00000', 'transfer');